-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc
60 lines (60 loc) · 1.44 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
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"plugins": [
"react",
"react-hooks"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"semi": ["error", "never"],
"quotes": ["error", "single"],
"comma-dangle": ["error", "never"],
"arrow-parens": [2, "always"],
"implicit-arrow-linebreak": ["error", "beside"],
"arrow-body-style": ["warn", "as-needed"],
"function-call-argument-newline": ["error", "consistent"],
"object-curly-spacing": [2, "always"],
"key-spacing": ["error", {
"align": {
"beforeColon": true,
"afterColon": true,
"on": "colon"
}
}],
"react/jsx-closing-bracket-location": [1, "tag-aligned"],
// NextJs does not require you to import React into each component.
"react/react-in-jsx-scope": "off",
"react/jsx-curly-spacing": ["warn", {
"when": "always",
"children": true,
"spacing": {
// <MyComponent propA={{ a: 1 }} />
"objectLiterals": "never"
}
}],
"linebreak-style": ["error", "unix"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"globals": {
"React": "writable"
}
}