|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +/* eslint-env node */ |
| 4 | + |
| 5 | +/** @satisfies {import("eslint").Linter.Config} */ |
| 6 | +const config = { |
| 7 | + root: true, |
| 8 | + extends: [ |
| 9 | + "eslint:recommended", |
| 10 | + "plugin:@typescript-eslint/recommended", |
| 11 | + "plugin:@typescript-eslint/recommended-requiring-type-checking", |
| 12 | + "plugin:import/recommended", |
| 13 | + "plugin:import/typescript", |
| 14 | + "plugin:prettier/recommended", |
| 15 | + "plugin:sonarjs/recommended", |
| 16 | + ], |
| 17 | + parser: "@typescript-eslint/parser", |
| 18 | + parserOptions: { |
| 19 | + ecmaVersion: "latest", |
| 20 | + sourceType: "module", |
| 21 | + project: ["./tsconfig.json", "./tsconfig.eslint.json"], |
| 22 | + tsconfigRootDir: __dirname, |
| 23 | + }, |
| 24 | + ignorePatterns: ["!.lintstagedrc.js"], |
| 25 | + plugins: ["sort-destructure-keys"], |
| 26 | + rules: { |
| 27 | + "@typescript-eslint/consistent-type-imports": [ |
| 28 | + "error", |
| 29 | + { prefer: "type-imports", disallowTypeAnnotations: false }, |
| 30 | + ], |
| 31 | + "@typescript-eslint/no-empty-object-type": "off", |
| 32 | + "@typescript-eslint/no-explicit-any": "off", |
| 33 | + "@typescript-eslint/no-namespace": "off", |
| 34 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 35 | + "@typescript-eslint/no-unsafe-argument": "off", |
| 36 | + "@typescript-eslint/no-unsafe-assignment": "off", |
| 37 | + "@typescript-eslint/no-unsafe-call": "off", |
| 38 | + "@typescript-eslint/no-unsafe-member-access": "off", |
| 39 | + "@typescript-eslint/no-unsafe-return": "off", |
| 40 | + "@typescript-eslint/no-unused-vars": "off", // Already covered by TypeScript |
| 41 | + "import/export": "off", |
| 42 | + "import/consistent-type-specifier-style": ["error", "prefer-top-level"], |
| 43 | + "import/namespace": "off", |
| 44 | + "import/no-unresolved": "off", |
| 45 | + "import/order": [ |
| 46 | + "error", |
| 47 | + { |
| 48 | + alphabetize: { order: "asc" }, |
| 49 | + groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"], |
| 50 | + "newlines-between": "always", |
| 51 | + }, |
| 52 | + ], |
| 53 | + "no-undef": "off", |
| 54 | + "sonarjs/cognitive-complexity": "off", |
| 55 | + "sonarjs/no-duplicate-string": "off", |
| 56 | + "sort-destructure-keys/sort-destructure-keys": "error", |
| 57 | + "sort-imports": [ |
| 58 | + "error", |
| 59 | + { |
| 60 | + ignoreCase: false, |
| 61 | + ignoreDeclarationSort: true, |
| 62 | + ignoreMemberSort: false, |
| 63 | + memberSyntaxSortOrder: ["none", "all", "multiple", "single"], |
| 64 | + }, |
| 65 | + ], |
| 66 | + }, |
| 67 | + reportUnusedDisableDirectives: true, |
| 68 | +}; |
| 69 | + |
| 70 | +module.exports = config; |
0 commit comments