Files
Dragan Spiridonov 94b026e2d6 chore(lint): auto-remove dead imports via eslint-plugin-unused-imports
Add eslint-plugin-unused-imports (devDependency) and switch unused-vars handling:
- unused-imports/no-unused-imports (error, autofixable) removes dead imports
- unused-imports/no-unused-vars (error, report-only) keeps dead locals visible
- @typescript-eslint/no-unused-vars disabled to avoid double-reporting

Ran the autofix across the tree: removed 478 unused imports in 251 files.
Lint problems: 1031 -> 553. No bare side-effect imports (`import 'x'`) were
removed. Verified: typecheck passes, build passes, 4507 unit/integration tests
pass. No behavioral change — purely dead-import removal.
2026-06-03 09:21:38 +00:00

53 lines
1.5 KiB
JavaScript

module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json'
},
plugins: ['@typescript-eslint', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
root: true,
env: {
node: true,
jest: true,
es6: true
},
ignorePatterns: [
'.eslintrc.cjs',
'dist',
'node_modules',
'tests',
'benchmarks',
'examples',
'security',
// Excluded from tsconfig too — linting it only yields parser errors.
'src/_archived',
'**/*.js',
'**/*.test.ts',
'**/*.spec.ts'
],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
// unused-imports auto-removes dead imports (autofixable); the TS rule is
// disabled to avoid double-reporting. Unused *variables* are still reported
// (no autofix) so dead locals remain visible without being mass-deleted.
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['error', {
'vars': 'all',
'varsIgnorePattern': '^_',
'args': 'after-used',
'argsIgnorePattern': '^_'
}],
'@typescript-eslint/no-inferrable-types': 'off',
'prefer-const': 'error',
'no-var': 'error'
},
};