|
1 |
| -import type { FlatConfig } from "@typescript-eslint/utils/ts-eslint"; |
2 |
| - |
3 | 1 | import eslint from "@eslint/js";
|
4 | 2 | import eslintPluginImportX from "eslint-plugin-import-x";
|
5 | 3 | import perfectionist from "eslint-plugin-perfectionist";
|
6 | 4 | import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
7 |
| -import { configs as sonarjs } from "eslint-plugin-sonarjs"; |
8 | 5 | import tseslint, { configs } from "typescript-eslint";
|
9 | 6 |
|
10 |
| -/* -------------------------------------------------------------------------- */ |
11 |
| - |
12 |
| -const allowDefaultProject = ["eslint.config.ts"], |
13 |
| - ignores = ["**/index.js", "**/index.d.ts"], |
14 |
| - projectService = { allowDefaultProject }, |
15 |
| - tsconfigRootDir = import.meta.dirname, |
16 |
| - parserOptions = { projectService, tsconfigRootDir }, |
17 |
| - languageOptions = { parserOptions }, |
18 |
| - rules: FlatConfig.Rules = { |
19 |
| - "@typescript-eslint/no-use-before-define": ["error", "nofunc"], |
20 |
| - "import-x/no-extraneous-dependencies": [ |
21 |
| - "error", |
22 |
| - { |
23 |
| - devDependencies: ["**/eslint.config.ts"], |
24 |
| - optionalDependencies: false, |
25 |
| - }, |
26 |
| - ], |
27 |
| - }; |
28 |
| - |
29 |
| -/* -------------------------------------------------------------------------- */ |
30 |
| - |
31 | 7 | export default tseslint.config(
|
32 |
| - { ignores }, |
33 |
| - { rules }, |
34 |
| - { languageOptions }, |
| 8 | + { ignores: ["**/index.js", "**/index.d.ts"] }, |
| 9 | + { |
| 10 | + rules: { |
| 11 | + "@typescript-eslint/no-use-before-define": ["error", "nofunc"], |
| 12 | + "import-x/no-extraneous-dependencies": [ |
| 13 | + "error", |
| 14 | + { |
| 15 | + devDependencies: ["**/eslint.config.ts"], |
| 16 | + optionalDependencies: false, |
| 17 | + }, |
| 18 | + ], |
| 19 | + }, |
| 20 | + }, |
| 21 | + { |
| 22 | + languageOptions: { |
| 23 | + parserOptions: { |
| 24 | + projectService: { allowDefaultProject: ["eslint.config.ts"] }, |
| 25 | + tsconfigRootDir: import.meta.dirname, |
| 26 | + }, |
| 27 | + }, |
| 28 | + }, |
35 | 29 | eslint.configs.recommended,
|
36 | 30 | eslintPluginImportX.flatConfigs.recommended,
|
37 | 31 | eslintPluginImportX.flatConfigs.typescript,
|
38 | 32 | configs.strictTypeChecked,
|
39 | 33 | configs.stylisticTypeChecked,
|
40 |
| - sonarjs.recommended, |
41 | 34 | perfectionist.configs["recommended-natural"],
|
42 | 35 | eslintPluginPrettierRecommended,
|
43 | 36 | );
|
0 commit comments