This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc.js
97 lines (88 loc) · 3.09 KB
/
.eslintrc.js
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
module.exports = {
"parser": "babel-eslint",
"extends": [
"airbnb"
],
"plugins": [
"babel",
"react",
"promise"
],
"env": {
"browser": true,
"jest": true
},
"rules": {
"arrow-parens": [1, "always"],
"arrow-body-style": [1, "always"],
"key-spacing": 0,
"no-mixed-operators": 0,
"no-param-reassign": 0,
'prefer-destructuring': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-noninteractive-element-interactions': 0,
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/label-has-associated-control': 0,
// This rule transforms things like this
// {seatsRemaining} / {seatsCapacity}
// into this
// {seatsRemaining}
// /
// {seatsCapacity}
// which is less readable. If they allow it to keep short elements or inline elements on the same line, might re-enable in the future.
'react/jsx-one-expression-per-line': 0,
// Allow for-of loops.
"no-restricted-syntax": [
'error',
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
// This rule requires that all class methods use this.
// Disabling this allows making class methods that do not reference "this", which is helpful for private helper functions.
"class-methods-use-this": 0,
// The default ESLint rule here is to put propTypes below the class,
// eg, EmailInput.propTypes = {...}
// this rule change enforces that the are kept as static properties in the class.
"react/static-property-placement": ["error", "static public field", {
propTypes: "static public field",
}],
// The default for airbnb-eslint is to require the state to be above the constructor.
// This changes the rule to ensure the state is always initiated in the constructore
"react/state-in-constructor": [2, "always"],
// This config disallows if(true) but allows while(true)
"no-constant-condition": ["error", { "checkLoops": false }],
"no-cond-assign": ["error", "except-parens"],
"no-plusplus": [0, {
"allowForLoopAfterthoughts": true
}],
// Prevents using variables before they are defined.
"no-use-before-define": 1,
"jsx-quotes": [2, "prefer-single"],
"max-len": [2, 5000, 2],
"object-shorthand": ["error", "never"],
"object-curly-spacing": [2, "always"],
"react/forbid-prop-types": 0,
"react/no-danger": 1,
"no-continue": 0,
'react/destructuring-assignment': 0,
// This rule always triggers on Windows...
"import/no-unresolved": Number(process.env.OS !== 'Windows_NT') * 2,
"spaced-comment": 0,
"react/prefer-stateless-function": [1],
"react/jsx-filename-extension": [1, {
"extensions": [".js", ".jsx"]
}],
"react/jsx-curly-spacing": [2, "always", {
"spacing": {
"objectLiterals": "never"
}
}]
}
}