eslint-config-prettier
Advanced tools
Comparing version 8.5.0 to 9.0.0
@@ -11,6 +11,16 @@ #!/usr/bin/env node | ||
// with no local eslint-config-prettier installation. | ||
const { ESLint } = require(require.resolve("eslint", { | ||
paths: [process.cwd(), ...require.resolve.paths("eslint")], | ||
})); | ||
const localRequire = (request) => | ||
require(require.resolve(request, { | ||
paths: [process.cwd(), ...require.resolve.paths("eslint")], | ||
})); | ||
let experimentalApi = {}; | ||
try { | ||
experimentalApi = localRequire("eslint/use-at-your-own-risk"); | ||
// eslint-disable-next-line unicorn/prefer-optional-catch-binding | ||
} catch (_error) {} | ||
const { ESLint, FlatESLint = experimentalApi.FlatESLint } = | ||
localRequire("eslint"); | ||
const SPECIAL_RULES_URL = | ||
@@ -31,4 +41,23 @@ "https://github.com/prettier/eslint-config-prettier#special-rules"; | ||
const eslint = new ESLint(); | ||
const flatESLint = FlatESLint === undefined ? undefined : new FlatESLint(); | ||
Promise.all(args.map((file) => eslint.calculateConfigForFile(file))) | ||
Promise.all( | ||
args.map((file) => { | ||
switch (process.env.ESLINT_USE_FLAT_CONFIG) { | ||
case "true": { | ||
return flatESLint.calculateConfigForFile(file); | ||
} | ||
case "false": { | ||
return eslint.calculateConfigForFile(file); | ||
} | ||
default: { | ||
// This turns synchronous errors (such as `.calculateConfigForFile` not existing) | ||
// and turns them into promise rejections. | ||
return Promise.resolve() | ||
.then(() => flatESLint.calculateConfigForFile(file)) | ||
.catch(() => eslint.calculateConfigForFile(file)); | ||
} | ||
} | ||
}) | ||
) | ||
.then((configs) => { | ||
@@ -35,0 +64,0 @@ const rules = configs.flatMap(({ rules }, index) => |
59
index.js
@@ -18,2 +18,3 @@ "use strict"; | ||
"quotes": 0, | ||
"@typescript-eslint/lines-around-comment": 0, | ||
"@typescript-eslint/quotes": 0, | ||
@@ -41,3 +42,2 @@ "babel/quotes": 0, | ||
"function-paren-newline": "off", | ||
"generator-star": "off", | ||
"generator-star-spacing": "off", | ||
@@ -50,7 +50,6 @@ "implicit-arrow-linebreak": "off", | ||
"linebreak-style": "off", | ||
"max-statements-per-line": "off", | ||
"multiline-ternary": "off", | ||
"newline-per-chained-call": "off", | ||
"new-parens": "off", | ||
"no-arrow-condition": "off", | ||
"no-comma-dangle": "off", | ||
"no-extra-parens": "off", | ||
@@ -62,7 +61,4 @@ "no-extra-semi": "off", | ||
"no-multiple-empty-lines": "off", | ||
"no-reserved-keys": "off", | ||
"no-space-before-semi": "off", | ||
"no-trailing-spaces": "off", | ||
"no-whitespace-before-property": "off", | ||
"no-wrap-func": "off", | ||
"nonblock-statement-body-position": "off", | ||
@@ -80,18 +76,10 @@ "object-curly-newline": "off", | ||
"semi-style": "off", | ||
"space-after-function-name": "off", | ||
"space-after-keywords": "off", | ||
"space-before-blocks": "off", | ||
"space-before-function-paren": "off", | ||
"space-before-function-parentheses": "off", | ||
"space-before-keywords": "off", | ||
"space-in-brackets": "off", | ||
"space-in-parens": "off", | ||
"space-infix-ops": "off", | ||
"space-return-throw-case": "off", | ||
"space-unary-ops": "off", | ||
"space-unary-word-ops": "off", | ||
"switch-colon-spacing": "off", | ||
"template-curly-spacing": "off", | ||
"template-tag-spacing": "off", | ||
"unicode-bom": "off", | ||
"wrap-iife": "off", | ||
@@ -102,2 +90,3 @@ "wrap-regex": "off", | ||
"@babel/semi": "off", | ||
"@typescript-eslint/block-spacing": "off", | ||
"@typescript-eslint/brace-style": "off", | ||
@@ -108,2 +97,3 @@ "@typescript-eslint/comma-dangle": "off", | ||
"@typescript-eslint/indent": "off", | ||
"@typescript-eslint/key-spacing": "off", | ||
"@typescript-eslint/keyword-spacing": "off", | ||
@@ -155,2 +145,3 @@ "@typescript-eslint/member-delimiter-style": "off", | ||
"vue/array-bracket-spacing": "off", | ||
"vue/array-element-newline": "off", | ||
"vue/arrow-spacing": "off", | ||
@@ -174,2 +165,3 @@ "vue/block-spacing": "off", | ||
"vue/multiline-html-element-content-newline": "off", | ||
"vue/multiline-ternary": "off", | ||
"vue/mustache-interpolation-spacing": "off", | ||
@@ -192,8 +184,47 @@ "vue/no-extra-parens": "off", | ||
...(includeDeprecated && { | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/generator-star | ||
"generator-star": "off", | ||
// Deprecated since version 4.0.0. | ||
// https://github.com/eslint/eslint/pull/8286 | ||
"indent-legacy": "off", | ||
// Removed in version 2.0.0. | ||
// https://eslint.org/docs/latest/rules/no-arrow-condition | ||
"no-arrow-condition": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/no-comma-dangle | ||
"no-comma-dangle": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/no-reserved-keys | ||
"no-reserved-keys": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/no-space-before-semi | ||
"no-space-before-semi": "off", | ||
// Deprecated since version 3.3.0. | ||
// https://eslint.org/docs/rules/no-spaced-func | ||
"no-spaced-func": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/no-wrap-func | ||
"no-wrap-func": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/space-after-function-name | ||
"space-after-function-name": "off", | ||
// Removed in version 2.0.0. | ||
// https://eslint.org/docs/latest/rules/space-after-keywords | ||
"space-after-keywords": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/space-before-function-parentheses | ||
"space-before-function-parentheses": "off", | ||
// Removed in version 2.0.0. | ||
// https://eslint.org/docs/latest/rules/space-before-keywords | ||
"space-before-keywords": "off", | ||
// Removed in version 1.0.0. | ||
// https://eslint.org/docs/latest/rules/space-in-brackets | ||
"space-in-brackets": "off", | ||
// Removed in version 2.0.0. | ||
// https://eslint.org/docs/latest/rules/space-return-throw-case | ||
"space-return-throw-case": "off", | ||
// Removed in version 0.10.0. | ||
// https://eslint.org/docs/latest/rules/space-unary-word-ops | ||
"space-unary-word-ops": "off", | ||
// Deprecated since version 7.0.0. | ||
@@ -200,0 +231,0 @@ // https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06 |
{ | ||
"name": "eslint-config-prettier", | ||
"version": "8.5.0", | ||
"version": "9.0.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Simon Lydell", |
@@ -9,2 +9,4 @@ # eslint-config-prettier | ||
[prettier]: https://github.com/prettier/prettier | ||
**[➡️ Full readme](https://github.com/prettier/eslint-config-prettier/)** |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
20758
499
11
4