eslint.config.js45 lines, 1.4 KB
| 1 | import tseslint from "@typescript-eslint/eslint-plugin"; |
| 2 | import tsParser from "@typescript-eslint/parser"; |
| 3 | |
| 4 | export default [ |
| 5 | { |
| 6 | // Define the base configuration |
| 7 | ignores: ["node_modules/**", "dist/**", "**/*.js"], |
| 8 | languageOptions: { |
| 9 | parser: tsParser, |
| 10 | ecmaVersion: 2022, |
| 11 | sourceType: "module", |
| 12 | }, |
| 13 | plugins: { |
| 14 | "@typescript-eslint": tseslint, |
| 15 | }, |
| 16 | files: ["**/*.ts"], |
| 17 | rules: { |
| 18 | // Basic ESLint rules |
| 19 | "no-console": "warn", |
| 20 | "no-unused-vars": "off", // TypeScript has its own unused vars rule |
| 21 | "@typescript-eslint/no-unused-vars": [ |
| 22 | "error", |
| 23 | { argsIgnorePattern: "^_" }, |
| 24 | ], |
| 25 | "no-constant-condition": "warn", |
| 26 | "no-empty": "warn", |
| 27 | "no-extra-semi": "error", |
| 28 | "no-undef": "off", // TypeScript already handles this |
| 29 | |
| 30 | // TypeScript specific rules |
| 31 | "@typescript-eslint/explicit-function-return-type": "off", // Too strict |
| 32 | "@typescript-eslint/explicit-module-boundary-types": "off", // Too strict |
| 33 | "@typescript-eslint/no-explicit-any": "warn", |
| 34 | "@typescript-eslint/no-non-null-assertion": "warn", |
| 35 | |
| 36 | // Stylistic rules |
| 37 | semi: "off", |
| 38 | "@typescript-eslint/semi": ["error", "always"], |
| 39 | quotes: "off", |
| 40 | "@typescript-eslint/quotes": ["error", "double"], |
| 41 | "comma-dangle": "off", |
| 42 | "@typescript-eslint/comma-dangle": ["error", "always-multiline"], |
| 43 | }, |
| 44 | }, |
| 45 | ]; |