-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
75 lines (73 loc) · 2.09 KB
/
eslint.config.js
File metadata and controls
75 lines (73 loc) · 2.09 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-config-prettier';
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
prettier,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// TypeScript rules - matching your main codebase
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variableLike',
format: ['camelCase', 'UPPER_CASE'],
filter: {
regex: '^_$',
match: false,
},
},
{
selector: 'variableLike',
format: null,
filter: {
regex: '^_$',
match: true,
},
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
// General code quality - matching your standards
'prefer-const': 'error',
'no-var': 'error',
'no-console': 'warn',
'eqeqeq': 'error',
'complexity': ['warn', 10],
'max-lines-per-function': ['warn', 70],
'max-params': ['warn', 4],
'no-case-declarations': 'off',
},
files: ['src/**/*.{js,ts}'],
},
{
ignores: ['node_modules', 'dist', 'build', 'tests', 'examples'],
}
);