Cleanup ESLint config (#16651)
This commit is contained in:
1 parent
5711e854a1
commit
57f561b203
3 files changed
+23
-35
No files matched your search
+13
-16
@@ -1,7 +1,5 @@
|
||||
import url from "node:url";
|
||||
|
||||
import { fixupPluginRules } from "@eslint/compat";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import eslintPluginJs from "@eslint/js";
|
||||
import eslintPluginStylisticJs from "@stylistic/eslint-plugin-js";
|
||||
import eslintPluginTypescriptEslint from "@typescript-eslint/eslint-plugin";
|
||||
@@ -10,18 +8,15 @@ import eslintConfigPrettier from "eslint-config-prettier";
|
||||
import eslintPluginImport from "eslint-plugin-import";
|
||||
import eslintPluginJest from "eslint-plugin-jest";
|
||||
import eslintPluginN from "eslint-plugin-n";
|
||||
import eslintPluginReactConfigRecommended from "eslint-plugin-react/configs/recommended.js";
|
||||
import eslintPluginReact from "eslint-plugin-react";
|
||||
import eslintPluginRegexp from "eslint-plugin-regexp";
|
||||
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
|
||||
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
||||
import globals from "globals";
|
||||
|
||||
import eslintPluginPrettierInternalRules from "./scripts/tools/eslint-plugin-prettier-internal-rules/index.js";
|
||||
|
||||
const toPath = (file) => url.fileURLToPath(new URL(file, import.meta.url));
|
||||
const compat = new FlatCompat({ baseDirectory: toPath("./") });
|
||||
eslintPluginReactConfigRecommended.plugins.react = fixupPluginRules(
|
||||
eslintPluginReactConfigRecommended.plugins.react,
|
||||
);
|
||||
|
||||
const ignores = `
|
||||
.tmp
|
||||
@@ -53,8 +48,10 @@ export default [
|
||||
eslintPluginRegexp.configs["flat/recommended"],
|
||||
eslintPluginUnicorn.configs["flat/recommended"],
|
||||
eslintConfigPrettier,
|
||||
...compat.env({ es2024: true, node: true }),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: { ...globals.builtin, ...globals.node },
|
||||
},
|
||||
plugins: {
|
||||
"@stylistic/js": eslintPluginStylisticJs,
|
||||
"@typescript-eslint": eslintPluginTypescriptEslint,
|
||||
@@ -442,20 +439,20 @@ export default [
|
||||
],
|
||||
},
|
||||
},
|
||||
...compat
|
||||
.env({ browser: true, worker: true })
|
||||
.map((config) => ({ ...config, files: ["website/**/*"] })),
|
||||
// Use `Object.assign` since it contains non-enumerable properties
|
||||
Object.assign(eslintPluginReactConfigRecommended, {
|
||||
{
|
||||
files: ["website/**/*"],
|
||||
...eslintPluginReact.configs.flat.recommended,
|
||||
},
|
||||
{
|
||||
files: ["website/**/*"],
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser, ...globals.worker },
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "18",
|
||||
},
|
||||
},
|
||||
}),
|
||||
{
|
||||
files: ["website/**/*"],
|
||||
rules: {
|
||||
"react/display-name": "off",
|
||||
"react/no-deprecated": "off",
|
||||
|
||||
+1
-2
@@ -107,8 +107,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/generator": "7.25.6",
|
||||
"@eslint/compat": "1.1.1",
|
||||
"@eslint/eslintrc": "3.1.0",
|
||||
"@eslint/js": "9.10.0",
|
||||
"@stylistic/eslint-plugin-js": "2.7.2",
|
||||
"@types/eslint__js": "8.42.3",
|
||||
@@ -138,6 +136,7 @@
|
||||
"eslint-plugin-unicorn": "55.0.0",
|
||||
"esm-utils": "4.3.0",
|
||||
"execa": "7.2.0",
|
||||
"globals": "15.9.0",
|
||||
"jest": "30.0.0-alpha.6",
|
||||
"jest-light-runner": "0.6.0",
|
||||
"jest-snapshot-serializer-ansi": "2.1.0",
|
||||
|
||||
@@ -1125,13 +1125,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint/compat@npm:1.1.1":
|
||||
version: 1.1.1
|
||||
resolution: "@eslint/compat@npm:1.1.1"
|
||||
checksum: 10/9004697701e9e9a7749d9e37452ee965af3620af46796ac0ee196478bbda490c780d17686c2888353c2a12d764837fa71c027c3ca18b1c3af6136105caa93642
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint/config-array@npm:^0.18.0":
|
||||
version: 0.18.0
|
||||
resolution: "@eslint/config-array@npm:0.18.0"
|
||||
@@ -1143,7 +1136,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint/eslintrc@npm:3.1.0, @eslint/eslintrc@npm:^3.1.0":
|
||||
"@eslint/eslintrc@npm:^3.1.0":
|
||||
version: 3.1.0
|
||||
resolution: "@eslint/eslintrc@npm:3.1.0"
|
||||
dependencies:
|
||||
@@ -4617,6 +4610,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"globals@npm:15.9.0, globals@npm:^15.7.0, globals@npm:^15.8.0":
|
||||
version: 15.9.0
|
||||
resolution: "globals@npm:15.9.0"
|
||||
checksum: 10/19bca70131c5d3e0d4171deed0f8ae16adda19f18d39b67421056f1eaa160b4433c3ffc8eb69b8b19adebbbdad4834d8a0494c5fe1ae295f0f769a5c0331d794
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"globals@npm:^11.1.0":
|
||||
version: 11.12.0
|
||||
resolution: "globals@npm:11.12.0"
|
||||
@@ -4631,13 +4631,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"globals@npm:^15.7.0, globals@npm:^15.8.0":
|
||||
version: 15.8.0
|
||||
resolution: "globals@npm:15.8.0"
|
||||
checksum: 10/fbca69cc1084c28a5155fea06224f6f0fcd9a371d8b8057db9c1851adc4bf2aad8016dd0db4e161e0ad1da0953e4286b90c826ff9ef5dbfb864493f2bba806df
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"globalthis@npm:^1.0.3":
|
||||
version: 1.0.4
|
||||
resolution: "globalthis@npm:1.0.4"
|
||||
@@ -7345,8 +7338,6 @@ __metadata:
|
||||
"@babel/generator": "npm:7.25.6"
|
||||
"@babel/parser": "npm:7.25.6"
|
||||
"@babel/types": "npm:7.25.6"
|
||||
"@eslint/compat": "npm:1.1.1"
|
||||
"@eslint/eslintrc": "npm:3.1.0"
|
||||
"@eslint/js": "npm:9.10.0"
|
||||
"@glimmer/syntax": "npm:0.92.3"
|
||||
"@prettier/is-es5-identifier-name": "npm:0.2.0"
|
||||
@@ -7404,6 +7395,7 @@ __metadata:
|
||||
flow-parser: "npm:0.245.2"
|
||||
get-east-asian-width: "npm:1.2.0"
|
||||
get-stdin: "npm:9.0.0"
|
||||
globals: "npm:15.9.0"
|
||||
graphql: "npm:16.9.0"
|
||||
hermes-parser: "npm:0.23.1"
|
||||
html-element-attributes: "npm:3.4.0"
|
||||
|
||||
Reference in new issue
Block a user