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