-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
73 lines (67 loc) · 2.4 KB
/
.eslintrc.json
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
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:import/recommended",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"rules": {
// Without 'modules' ignored would get 'Import and export declarations are
// not supported yet' error in all ts files
"node/no-unsupported-features/es-syntax": [
"error",
{ "ignores": ["modules"] }
],
// No React component definitions allowed inside components
"react/no-unstable-nested-components": "warn",
// Additional import rules
"import/no-dynamic-require": "error",
"import/no-absolute-path": "error",
"import/no-useless-path-segments": "warn",
"import/newline-after-import": "warn",
// Use warn instead of error for prettier issues and some other rules
"prettier/prettier": "warn",
"no-unused-vars": "warn",
"prefer-const": "warn",
"no-debugger": "warn",
"no-console": "off"
},
"overrides": [
{
"files": ["**/*.ts?(x)"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module",
"ecmaFeatures": { "jsx": true }
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript"
],
"rules": {
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
"no-dupe-class-members": "off",
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
"no-undef": "off",
// Handled by import/typescript
"node/no-missing-import": "off",
// Disable some rules which are difficult for beginners
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
// Use warn instead of error for some rules
"prefer-const": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/require-await": "warn"
}
}
]
}