eslint
This commit is contained in:
parent
d85cd58acd
commit
597c6efc9b
91 changed files with 2224 additions and 1400 deletions
77
eslint.config.js
Normal file
77
eslint.config.js
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import js from '@eslint/js';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import tsparser from '@typescript-eslint/parser';
|
||||
|
||||
export default [
|
||||
// Global ignores first
|
||||
{
|
||||
ignores: [
|
||||
'dist/**',
|
||||
'build/**',
|
||||
'node_modules/**',
|
||||
'**/*.js',
|
||||
'**/*.mjs',
|
||||
'**/*.d.ts',
|
||||
'.turbo/**',
|
||||
'coverage/**',
|
||||
'scripts/**',
|
||||
'monitoring/**',
|
||||
'database/**',
|
||||
'**/.angular/**',
|
||||
'**/src/polyfills.ts',
|
||||
],
|
||||
},
|
||||
|
||||
// Base JavaScript configuration
|
||||
js.configs.recommended,
|
||||
|
||||
// TypeScript configuration
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
languageOptions: {
|
||||
parser: tsparser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': tseslint,
|
||||
},
|
||||
rules: {
|
||||
// Disable base rules that are covered by TypeScript equivalents
|
||||
'no-unused-vars': 'off',
|
||||
'no-undef': 'off',
|
||||
|
||||
// TypeScript specific rules
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
destructuredArrayIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'@typescript-eslint/no-non-null-assertion': 'warn',
|
||||
|
||||
// General rules
|
||||
'no-console': 'warn',
|
||||
'no-debugger': 'error',
|
||||
'no-var': 'error',
|
||||
'prefer-const': 'error',
|
||||
eqeqeq: ['error', 'always'],
|
||||
curly: ['error', 'all'],
|
||||
},
|
||||
},
|
||||
|
||||
// Test files configuration
|
||||
{
|
||||
files: ['**/*.test.ts', '**/*.spec.ts', '**/test/**/*', '**/tests/**/*'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue