@prettier/cli
Advanced tools
@@ -49,4 +49,4 @@ import fs from "node:fs"; | ||
| const fileContent = fs.readFileSync(filePath, "utf8"); | ||
| const toml = await import("smol-toml"); | ||
| return toml.parse(fileContent); | ||
| const { parse } = await import("smol-toml"); | ||
| return parse(fileContent); | ||
| }, | ||
@@ -53,0 +53,0 @@ yaml: async (filePath) => { |
+16
-16
@@ -6,3 +6,3 @@ { | ||
| "license": "MIT", | ||
| "version": "0.9.0", | ||
| "version": "0.10.0", | ||
| "type": "module", | ||
@@ -31,3 +31,3 @@ "main": "dist/index.js", | ||
| "format": "npm run compile && node dist/bin.js --write src test", | ||
| "prepublishOnly": "npm run compile", | ||
| "prepublishOnly": "npm run clean && npm run compile", | ||
| "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --rootDir test/__tests__ --testTimeout 60000", | ||
@@ -40,10 +40,10 @@ "typecheck": "tsc --noEmit" | ||
| "dependencies": { | ||
| "atomically": "^2.0.3", | ||
| "atomically": "^2.1.0", | ||
| "fast-ignore": "^1.1.3", | ||
| "find-up-json": "^2.0.5", | ||
| "function-once": "^3.0.1", | ||
| "import-meta-resolve": "^4.1.0", | ||
| "is-binary-path": "^2.0.0", | ||
| "js-yaml": "^4.1.0", | ||
| "json-sorted-stringify": "^1.0.1", | ||
| "import-meta-resolve": "^4.2.0", | ||
| "is-binary-path": "^3.0.0", | ||
| "js-yaml": "^4.1.1", | ||
| "json-sorted-stringify": "^1.0.2", | ||
| "json5": "^2.2.3", | ||
@@ -54,5 +54,5 @@ "kasi": "^1.1.1", | ||
| "promise-resolve-timeout": "^2.0.1", | ||
| "smol-toml": "^1.3.4", | ||
| "smol-toml": "^1.5.2", | ||
| "specialist": "^1.4.5", | ||
| "tiny-editorconfig": "^1.0.0", | ||
| "tiny-editorconfig": "^1.0.1", | ||
| "tiny-readdir": "^2.7.4", | ||
@@ -62,3 +62,3 @@ "tiny-readdir-glob": "^1.23.2", | ||
| "worktank": "^3.0.2", | ||
| "zeptomatch": "^2.0.2", | ||
| "zeptomatch": "^2.1.0", | ||
| "zeptomatch-escape": "^1.0.1", | ||
@@ -68,7 +68,7 @@ "zeptomatch-is-static": "^1.0.1" | ||
| "devDependencies": { | ||
| "@types/jest": "^29.5.14", | ||
| "@types/jest": "^30.0.0", | ||
| "@types/js-yaml": "^4.0.9", | ||
| "@types/node": "^22.15.10", | ||
| "cross-env": "^7.0.3", | ||
| "jest": "^29.7.0", | ||
| "@types/node": "^24.10.1", | ||
| "cross-env": "^10.1.0", | ||
| "jest": "^30.2.0", | ||
| "jest-snapshot-serializer-ansi": "^2.2.1", | ||
@@ -78,8 +78,8 @@ "jest-snapshot-serializer-raw": "^2.0.0", | ||
| "nanoexec": "^1.1.0", | ||
| "prettier": "3.5.3", | ||
| "prettier": "3.6.2", | ||
| "radix64-encoding": "^2.0.2", | ||
| "tiny-dirname": "^1.0.2", | ||
| "typescript": "^5.8.3", | ||
| "typescript": "^5.9.3", | ||
| "zeptoid": "^1.0.2" | ||
| } | ||
| } |
| declare const plugins: { | ||
| options: { | ||
| singleQuote: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| bracketSpacing: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| oppositeDescription: string; | ||
| }; | ||
| bracketSameLine: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| htmlWhitespaceSensitivity: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| singleAttributePerLine: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| vueIndentScriptAndStyle: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| arrowParens: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| jsxBracketSameLine: { | ||
| category: string; | ||
| type: string; | ||
| description: string; | ||
| deprecated: string; | ||
| }; | ||
| semi: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| oppositeDescription: string; | ||
| }; | ||
| experimentalOperatorPosition: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| experimentalTernaries: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| oppositeDescription: string; | ||
| }; | ||
| jsxSingleQuote: { | ||
| category: string; | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| quoteProps: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| trailingComma: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| proseWrap: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| objectWrap: { | ||
| category: string; | ||
| type: string; | ||
| default: string; | ||
| description: string; | ||
| choices: { | ||
| value: string; | ||
| description: string; | ||
| }[]; | ||
| }; | ||
| }; | ||
| languages: ({ | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| color: string; | ||
| extensions: string[]; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| aliases?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| tmScope: string; | ||
| group: string; | ||
| extensions: string[]; | ||
| aceMode: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| codemirrorMode?: undefined; | ||
| codemirrorMimeType?: undefined; | ||
| aliases?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| aliases: string[]; | ||
| extensions: string[]; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| extensions: string[]; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| codemirrorMode?: undefined; | ||
| codemirrorMimeType?: undefined; | ||
| group?: undefined; | ||
| aliases?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| aliases: string[]; | ||
| extensions: string[]; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| codemirrorMode?: undefined; | ||
| codemirrorMimeType?: undefined; | ||
| group?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| color: string; | ||
| aliases: string[]; | ||
| extensions: string[]; | ||
| filenames: string[]; | ||
| interpreters: string[]; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| color: undefined; | ||
| aliases: undefined; | ||
| extensions: string[]; | ||
| filenames: undefined; | ||
| interpreters: undefined; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group: string; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| aliases: string[]; | ||
| interpreters: string[]; | ||
| extensions: string[]; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| filenames?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| group: string; | ||
| extensions: string[]; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| aliases?: undefined; | ||
| filenames?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| aliases: string[]; | ||
| extensions: string[]; | ||
| filenames: string[]; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| group: string; | ||
| tmScope: string; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| aliases: string[]; | ||
| extensions: string[]; | ||
| filenames: never[]; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| interpreters?: undefined; | ||
| wrap?: undefined; | ||
| } | { | ||
| linguistLanguageId: number; | ||
| name: string; | ||
| type: string; | ||
| color: string; | ||
| aliases: string[]; | ||
| aceMode: string; | ||
| codemirrorMode: string; | ||
| codemirrorMimeType: string; | ||
| wrap: boolean; | ||
| extensions: string[]; | ||
| filenames: string[]; | ||
| tmScope: string; | ||
| parsers: string[]; | ||
| vscodeLanguageIds: string[]; | ||
| group?: undefined; | ||
| interpreters?: undefined; | ||
| })[]; | ||
| parsers: any; | ||
| printers: any; | ||
| }; | ||
| export default plugins; |
| //TODO: Avoid hard-coding this code, and instead reuse "loadBuiltinPlugins", somehow (https://github.com/prettier/prettier/blob/main/src/plugins/builtin-plugins-proxy.js) | ||
| // This module makes sure plugins get lazy-loaded as needed | ||
| function createParsersAndPrinters(modules) { | ||
| const parsers = Object.create(null); | ||
| const printers = Object.create(null); | ||
| for (const { importPlugin, parsers: parserNames = [], printers: printerNames = [] } of modules) { | ||
| const loadPlugin = async () => { | ||
| const plugin = await importPlugin(); | ||
| Object.assign(parsers, plugin.parsers); | ||
| Object.assign(printers, plugin.printers); | ||
| return plugin; | ||
| }; | ||
| for (const parserName of parserNames) { | ||
| parsers[parserName] = async () => (await loadPlugin()).parsers[parserName]; | ||
| } | ||
| for (const printerName of printerNames) { | ||
| printers[printerName] = async () => (await loadPlugin()).printers[printerName]; | ||
| } | ||
| } | ||
| return { parsers, printers }; | ||
| } | ||
| const options = { | ||
| singleQuote: { | ||
| category: "Common", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Use single quotes instead of double quotes.", | ||
| }, | ||
| bracketSpacing: { | ||
| category: "Common", | ||
| type: "boolean", | ||
| default: true, | ||
| description: "Print spaces between brackets.", | ||
| oppositeDescription: "Do not print spaces between brackets.", | ||
| }, | ||
| bracketSameLine: { | ||
| category: "Common", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Put > of opening tags on the last line instead of on a new line.", | ||
| }, | ||
| htmlWhitespaceSensitivity: { | ||
| category: "HTML", | ||
| type: "choice", | ||
| default: "css", | ||
| description: "How to handle whitespaces in HTML.", | ||
| choices: [ | ||
| { | ||
| value: "css", | ||
| description: "Respect the default value of CSS display property.", | ||
| }, | ||
| { | ||
| value: "strict", | ||
| description: "Whitespaces are considered sensitive.", | ||
| }, | ||
| { | ||
| value: "ignore", | ||
| description: "Whitespaces are considered insensitive.", | ||
| }, | ||
| ], | ||
| }, | ||
| singleAttributePerLine: { | ||
| category: "Common", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Enforce single attribute per line in HTML, Vue and JSX.", | ||
| }, | ||
| vueIndentScriptAndStyle: { | ||
| category: "HTML", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Indent script and style tags in Vue files.", | ||
| }, | ||
| arrowParens: { | ||
| category: "JavaScript", | ||
| type: "choice", | ||
| default: "always", | ||
| description: "Include parentheses around a sole arrow function parameter.", | ||
| choices: [ | ||
| { | ||
| value: "always", | ||
| description: "Always include parens. Example: `(x) => x`", | ||
| }, | ||
| { | ||
| value: "avoid", | ||
| description: "Omit parens when possible. Example: `x => x`", | ||
| }, | ||
| ], | ||
| }, | ||
| jsxBracketSameLine: { | ||
| category: "JavaScript", | ||
| type: "boolean", | ||
| description: "Put > on the last line instead of at a new line.", | ||
| deprecated: "2.4.0", | ||
| }, | ||
| semi: { | ||
| category: "JavaScript", | ||
| type: "boolean", | ||
| default: true, | ||
| description: "Print semicolons.", | ||
| oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them.", | ||
| }, | ||
| experimentalOperatorPosition: { | ||
| category: "JavaScript", | ||
| type: "choice", | ||
| default: "end", | ||
| description: "Where to print operators when binary expressions wrap lines.", | ||
| choices: [ | ||
| { | ||
| value: "start", | ||
| description: "Print operators at the start of new lines.", | ||
| }, | ||
| { | ||
| value: "end", | ||
| description: "Print operators at the end of previous lines.", | ||
| }, | ||
| ], | ||
| }, | ||
| experimentalTernaries: { | ||
| category: "JavaScript", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Use curious ternaries, with the question mark after the condition.", | ||
| oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent.", | ||
| }, | ||
| jsxSingleQuote: { | ||
| category: "JavaScript", | ||
| type: "boolean", | ||
| default: false, | ||
| description: "Use single quotes in JSX.", | ||
| }, | ||
| quoteProps: { | ||
| category: "JavaScript", | ||
| type: "choice", | ||
| default: "as-needed", | ||
| description: "Change when properties in objects are quoted.", | ||
| choices: [ | ||
| { | ||
| value: "as-needed", | ||
| description: "Only add quotes around object properties where required.", | ||
| }, | ||
| { | ||
| value: "consistent", | ||
| description: "If at least one property in an object requires quotes, quote all properties.", | ||
| }, | ||
| { | ||
| value: "preserve", | ||
| description: "Respect the input use of quotes in object properties.", | ||
| }, | ||
| ], | ||
| }, | ||
| trailingComma: { | ||
| category: "JavaScript", | ||
| type: "choice", | ||
| default: "all", | ||
| description: "Print trailing commas wherever possible when multi-line.", | ||
| choices: [ | ||
| { | ||
| value: "all", | ||
| description: "Trailing commas wherever possible (including function arguments).", | ||
| }, | ||
| { | ||
| value: "es5", | ||
| description: "Trailing commas where valid in ES5 (objects, arrays, etc.)", | ||
| }, | ||
| { value: "none", description: "No trailing commas." }, | ||
| ], | ||
| }, | ||
| proseWrap: { | ||
| category: "Common", | ||
| type: "choice", | ||
| default: "preserve", | ||
| description: "How to wrap prose.", | ||
| choices: [ | ||
| { | ||
| value: "always", | ||
| description: "Wrap prose if it exceeds the print width.", | ||
| }, | ||
| { value: "never", description: "Do not wrap prose." }, | ||
| { value: "preserve", description: "Wrap prose as-is." }, | ||
| ], | ||
| }, | ||
| objectWrap: { | ||
| category: "Common", | ||
| type: "choice", | ||
| default: "preserve", | ||
| description: "How to wrap object literals.", | ||
| choices: [ | ||
| { | ||
| value: "preserve", | ||
| description: "Keep as multi-line, if there is a newline between the opening brace and first property.", | ||
| }, | ||
| { | ||
| value: "collapse", | ||
| description: "Fit to a single line when possible.", | ||
| }, | ||
| ], | ||
| }, | ||
| }; | ||
| const languages = [ | ||
| { | ||
| linguistLanguageId: 50, | ||
| name: "CSS", | ||
| type: "markup", | ||
| tmScope: "source.css", | ||
| aceMode: "css", | ||
| codemirrorMode: "css", | ||
| codemirrorMimeType: "text/css", | ||
| color: "#563d7c", | ||
| extensions: [".css", ".wxss"], | ||
| parsers: ["css"], | ||
| vscodeLanguageIds: ["css"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 262764437, | ||
| name: "PostCSS", | ||
| type: "markup", | ||
| color: "#dc3a0c", | ||
| tmScope: "source.postcss", | ||
| group: "CSS", | ||
| extensions: [".pcss", ".postcss"], | ||
| aceMode: "text", | ||
| parsers: ["css"], | ||
| vscodeLanguageIds: ["postcss"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 198, | ||
| name: "Less", | ||
| type: "markup", | ||
| color: "#1d365d", | ||
| aliases: ["less-css"], | ||
| extensions: [".less"], | ||
| tmScope: "source.css.less", | ||
| aceMode: "less", | ||
| codemirrorMode: "css", | ||
| codemirrorMimeType: "text/css", | ||
| parsers: ["less"], | ||
| vscodeLanguageIds: ["less"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 329, | ||
| name: "SCSS", | ||
| type: "markup", | ||
| color: "#c6538c", | ||
| tmScope: "source.css.scss", | ||
| aceMode: "scss", | ||
| codemirrorMode: "css", | ||
| codemirrorMimeType: "text/x-scss", | ||
| extensions: [".scss"], | ||
| parsers: ["scss"], | ||
| vscodeLanguageIds: ["scss"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 139, | ||
| name: "GraphQL", | ||
| type: "data", | ||
| color: "#e10098", | ||
| extensions: [".graphql", ".gql", ".graphqls"], | ||
| tmScope: "source.graphql", | ||
| aceMode: "text", | ||
| parsers: ["graphql"], | ||
| vscodeLanguageIds: ["graphql"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 155, | ||
| name: "Handlebars", | ||
| type: "markup", | ||
| color: "#f7931e", | ||
| aliases: ["hbs", "htmlbars"], | ||
| extensions: [".handlebars", ".hbs"], | ||
| tmScope: "text.html.handlebars", | ||
| aceMode: "handlebars", | ||
| parsers: ["glimmer"], | ||
| vscodeLanguageIds: ["handlebars"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 146, | ||
| name: "Angular", | ||
| type: "markup", | ||
| tmScope: "text.html.basic", | ||
| aceMode: "html", | ||
| codemirrorMode: "htmlmixed", | ||
| codemirrorMimeType: "text/html", | ||
| color: "#e34c26", | ||
| aliases: ["xhtml"], | ||
| extensions: [".component.html"], | ||
| parsers: ["angular"], | ||
| vscodeLanguageIds: ["html"], | ||
| filenames: [], | ||
| }, | ||
| { | ||
| linguistLanguageId: 146, | ||
| name: "HTML", | ||
| type: "markup", | ||
| tmScope: "text.html.basic", | ||
| aceMode: "html", | ||
| codemirrorMode: "htmlmixed", | ||
| codemirrorMimeType: "text/html", | ||
| color: "#e34c26", | ||
| aliases: ["xhtml"], | ||
| extensions: [".html", ".hta", ".htm", ".html.hl", ".inc", ".xht", ".xhtml", ".mjml"], | ||
| parsers: ["html"], | ||
| vscodeLanguageIds: ["html"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 146, | ||
| name: "Lightning Web Components", | ||
| type: "markup", | ||
| tmScope: "text.html.basic", | ||
| aceMode: "html", | ||
| codemirrorMode: "htmlmixed", | ||
| codemirrorMimeType: "text/html", | ||
| color: "#e34c26", | ||
| aliases: ["xhtml"], | ||
| extensions: [], | ||
| parsers: ["lwc"], | ||
| vscodeLanguageIds: ["html"], | ||
| filenames: [], | ||
| }, | ||
| { | ||
| linguistLanguageId: 391, | ||
| name: "Vue", | ||
| type: "markup", | ||
| color: "#41b883", | ||
| extensions: [".vue"], | ||
| tmScope: "text.html.vue", | ||
| aceMode: "html", | ||
| parsers: ["vue"], | ||
| vscodeLanguageIds: ["vue"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 183, | ||
| name: "JavaScript", | ||
| type: "programming", | ||
| tmScope: "source.js", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "text/javascript", | ||
| color: "#f1e05a", | ||
| aliases: ["js", "node"], | ||
| extensions: [ | ||
| ".js", | ||
| "._js", | ||
| ".bones", | ||
| ".cjs", | ||
| ".es", | ||
| ".es6", | ||
| ".frag", | ||
| ".gs", | ||
| ".jake", | ||
| ".javascript", | ||
| ".jsb", | ||
| ".jscad", | ||
| ".jsfl", | ||
| ".jslib", | ||
| ".jsm", | ||
| ".jspre", | ||
| ".jss", | ||
| ".mjs", | ||
| ".njs", | ||
| ".pac", | ||
| ".sjs", | ||
| ".ssjs", | ||
| ".xsjs", | ||
| ".xsjslib", | ||
| ".wxs", | ||
| ], | ||
| filenames: ["Jakefile"], | ||
| interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], | ||
| parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], | ||
| vscodeLanguageIds: ["javascript", "mongo"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 183, | ||
| name: "Flow", | ||
| type: "programming", | ||
| tmScope: "source.js", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "text/javascript", | ||
| color: "#f1e05a", | ||
| aliases: [], | ||
| extensions: [".js.flow"], | ||
| filenames: [], | ||
| interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], | ||
| parsers: ["flow", "babel-flow"], | ||
| vscodeLanguageIds: ["javascript"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 183, | ||
| name: "JSX", | ||
| type: "programming", | ||
| tmScope: "source.js.jsx", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "jsx", | ||
| codemirrorMimeType: "text/jsx", | ||
| color: undefined, | ||
| aliases: undefined, | ||
| extensions: [".jsx"], | ||
| filenames: undefined, | ||
| interpreters: undefined, | ||
| parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], | ||
| vscodeLanguageIds: ["javascriptreact"], | ||
| group: "JavaScript", | ||
| }, | ||
| { | ||
| linguistLanguageId: 378, | ||
| name: "TypeScript", | ||
| type: "programming", | ||
| color: "#3178c6", | ||
| aliases: ["ts"], | ||
| interpreters: ["deno", "ts-node"], | ||
| extensions: [".ts", ".cts", ".mts"], | ||
| tmScope: "source.ts", | ||
| aceMode: "typescript", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "application/typescript", | ||
| parsers: ["typescript", "babel-ts"], | ||
| vscodeLanguageIds: ["typescript"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 94901924, | ||
| name: "TSX", | ||
| type: "programming", | ||
| color: "#3178c6", | ||
| group: "TypeScript", | ||
| extensions: [".tsx"], | ||
| tmScope: "source.tsx", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "jsx", | ||
| codemirrorMimeType: "text/jsx", | ||
| parsers: ["typescript", "babel-ts"], | ||
| vscodeLanguageIds: ["typescriptreact"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 174, | ||
| name: "JSON.stringify", | ||
| type: "data", | ||
| color: "#292929", | ||
| tmScope: "source.json", | ||
| aceMode: "json", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "application/json", | ||
| aliases: ["geojson", "jsonl", "topojson"], | ||
| extensions: [".importmap"], | ||
| filenames: ["package.json", "package-lock.json", "composer.json"], | ||
| parsers: ["json-stringify"], | ||
| vscodeLanguageIds: ["json"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 174, | ||
| name: "JSON", | ||
| type: "data", | ||
| color: "#292929", | ||
| tmScope: "source.json", | ||
| aceMode: "json", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "application/json", | ||
| aliases: ["geojson", "jsonl", "topojson"], | ||
| extensions: [ | ||
| ".json", | ||
| ".4DForm", | ||
| ".4DProject", | ||
| ".avsc", | ||
| ".geojson", | ||
| ".gltf", | ||
| ".har", | ||
| ".ice", | ||
| ".JSON-tmLanguage", | ||
| ".mcmeta", | ||
| ".tfstate", | ||
| ".tfstate.backup", | ||
| ".topojson", | ||
| ".webapp", | ||
| ".webmanifest", | ||
| ".yy", | ||
| ".yyp", | ||
| ], | ||
| filenames: [ | ||
| ".all-contributorsrc", | ||
| ".arcconfig", | ||
| ".auto-changelog", | ||
| ".c8rc", | ||
| ".htmlhintrc", | ||
| ".imgbotconfig", | ||
| ".nycrc", | ||
| ".tern-config", | ||
| ".tern-project", | ||
| ".watchmanconfig", | ||
| "Pipfile.lock", | ||
| "composer.lock", | ||
| "flake.lock", | ||
| "mcmod.info", | ||
| ".babelrc", | ||
| ".jscsrc", | ||
| ".jshintrc", | ||
| ".jslintrc", | ||
| ".swcrc", | ||
| ], | ||
| parsers: ["json"], | ||
| vscodeLanguageIds: ["json"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 423, | ||
| name: "JSON with Comments", | ||
| type: "data", | ||
| color: "#292929", | ||
| group: "JSON", | ||
| tmScope: "source.js", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "text/javascript", | ||
| aliases: ["jsonc"], | ||
| extensions: [ | ||
| ".jsonc", | ||
| ".code-snippets", | ||
| ".code-workspace", | ||
| ".sublime-build", | ||
| ".sublime-commands", | ||
| ".sublime-completions", | ||
| ".sublime-keymap", | ||
| ".sublime-macro", | ||
| ".sublime-menu", | ||
| ".sublime-mousemap", | ||
| ".sublime-project", | ||
| ".sublime-settings", | ||
| ".sublime-theme", | ||
| ".sublime-workspace", | ||
| ".sublime_metrics", | ||
| ".sublime_session", | ||
| ], | ||
| filenames: [], | ||
| parsers: ["jsonc"], | ||
| vscodeLanguageIds: ["jsonc"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 175, | ||
| name: "JSON5", | ||
| type: "data", | ||
| color: "#267CB9", | ||
| extensions: [".json5"], | ||
| tmScope: "source.js", | ||
| aceMode: "javascript", | ||
| codemirrorMode: "javascript", | ||
| codemirrorMimeType: "application/json", | ||
| parsers: ["json5"], | ||
| vscodeLanguageIds: ["json5"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 222, | ||
| name: "Markdown", | ||
| type: "prose", | ||
| color: "#083fa1", | ||
| aliases: ["md", "pandoc"], | ||
| aceMode: "markdown", | ||
| codemirrorMode: "gfm", | ||
| codemirrorMimeType: "text/x-gfm", | ||
| wrap: true, | ||
| extensions: [".md", ".livemd", ".markdown", ".mdown", ".mdwn", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"], | ||
| filenames: ["contents.lr", "README"], | ||
| tmScope: "text.md", | ||
| parsers: ["markdown"], | ||
| vscodeLanguageIds: ["markdown"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 222, | ||
| name: "MDX", | ||
| type: "prose", | ||
| color: "#083fa1", | ||
| aliases: ["md", "pandoc"], | ||
| aceMode: "markdown", | ||
| codemirrorMode: "gfm", | ||
| codemirrorMimeType: "text/x-gfm", | ||
| wrap: true, | ||
| extensions: [".mdx"], | ||
| filenames: [], | ||
| tmScope: "text.md", | ||
| parsers: ["mdx"], | ||
| vscodeLanguageIds: ["mdx"], | ||
| }, | ||
| { | ||
| linguistLanguageId: 407, | ||
| name: "YAML", | ||
| type: "data", | ||
| color: "#cb171e", | ||
| tmScope: "source.yaml", | ||
| aliases: ["yml"], | ||
| extensions: [".yml", ".mir", ".reek", ".rviz", ".sublime-syntax", ".syntax", ".yaml", ".yaml-tmlanguage", ".yaml.sed", ".yml.mysql"], | ||
| filenames: [".clang-format", ".clang-tidy", ".gemrc", "CITATION.cff", "glide.lock", ".prettierrc", ".stylelintrc", ".lintstagedrc"], | ||
| aceMode: "yaml", | ||
| codemirrorMode: "yaml", | ||
| codemirrorMimeType: "text/x-yaml", | ||
| parsers: ["yaml"], | ||
| vscodeLanguageIds: ["yaml", "ansible", "home-assistant"], | ||
| }, | ||
| ]; | ||
| const { parsers, printers } = createParsersAndPrinters([ | ||
| { | ||
| importPlugin: () => import("prettier/plugins/acorn"), | ||
| parsers: ["acorn", "espree"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/angular"), | ||
| parsers: ["__ng_action", "__ng_binding", "__ng_interpolation", "__ng_directive"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/babel"), | ||
| parsers: [ | ||
| "babel", | ||
| "babel-flow", | ||
| "babel-ts", | ||
| "__js_expression", | ||
| "__ts_expression", | ||
| "__vue_expression", | ||
| "__vue_ts_expression", | ||
| "__vue_event_binding", | ||
| "__vue_ts_event_binding", | ||
| "__babel_estree", | ||
| "json", | ||
| "json5", | ||
| "jsonc", | ||
| "json-stringify", | ||
| ], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/estree"), | ||
| printers: ["estree", "estree-json"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/flow"), | ||
| parsers: ["flow"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/glimmer"), | ||
| parsers: ["glimmer"], | ||
| printers: ["glimmer"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/graphql"), | ||
| parsers: ["graphql"], | ||
| printers: ["graphql"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/html"), | ||
| parsers: ["html", "angular", "vue", "lwc"], | ||
| printers: ["html"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/markdown"), | ||
| parsers: ["markdown", "mdx", "remark"], | ||
| printers: ["mdast"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/meriyah"), | ||
| parsers: ["meriyah"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/postcss"), | ||
| parsers: ["css", "less", "scss"], | ||
| printers: ["postcss"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/typescript"), | ||
| parsers: ["typescript"], | ||
| }, | ||
| { | ||
| importPlugin: () => import("prettier/plugins/yaml"), | ||
| parsers: ["yaml"], | ||
| printers: ["yaml"], | ||
| }, | ||
| ]); | ||
| const plugins = { options, languages, parsers, printers }; | ||
| export default plugins; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2
-33.33%102358
-22.51%37
-5.13%2197
-31.54%+ Added
+ Added
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated