-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.json
98 lines (98 loc) · 2.78 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
{
"env": {
"browser": true,
"webextensions": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react-redux/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:perfectionist/recommended-natural",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
],
"overrides": [
{
"files": ["./postcss.config.js", "./webpack.config.js"],
"env": {
"browser": false,
"webextensions": false,
"node": true
}
},
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["./tsconfig.json"]
},
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "TSEnumDeclaration",
"message": "Don't declare enums, use union types instead"
}
],
"@typescript-eslint/array-type": [
"warn",
{
"default": "generic"
}
],
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "never"
}
],
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports" }],
"@typescript-eslint/method-signature-style": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowString": false,
"allowNumber": false,
"allowNullableObject": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false
}
],
"@typescript-eslint/switch-exhaustiveness-check": "error"
}
}
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react", "react-hooks", "react-redux", "perfectionist", "unused-imports"],
"root": true,
"rules": {
"import/no-cycle": "error",
"react/function-component-definition": [
"warn",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/jsx-props-no-spreading": "warn",
"react/no-access-state-in-setstate": "error",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react-redux/useSelector-prefer-selectors": "off",
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": "warn"
},
"settings": {
"react": {
"version": "detect"
}
}
}