-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
100 lines (100 loc) · 2.31 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
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "airbnb", "prettier"],
"settings": {
"react": {
"version": "detect"
}
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"prettier" //always keep prettier at last so it can override anything coming before it
],
"rules": {
"react/react-in-jsx-scope": "off",
"import/prefer-default-export": "warn",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-props-no-spreading": ["warn"],
"spaced-comment": [2, "always"],
"react/function-component-definition": [
"error",
{
"namedComponents": ["function-declaration", "arrow-function"],
"unnamedComponents": "arrow-function"
}
],
"no-undef": 0,
"react/destructuring-assignment": "off",
"no-unsafe-optional-chaining": "warn",
"no-undefined": 0,
"comma-dangle": [2, "never"],
"quotes": [1, "single"],
"semi": "off",
"semi-style": ["error", "last"],
"guard-for-in": 2,
"no-eval": 2,
"no-with": 2,
"valid-typeof": 2,
"no-continue": 1,
"no-extra-semi": 1,
"no-unreachable": 1,
"no-unused-expressions": 1,
"no-magic-numbers": 0,
"react/prop-types": 0,
"max-len": [1, 250, 4],
"react/prefer-es6-class": 1,
"import/no-cycle": "off",
"no-plusplus": "off",
"arrow-body-style": ["off", "as-needed"],
"prefer-destructuring": "off",
"jsx-a11y/no-autofocus": "off",
"dot-notation": "off",
"no-useless-escape": "off",
"no-param-reassign": "off",
"no-unused-vars": 2,
"no-underscore-dangle": "off",
"no-nested-ternary": "off",
"no-lonely-if": "off",
"no-return-await": "off",
"react/no-did-update-set-state": "off",
// first argument: 0 - silent, 1 - warning, 2 - error
"strict": [2, "safe"],
"no-debugger": 2,
"brace-style": [
2,
"1tbs",
{
"allowSingleLine": true
}
],
"no-trailing-spaces": 2,
"keyword-spacing": 2,
"react/forbid-prop-types": "off",
"import/no-unused-modules": [
1,
{
"unusedExports": true
}
],
"import/no-extraneous-dependencies": "off",
"import/newline-after-import": ["error", { "count": 1 }],
"import/no-unresolved": "off",
"no-else-return": [
2,
{
"allowElseIf": true
}
]
}
}