-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
208 lines (208 loc) · 5.75 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"env": {
"browser": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:prettier/recommended",
"prettier",
"airbnb",
"airbnb-base",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:import/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "tsconfig.json",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"react-refresh",
"react-hooks",
"@typescript-eslint",
"eslint-plugin-react",
"prettier"
],
"rules": {
"react-refresh/only-export-components": "warn",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/unbound-method": "warn",
"no-console": ["warn", { "allow": ["warn", "error"] }],
"react/display-name": "warn",
"react/no-children-prop": "off",
"react/no-find-dom-node": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"react/jsx-filename-extension": ["warn", { "extensions": [".tsx"] }],
"import/extensions": [
"error",
"ignorePackages",
{ "ts": "never", "tsx": "never" }
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowExpressions": true }
],
"@typescript-eslint/no-non-null-assertion": ["error"],
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-empty-interface": ["error"],
"@typescript-eslint/no-inferrable-types": ["error"],
"@typescript-eslint/no-unused-expressions": ["error"],
"max-len": ["warn", { "code": 80 }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": "off",
"import/prefer-default-export": "off",
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function", "unnamedComponents": "arrow-function" }
]
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-undef": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{"varsIgnorePattern": "^_", "argsIgnorePattern": "^_"}
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"import/no-extraneous-dependencies": "off",
"import/order": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off"
}
},
{
"files": ["*.test.tsx", "*.spec.tsx"],
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
],
"ignorePatterns": ["dist/", "build/"],
"globals": {
"React": true,
"JSX": true
},
"settings": {
"import/resolver": {
"typescript": {},
"babel-module": {"extensions": [".js", ".ts", ".tsx"]}
}
},
"import/no-unresolved": "off",
"class-methods-use-this": "off",
"comma-dangle": "off",
"import/prefer-default-export": "off",
"no-console": "warn",
"no-spaced-func": "off",
"max-params": ["error", 3],
"react/require-default-props": "off",
"react/no-inline-styles": "off",
"react/no-unused-prop-types": "warn",
"react/no-unstable-nested-components": "off",
"no-use-before-define": "error",
"@typescript-eslint/no-use-before-define": ["error"],
"react/jsx-filename-extension": [
"warn",
{
"extensions": [".tsx"]
}
],
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"json": "always"
}
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"max-len": [
"warn",
{
"code": 110
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/order": [
"error",
{
"newlines-between": "always",
"groups": ["builtin", "external", "index", "parent", "sibling"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"react/prop-types": "off",
"no-var": "error",
"semi": ["error", "always"],
"no-multi-spaces": "error",
"space-in-parens": "error",
"no-multiple-empty-lines": "error",
"prefer-const": "error",
"prettier/prettier": [
"error",
{
"trailingComma": "all",
"printWidth": 110,
"bracketSpacing": false,
"singleQuote": true,
"endOfLine": "auto",
"arrowParens": "always"
}
],
"react/react-in-jsx-scope": "off",
"camelcase": "error",
"spaced-comment": "error",
"quotes": ["error", "single"],
"no-duplicate-imports": "error",
"@typescript-eslint/no-explicit-any": "off",
"indent": ["error", 2],
"no-ternary": "off"
}