Repository navigation
Expand file tree
/
Copy path.eslintrc.json
More file actions
104 lines (100 loc) · 3.83 KB
/
Copy path.eslintrc.json
File metadata and controls
104 lines (100 loc) · 3.83 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"react-hooks"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"rules": {
// TypeScript specific rules
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true, "allowTypedFunctionExpressions": true }],
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/ban-ts-comment": ["error", {
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description"
}],
// Code quality rules
"prefer-const": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-arrow-callback": "error",
"prefer-template": "error",
"template-curly-spacing": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
// Error prevention
"no-duplicate-imports": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }],
"no-debugger": "error",
"no-alert": "error",
"no-eval": "error",
"no-implied-eval": "error",
"no-new-func": "error",
"no-script-url": "error",
// Style consistency - let Prettier handle most formatting
"curly": ["error", "all"],
"max-len": ["warn", { "code": 120, "ignoreUrls": true, "ignoreStrings": true }],
// Existing rules (keeping for backward compatibility)
"eqeqeq": "error",
"no-throw-literal": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error"
},
"overrides": [
{
"files": ["*.test.ts", "*.test.tsx", "src/test/**/*"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
// Test file relaxations - disable strict type-checking rules
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "off"
}
},
{
"files": ["*.config.js", "*.config.ts", "webpack.config.js", "rspack.config.js"],
"rules": {
// Config file relaxations
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["src/utils/logger.ts"],
"rules": {
// Logger utility needs console statements
"no-console": "off"
}
}
],
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts",
"node_modules",
"src/test/**/*"
]
}