Skip to content

Commit 3cf7236

Browse files
committed
Migrate to eslint.config.mjs
`.eslintrc.json` is deprecated.
1 parent c2585ec commit 3cf7236

File tree

91 files changed

+22185
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+22185
-604
lines changed

.eslintrc.json

-71
This file was deleted.

eslint.config.mjs

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Automatically generated by running npx @eslint/migrate-config .eslintrc.json
2+
3+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
4+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
5+
import filenames from "eslint-plugin-filenames";
6+
import github from "eslint-plugin-github";
7+
import _import from "eslint-plugin-import";
8+
import noAsyncForeach from "eslint-plugin-no-async-foreach";
9+
import tsParser from "@typescript-eslint/parser";
10+
import path from "node:path";
11+
import { fileURLToPath } from "node:url";
12+
import js from "@eslint/js";
13+
import { FlatCompat } from "@eslint/eslintrc";
14+
15+
const __filename = fileURLToPath(import.meta.url);
16+
const __dirname = path.dirname(__filename);
17+
const compat = new FlatCompat({
18+
baseDirectory: __dirname,
19+
recommendedConfig: js.configs.recommended,
20+
allConfig: js.configs.all
21+
});
22+
23+
export default [{
24+
ignores: ["**/webpack.config.js", "lib/**/*", "src/testdata/**/*", "tests/**/*"],
25+
}, ...fixupConfigRules(compat.extends(
26+
"eslint:recommended",
27+
"plugin:@typescript-eslint/recommended",
28+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
29+
"plugin:github/recommended",
30+
"plugin:github/typescript",
31+
"plugin:import/typescript",
32+
)), {
33+
plugins: {
34+
"@typescript-eslint": fixupPluginRules(typescriptEslint),
35+
filenames,
36+
github: fixupPluginRules(github),
37+
import: fixupPluginRules(_import),
38+
"no-async-foreach": noAsyncForeach,
39+
},
40+
41+
languageOptions: {
42+
parser: tsParser,
43+
ecmaVersion: 5,
44+
sourceType: "script",
45+
46+
parserOptions: {
47+
project: "./tsconfig.json",
48+
},
49+
},
50+
51+
settings: {
52+
"import/resolver": {
53+
node: {
54+
moduleDirectory: ["node_modules", "src"],
55+
},
56+
57+
typescript: {},
58+
},
59+
},
60+
61+
rules: {
62+
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
63+
"i18n-text/no-en": "off",
64+
65+
"import/extensions": ["error", {
66+
json: {},
67+
}],
68+
69+
"import/no-amd": "error",
70+
"import/no-commonjs": "error",
71+
"import/no-cycle": "error",
72+
"import/no-dynamic-require": "error",
73+
74+
"import/no-extraneous-dependencies": ["error", {
75+
devDependencies: true,
76+
}],
77+
78+
"import/no-namespace": "off",
79+
"import/no-unresolved": "error",
80+
"import/no-webpack-loader-syntax": "error",
81+
82+
"import/order": ["error", {
83+
alphabetize: {
84+
order: "asc",
85+
},
86+
87+
"newlines-between": "always",
88+
}],
89+
90+
"max-len": ["error", {
91+
code: 120,
92+
ignoreUrls: true,
93+
ignoreStrings: true,
94+
ignoreTemplateLiterals: true,
95+
}],
96+
97+
"no-async-foreach/no-async-foreach": "error",
98+
"no-sequences": "error",
99+
"no-shadow": "off",
100+
"@typescript-eslint/no-shadow": "error",
101+
"one-var": ["error", "never"],
102+
},
103+
}, {
104+
files: ["**"],
105+
106+
rules: {
107+
"@typescript-eslint/no-explicit-any": "off",
108+
"@typescript-eslint/no-unsafe-assignment": "off",
109+
"@typescript-eslint/no-unsafe-member-access": "off",
110+
"@typescript-eslint/no-var-requires": "off",
111+
"@typescript-eslint/prefer-regexp-exec": "off",
112+
"@typescript-eslint/require-await": "off",
113+
"@typescript-eslint/restrict-template-expressions": "off",
114+
"func-style": "off",
115+
},
116+
}];

node_modules/.package-lock.json

+95-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)