-
-
Notifications
You must be signed in to change notification settings - Fork 116
/
.eslintrc.cjs
63 lines (51 loc) · 1.64 KB
/
.eslintrc.cjs
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
module.exports = {
"env": {
"amd": true,
"browser": true,
"mocha": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"globals": {
"Promise": "readonly",
"WebMidi": "readonly",
"chai": "readonly",
"sinon": "readonly",
"expect": "readonly",
"Note": "readonly",
"isNative": "readonly",
"config": "readonly"
},
"extends": [
"eslint:recommended",
"prettier",
"plugin:react/recommended"
],
// The idea here is to stick to the rules defined by Prettier (https://prettier.io/) and only make
// exceptions in ESLint when absolutely necessary.
"rules": {
// Rules to align ESLint with Prettier (even though we are already using eslint-config-prettier)
"indent": ["error", 2],
"semi": ["error", "always"],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "double", {"avoidEscape": true, "allowTemplateLiterals": true}],
// Rules that knowingly change the default Prettier behaviour
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"linebreak-style": ["error", "unix"], // Force \n instead of Prettier's auto-detect behaviour
"no-trailing-spaces": ["error", { "skipBlankLines": true, "ignoreComments": true }],
"max-len": ["error", { "code": 100, "comments": 150 }], // Prettier's 80 is too small. Period.
"no-console": ["error", { "allow": ["info", "warn", "error"] }], // Only some (unlike Prettier)
// Other rules
"no-prototype-builtins": "off",
"react/prop-types": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
};