-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc
109 lines (109 loc) · 3.03 KB
/
.eslintrc
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
109
{
"extends": [
"airbnb",
"prettier",
"airbnb/hooks",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"env": {
"browser": true
},
"plugins": ["prettier", "@typescript-eslint", "react-hooks"],
"root": true,
"settings": {
"import/resolver": {
"node": {
"alias": {
"map": [
["@", "./src"],
["@public", "./public"]
]
},
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".ts", ".tsx"]
}
],
"import/prefer-default-export": "off",
"react/no-find-dom-node": 0,
"class-methods-use-this": "off",
"@typescript-eslint/class-methods-use-this": [
1, // Warning
{
"ignoreOverrideMethods": true
}
],
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["to", "hrefLeft", "hrefRight"],
"aspects": ["noHref", "invalidHref", "preferButton"]
}
],
"import/extensions": "off",
"no-plusplus": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-explicit-any": "error",
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"react/jsx-props-no-spreading": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"no-restricted-imports": [
"error",
{
"patterns": ["@material-ui/*/*/*", "!@material-ui/core/test-utils/*"]
}
],
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"no-restricted-syntax": [
1, // Warning
{
"selector": ":matches(PropertyDefinition, MethodDefinition)[accessibility='private']",
"message": "Use # prefix for private instead"
}
],
"require-await": 1, // Warning
"@typescript-eslint/await-thenable": "warn"
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
"rules": {
"@typescript-eslint/no-floating-promises": 1, // Warning
"@typescript-eslint/no-misused-promises": 1, // Warning
"@typescript-eslint/explicit-function-return-type": [
1,
{
"allowExpressions": true
}
]
}
}
]
}