This repository has been archived by the owner on Jun 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc
executable file
·74 lines (74 loc) · 2.4 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
// Extend the AirBnb lint config
"extends": "airbnb",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"globalReturn": true,
"impliedStrict": true,
"jsx": true
},
"sourceType": "module"
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"globals": {
"wp": true,
"lodash": true,
"React": true,
"ReactDOM": true
},
// Do NOT change these rules
"rules": {
"jsx-a11y/label-has-associated-control": [ "error", {
"required": {
"some": [ "nesting", "id" ]
}
}],
"jsx-a11y/label-has-for": [ "error", {
"required": {
"some": [ "nesting", "id" ]
}
}],
"indent": [2, 2, {"SwitchCase": 1}],
"max-len": [2, 80, 4, {
"ignoreComments": true,
"ignoreUrls": true
}],
"quotes": [2, "single"], // Allows template literals if they have substitutions or line breaks
"semi": [2, "always"],
"no-multiple-empty-lines": [2, {"max": 1}],
"comma-dangle": [2, "always-multiline"],
"dot-location": [2, "property"],
"one-var": [2, "never"],
"no-var": [2], // Stop using var, use const or let instead
"prefer-const": ["error"],
"no-bitwise": [2],
"id-length": ["error", {
"properties": "never",
"exceptions": ["x", "y", "i", "e", "n", "k"]
}],
"func-names": [1, "always"], // This aids in debugging
"no-use-before-define": [2, "nofunc"],
"yoda": [2, "always"],
"object-curly-spacing": [2, "always"],
"array-bracket-spacing": [2, "never"],
"space-unary-ops": [2, {"words": true, "nonwords": true}],
"keyword-spacing": ["error", {"after": true}],
"space-before-blocks": [2, "always"],
"space-in-parens": [2, "never"],
"spaced-comment": [2, "always"],
"no-confusing-arrow": ["error", {"allowParens": true}], // See eslint config for reasons
"no-constant-condition": ["error"],
"arrow-parens": ["error", "always"],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": [0], // Disabled since it doesn't work with webpack alias
"import/no-unresolved": [0], // Disabled since it doesn't work with webpack alias
"import/extensions": [0], // Disabled since it doesn't work with webpack alias
"react/prefer-stateless-function": [0] // Disabled because it doesn't properly recognize PureComponents
}
}