-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
108 lines (95 loc) · 2.81 KB
/
Copy patheslint.config.js
File metadata and controls
108 lines (95 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import importX from 'eslint-plugin-import-x';
export default tseslint.config(
// Global ignores
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'tools/trace-dashboard/**',
'tools/eval/**',
'scripts/**',
'*.config.js',
'*.config.mjs',
],
},
// Base JS recommended rules
eslint.configs.recommended,
// TypeScript recommended (type-aware disabled for speed)
...tseslint.configs.recommended,
// Import ordering
{
plugins: {
'import-x': importX,
},
rules: {
'import-x/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'never',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'import-x/no-duplicates': 'warn',
},
},
// Project-specific rules
{
rules: {
// Console usage — warn to track migration to structured logger
'no-console': 'warn',
// TypeScript strictness — warn first, upgrade to error in Phase 6
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
// Allow empty functions (common in stubs/defaults)
'@typescript-eslint/no-empty-function': 'off',
// Allow non-null assertions (used heavily in existing code)
'@typescript-eslint/no-non-null-assertion': 'off',
// Allow require imports (used in some dynamic loading)
'@typescript-eslint/no-require-imports': 'off',
// Downgrade recommended errors to warnings for existing code debt (Phase 6 cleanup)
'no-case-declarations': 'warn',
'no-duplicate-case': 'warn',
'no-async-promise-executor': 'warn',
'no-useless-escape': 'warn',
'no-control-regex': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
// General quality
'no-constant-condition': ['warn', { checkLoops: false }],
'no-debugger': 'error',
'prefer-const': 'warn',
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'no-var': 'error',
},
},
// Test file overrides
{
files: ['tests/**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
// Prettier must be last to override formatting rules
eslintConfigPrettier,
);