Content-Length: 10104 | pFad | http://github.com/eslint/eslint/pull/19354.diff
67B9D655 diff --git a/.markdownlint.yml b/.markdownlint.yml index c9fa0d884321..a3ab221c06ce 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -1,18 +1,12 @@ default: true +extends: markdownlint/style/prettier # Exclusions for deliberate/widespread violations MD002: false # First header should be a h1 header -MD004: # Unordered list style - style: asterisk MD007: # Unordered list indentation indent: 4 -MD013: false # Line length -MD019: false # Multiple spaces after hash on atx style header -MD021: false # Multiple spaces inside hashes on closed atx style header MD024: false # Multiple headers with the same content MD026: false # Trailing punctuation in header -MD029: false # Ordered list item prefix -MD030: false # Spaces after list markers MD033: false # Allow inline HTML MD041: false # First line in file should be a top level header MD046: # Code block style diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000000..d802dbce48ff --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "trailingComma": "none" +} diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index d443c2951d3b..a23c23fa1658 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -54,13 +54,15 @@ lint: - yamllint - trufflehog # Requires the network to run. ignore: - - linters: [markdownlint] + - linters: [markdownlint, prettier] paths: - CHANGELOG.md - linters: [prettier] paths: - - "**" # Ignore all files - - "!conf/**/*.json" # Except for json files in conf/ + - docs/src/_includes + - docs/src/rules/*.md + - packages/js/src/configs/eslint-all.js + - tests/fixtures actions: disabled: - trunk-announce diff --git a/docs/.stylelintrc.json b/docs/.stylelintrc.json index ab3b3fd039d8..10805e53ef5e 100644 --- a/docs/.stylelintrc.json +++ b/docs/.stylelintrc.json @@ -1,5 +1,5 @@ { - "extends": ["stylelint-config-standard-scss"], + "extends": ["stylelint-config-standard-scss", "stylelint-config-prettier"], "rules": { "alpha-value-notation": "number", "at-rule-empty-line-before": null, @@ -11,8 +11,6 @@ }], "declaration-block-no-redundant-longhand-properties": null, "hue-degree-notation": "number", - "indentation": 4, - "max-line-length": null, "no-descending-specificity": null, "number-leading-zero": null, "number-no-trailing-zeros": null, @@ -24,7 +22,19 @@ "files": [ "**/*.html" ], - "extends": ["stylelint-config-html/html", "stylelint-config-standard"] + "extends": [ + "stylelint-config-html/html", + "stylelint-config-standard", + "stylelint-config-prettier" + ] + }, + { + "files": [ + "**/*.scss" + ], + "rules": { + "scss/operator-no-newline-after": null + } } ], "ignoreFiles": [ diff --git a/docs/package.json b/docs/package.json index e985e00333fa..506e06f9a1e9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -52,6 +52,7 @@ "stylelint": "^14.13.0", "stylelint-config-html": "^1.1.0", "stylelint-config-standard": "^29.0.0", + "stylelint-config-prettier": "^9.0.5", "stylelint-config-standard-scss": "^5.0.0", "tap-spot": "^1.1.2" }, diff --git a/eslint.config.js b/eslint.config.js index 12e2afe7b797..f5ac6d3e5c4c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,7 +15,6 @@ const eslintPluginRulesRecommendedConfig = require("eslint-plugin-eslint-plugin/ const eslintPluginTestsRecommendedConfig = require("eslint-plugin-eslint-plugin/configs/tests-recommended"); const globals = require("globals"); const eslintConfigESLintCJS = require("eslint-config-eslint/cjs"); -const eslintConfigESLintFormatting = require("eslint-config-eslint/formatting"); const eslintPluginYml = require("eslint-plugin-yml"); const json = require("@eslint/json").default; const expectType = require("eslint-plugin-expect-type"); @@ -79,11 +78,6 @@ module.exports = [ name: `eslint/${config.name}`, files: [ALL_JS_FILES] })), - { - ...eslintConfigESLintFormatting, - name: "eslint/formatting", - files: [ALL_JS_FILES] - }, { name: "eslint/global-ignores", ignores: [ @@ -163,7 +157,8 @@ module.exports = [ "errors" ] ], - "eslint-plugin/test-case-shorthand-strings": "error" + "eslint-plugin/test-case-shorthand-strings": "error", + "no-useless-concat": "off" } }, { diff --git a/package.json b/package.json index a6bebd091180..bb9f2956cc43 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,7 @@ "pre-commit": "lint-staged" }, "lint-staged": { - "*.js": "trunk check --fix --filter=eslint", - "*.md": "trunk check --fix --filter=markdownlint", + "*": "trunk check --fix", "lib/rules/*.js": [ "node tools/update-eslint-all.js", "node tools/update-rule-type-headers.js", @@ -83,8 +82,7 @@ "node tools/check-rule-examples.js", "node tools/fetch-docs-links.js", "git add docs/src/_data/further_reading_links.json" - ], - "docs/**/*.svg": "trunk check --fix --filter=svgo" + ] }, "files": [ "LICENSE", diff --git a/packages/js/src/configs/eslint-all.js b/packages/js/src/configs/eslint-all.js index e7f4e0e3a11b..a854e5f16ce5 100644 --- a/packages/js/src/configs/eslint-all.js +++ b/packages/js/src/configs/eslint-all.js @@ -4,8 +4,6 @@ */ "use strict"; -/* eslint quote-props: off -- autogenerated so don't lint */ - /* * IMPORTANT! * diff --git a/tests/lib/rules/utils/ast-utils.js b/tests/lib/rules/utils/ast-utils.js index 392e5ab57498..63feb0236ca9 100644 --- a/tests/lib/rules/utils/ast-utils.js +++ b/tests/lib/rules/utils/ast-utils.js @@ -451,8 +451,6 @@ describe("ast-utils", () => { }); describe("getStaticStringValue", () => { - - /* eslint-disable quote-props -- Make consistent here for readability */ const expectedResults = { // string literals @@ -516,7 +514,6 @@ describe("ast-utils", () => { "this": null, "(function () {})": null }; - /* eslint-enable quote-props -- Make consistent here for readability */ Object.keys(expectedResults).forEach(key => { it(`should return ${expectedResults[key]} for ${key}`, () => { @@ -1070,8 +1067,6 @@ describe("ast-utils", () => { }); describe("getNextLocation", () => { - - /* eslint-disable quote-props -- Make consistent here for readability */ const expectedResults = { "": [[1, 0], null], "\n": [[1, 0], [2, 0], null], @@ -1093,7 +1088,6 @@ describe("ast-utils", () => { "a\t": [[1, 0], [1, 1], [1, 2], null], "a \n": [[1, 0], [1, 1], [1, 2], [2, 0], null] }; - /* eslint-enable quote-props -- Make consistent here for readability */ Object.keys(expectedResults).forEach(code => { it(`should return expected locations for "${code}".`, () => { @@ -1721,8 +1715,6 @@ describe("ast-utils", () => { }); describe("hasOctalOrNonOctalDecimalEscapeSequence", () => { - - /* eslint-disable quote-props -- Make consistent here for readability */ const expectedResults = { "\\1": true, "\\2": true, @@ -1794,7 +1786,6 @@ describe("ast-utils", () => { "foo\\\nbar": false, "128\\\n349": false }; - /* eslint-enable quote-props -- Make consistent here for readability */ Object.keys(expectedResults).forEach(key => { it(`should return ${expectedResults[key]} for ${key}`, () => { diff --git a/tests/lib/shared/string-utils.js b/tests/lib/shared/string-utils.js index 6682f140f489..b2910cc737a2 100644 --- a/tests/lib/shared/string-utils.js +++ b/tests/lib/shared/string-utils.js @@ -57,7 +57,6 @@ describe("upperCaseFirst", () => { }); describe("getGraphemeCount", () => { - /* eslint-disable quote-props -- Make consistent here for readability */ const expectedResults = { "": 0, "a": 1, @@ -79,7 +78,6 @@ describe("getGraphemeCount", () => { "πΆπ½π¨βπ©βπ¦": 2, "π©βπ¦°π©βπ©βπ¦βπ¦π³οΈβπ": 3 // 3 grapheme, 14 code points, 22 code units }; - /* eslint-enable quote-props -- Make consistent here for readability */ Object.entries(expectedResults).forEach(([key, value]) => { it(`should return ${value} for ${escapeControlCharacters(key)}`, () => { diff --git a/tools/update-eslint-all.js b/tools/update-eslint-all.js index e6cf4af16385..e97935aca448 100644 --- a/tools/update-eslint-all.js +++ b/tools/update-eslint-all.js @@ -34,8 +34,6 @@ const code = `/* */ "use strict"; -/* eslint quote-props: off -- autogenerated so don't lint */ - /* * IMPORTANT! * diff --git a/tools/update-readme.js b/tools/update-readme.js index 1d7bd7a4eeb0..f52d4fe2d6b9 100644 --- a/tools/update-readme.js +++ b/tools/update-readme.js @@ -56,7 +56,6 @@ async function fetchTeamData() { * @returns {string} The HTML for the members list. */ function formatTeamMembers(members) { - /* eslint-disable indent -- Allow deeper template substitution indent */ return stripIndents`Fetched URL: http://github.com/eslint/eslint/pull/19354.diff
Alternative Proxies: