.eslintrc.js•1.51 kB
export default {
root: true,
env: {
node: true,
es2022: true,
},
extends: [
'eslint:recommended',
'@typescript-eslint/recommended',
'@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
// Prettier integration
'prettier/prettier': 'error',
// TypeScript specific rules
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/prefer-const': 'error',
'@typescript-eslint/no-inferrable-types': 'off',
// General rules
'no-console': 'off', // Allow console for CLI tools
'no-process-exit': 'off', // Allow process.exit for CLI tools
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
// Import/Export rules
'no-duplicate-imports': 'error',
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
],
ignorePatterns: [
'node_modules/',
'dist/',
'generated/',
'*.config.js',
],
};