-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
52 lines (51 loc) · 1.65 KB
/
Copy patheslint.config.js
File metadata and controls
52 lines (51 loc) · 1.65 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
// Unused vars: error in src, but allow _-prefixed ignores
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
// Warn on explicit any rather than error — codebase uses it intentionally
'@typescript-eslint/no-explicit-any': 'warn',
// Allow non-null assertions
'@typescript-eslint/no-non-null-assertion': 'off',
// Allow require imports (CommonJS interop)
'@typescript-eslint/no-require-imports': 'off',
// Turn off noisy builtins that produce false positives in this codebase
'preserve-caught-error': 'off',
'no-useless-assignment': 'off',
'no-control-regex': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
{
files: ['scripts/**/*.{js,mjs,ts}', 'packages/*/scripts/**/*.{js,mjs,ts}', '*.config.js', '*.config.ts'],
languageOptions: {
globals: {
Buffer: 'readonly',
clearTimeout: 'readonly',
console: 'readonly',
fetch: 'readonly',
process: 'readonly',
setTimeout: 'readonly',
},
},
},
{
// Test files: relax unused-vars to warn (many intentional unused imports)
files: ['src/tests/**/*.ts', 'packages/*/src/tests/**/*.ts', 'tools/tests/**/*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'no-empty': 'off',
},
},
{
ignores: ['dist/**', 'node_modules/**'],
}
);