|
| 1 | +import eslint from "@eslint/js" |
| 2 | +import prettier from "eslint-config-prettier" |
| 3 | +import tseslint from "typescript-eslint" |
| 4 | + |
| 5 | +export default tseslint.config( |
| 6 | + { |
| 7 | + languageOptions: { |
| 8 | + parserOptions: { project: "./tsconfig.eslint.json" }, |
| 9 | + }, |
| 10 | + }, |
| 11 | + |
| 12 | + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access |
| 13 | + eslint.configs.recommended, |
| 14 | + ...tseslint.configs.strictTypeChecked, |
| 15 | + ...tseslint.configs.stylisticTypeChecked, |
| 16 | + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument |
| 17 | + prettier, |
| 18 | + |
| 19 | + { |
| 20 | + rules: { |
| 21 | + "@typescript-eslint/class-methods-use-this": [ |
| 22 | + "error", |
| 23 | + { |
| 24 | + ignoreClassesThatImplementAnInterface: true, |
| 25 | + ignoreOverrideMethods: true, |
| 26 | + }, |
| 27 | + ], |
| 28 | + "@typescript-eslint/consistent-type-exports": "error", |
| 29 | + "@typescript-eslint/consistent-type-imports": [ |
| 30 | + "error", |
| 31 | + { fixStyle: "separate-type-imports" }, |
| 32 | + ], |
| 33 | + "@typescript-eslint/default-param-last": "error", |
| 34 | + "@typescript-eslint/explicit-member-accessibility": [ |
| 35 | + "error", |
| 36 | + { accessibility: "no-public" }, |
| 37 | + ], |
| 38 | + "@typescript-eslint/method-signature-style": "error", |
| 39 | + "@typescript-eslint/no-import-type-side-effects": "error", |
| 40 | + "@typescript-eslint/no-unnecessary-qualifier": "error", |
| 41 | + "@typescript-eslint/no-useless-empty-export": "error", |
| 42 | + "@typescript-eslint/prefer-nullish-coalescing": [ |
| 43 | + "error", |
| 44 | + { ignorePrimitives: true }, |
| 45 | + ], |
| 46 | + "@typescript-eslint/prefer-readonly": "error", |
| 47 | + "@typescript-eslint/prefer-regexp-exec": "error", |
| 48 | + "@typescript-eslint/promise-function-async": [ |
| 49 | + "error", |
| 50 | + { checkArrowFunctions: false }, |
| 51 | + ], |
| 52 | + "@typescript-eslint/require-array-sort-compare": "error", |
| 53 | + "@typescript-eslint/return-await": "error", |
| 54 | + "@typescript-eslint/sort-type-constituents": "error", |
| 55 | + "@typescript-eslint/switch-exhaustiveness-check": "error", |
| 56 | + "func-style": ["error", "declaration"], |
| 57 | + }, |
| 58 | + }, |
| 59 | + { |
| 60 | + ignores: [ |
| 61 | + ".pnpm-store/", |
| 62 | + "dist/", |
| 63 | + "docs/", |
| 64 | + "node_modules/", |
| 65 | + "package-lock.json", |
| 66 | + "pnpm-lock.yaml", |
| 67 | + ], |
| 68 | + }, |
| 69 | +) |
0 commit comments