-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
125 lines (125 loc) · 2.93 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
"extends": [
"airbnb-base",
"react-app",
"react-app/jest",
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended"
],
"plugins": [
"react",
"import",
"jsx-a11y"
],
"env": {
"jest/globals": true
},
"rules": {
"import/no-unresolved": 0,
"import/extensions": 0,
"no-use-before-define": 0,
"max-len": 0,
"import/no-dynamic-require": 1,
"function-paren-newline": 0,
"no-param-reassign": 0,
"prefer-destructuring": 0,
"brace-style": [
"error",
"allman"
],
"no-underscore-dangle": 0,
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
// recommended by https://reactjs.org/docs/hooks-rules.html#eslint-plugin
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
// effectively covered by the ts compiler, messes with auto interface/type importing
"no-undef": "off",
// https://mui.com/guides/minimizing-bundle-size/
"no-restricted-imports": [
"error",
{
"patterns": [
"@mui/*/*/*",
"!@mui/material/test-utils/*"
]
}
],
"import/prefer-default-export": "off",
// note you must disable the base rule as it can report incorrect errors
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error"
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",
"indent": 2,
"space-before-function-paren": [
2,
{
"named": "never",
"anonymous": "always",
"asyncArrow": "always"
}
],
// react/jsx/tsx rules
"react/jsx-indent": [
2,
2,
{
"checkAttributes": true,
"indentLogicalExpressions": true
}
],
"react/jsx-indent-props": [
2,
2
],
"react/jsx-curly-spacing": [
"error",
{
"when": "never",
"children": true,
"attributes": true
}
],
"react/no-unused-state": 2,
"react/jsx-equals-spacing": [
2,
"never"
],
"react/jsx-no-constructed-context-values": 1,
"react/jsx-pascal-case": 1,
"react/jsx-space-before-closing": 2,
"react/jsx-wrap-multilines": [
2,
{
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "parens-new-line"
}
],
"react/jsx-tag-spacing": 2,
"react/self-closing-comp": 2,
"react/jsx-closing-tag-location": 2,
"react/jsx-closing-bracket-location": [
2,
{
"nonEmpty": "after-props",
"selfClosing": "line-aligned"
}
],
"react/hook-use-state": 2
}
}