forked from kodeklubben/codeclub-viewer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
54 lines (54 loc) · 1.67 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
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"mocha": true
},
"extends": ["eslint:recommended", "plugin:jsx-a11y/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react",
"react-hooks",
"jsx-a11y",
"babel"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"babel/semi": "error",
"eol-last": ["error"],
"indent": ["error", 2, {"SwitchCase": 1}],
"quotes": ["error", "single", {"avoidEscape": true, "allowTemplateLiterals": true}],
"semi": ["error", "always"],
"max-len": ["error", 120],
"no-console": ["off"], // we automatically strip console.log from production code, and we want to keep console.warn and console.error
"no-unused-vars": ["error", { "vars": "all", "args": "none" }], // only warn of unused args and vars
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/jsx-uses-vars": ["warn"], // avoid no-unused-vars for imports used as react components
"react/jsx-uses-react": ["warn"], // avoid no-unused-vars for importing React
"react/jsx-no-bind": ["error", {"allowArrowFunctions": true}], // See https://stackoverflow.com/a/53177820
"react/react-in-jsx-scope": ["warn"], // make sure React is in scope when writing jsx
"no-var": ["error"],
"jsx-a11y/label-has-for": [ "error", {
"components": [ "Label" ],
"required": {
"every": [ "nesting", "id" ]
},
"allowChildren": true
}
]
}
}