|
| 1 | +// Flat ESLint config (ESLint v9+). Replaces the old .eslintrc + `--ext` flow, |
| 2 | +// which ESLint v9 removed. TypeScript is linted via the typescript-eslint |
| 3 | +// plugin's `flat/recommended` preset, which bundles the parser, the plugin, and |
| 4 | +// a non-type-checked rule set (fast, low false-positive noise). |
| 5 | +import tseslint from '@typescript-eslint/eslint-plugin'; |
| 6 | +import tsparser from '@typescript-eslint/parser'; |
| 7 | + |
| 8 | +export default [ |
| 9 | + // Only application source is linted (mirrors the previous `eslint src` scope). |
| 10 | + { |
| 11 | + ignores: ['dist/**', 'node_modules/**', '*.config.*', 'coverage/**'], |
| 12 | + }, |
| 13 | + |
| 14 | + // typescript-eslint's flat/recommended turns off core rules that clash with |
| 15 | + // TS (e.g. no-undef), wires up the parser, and enables the recommended rules. |
| 16 | + ...tseslint.configs['flat/recommended'], |
| 17 | + |
| 18 | + { |
| 19 | + files: ['src/**/*.ts'], |
| 20 | + languageOptions: { |
| 21 | + parser: tsparser, |
| 22 | + ecmaVersion: 'latest', |
| 23 | + sourceType: 'module', |
| 24 | + }, |
| 25 | + rules: { |
| 26 | + // Pre-existing debt: this codebase predates any ESLint config (the v8→v10 |
| 27 | + // bump first introduced one), so `recommended` surfaces ~120 historical |
| 28 | + // violations of these two rules — none in newly-written code. Demote them |
| 29 | + // to warnings so lint is green and CI-usable today, while still surfacing |
| 30 | + // the backlog for incremental burndown. Promote back to "error" once the |
| 31 | + // existing hits are cleared. |
| 32 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 33 | + '@typescript-eslint/no-unused-vars': 'warn', |
| 34 | + }, |
| 35 | + }, |
| 36 | +]; |
0 commit comments