import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
project: './tsconfig.json',
},
},
rules: {
// TypeScript-specific rules - lenient for initial adoption
// TODO: Tighten these to 'error' as code is cleaned up
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-require-imports': 'warn',
// General rules
'no-console': 'off', // CLI tool needs console
'prefer-const': 'warn', // Will fix over time
'no-var': 'error',
'no-prototype-builtins': 'warn', // Use Object.hasOwn() instead
'no-case-declarations': 'warn', // Switch case blocks with let/const
},
},
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'*.js',
'*.mjs',
'scripts/**',
],
}
);