forked from areai51/atomic-react
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.eslintrc.json
192 lines (174 loc) · 6.94 KB
/
.eslintrc.json
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
{
"extends": "react-app",
"rules": {
// require default case in switch statements
"default-case": 2,
// require the use of === and !==
"eqeqeq": 2,
// disallow unnecessary function binding
"no-extra-bind": 2,
// disallow use of multiple spaces
"no-multi-spaces": 2,
// disallow reassignment of function parameters
"no-param-reassign": 2,
// disallow usage of __proto__ property
"no-proto": 2,
// disallow declaring the same variable more then once
"no-redeclare": 2,
// require use of the second argument for parseInt()
"radix": 2,
// requires to declare all vars on top of their containing scope
"vars-on-top": 2,
// require immediate function invocation to be wrapped in parentheses
"wrap-iife": [2, "any"],
// require or disallow Yoda conditions
"yoda": 2,
// disallow duplicate arguments in functions
"no-dupe-args": 2,
// disallow duplicate keys when creating object literals
"no-dupe-keys": 2,
// disallow empty statements
"no-empty": 2,
// disallow invalid regular expression strings in the RegExp constructor
"no-invalid-regexp": 2,
// disallow irregular whitespace outside of strings and comments
"no-irregular-whitespace": 2,
// ensure that the results of typeof are compared against a valid string
"valid-typeof": 2,
// require space before/after arrow function's arrow
"arrow-spacing": 2,
// disallow modifying variables that are declared using const
"no-const-assign": 2,
// require let or const instead of var
"no-var": 2,
// suggest using of const declaration for variables that are never modified after declared
"prefer-const": 2,
// suggest using the spread operator instead of .apply()
"prefer-spread": 2,
// disallow use of undeclared variables unless mentioned in a /*global */ block
"no-undef": 2,
// disallow declaration of variables that are not used in the code
"no-unused-vars": [2, {
"vars": "local",
"args": "after-used"
}],
// Enforce boolean attributes notation in JSX
"react/jsx-boolean-value": 2,
// Ensure correct position of the first property
"react/jsx-first-prop-new-line": [2, "multiline"],
// Validates a specific indentation style for props
"react/jsx-indent-props": [2, 2],
// Checks all JSX elements and verifies the number of props per line
"react/jsx-max-props-per-line": [2, {
"maximum": 2
}],
// Disallow undeclared variables in JSX
"react/jsx-no-undef": 2,
// Prevent React to be incorrectly marked as unused
"react/jsx-uses-react": 2,
// Prevent variables used in JSX to be incorrectly marked as unused
"react/jsx-uses-vars": 2,
// Prevent usage of setState in componentDidMount
"react/no-did-mount-set-state": [2],
// Prevent usage of setState in componentDidUpdate
"react/no-did-update-set-state": 2,
// Prevent direct mutation of this.state
"react/no-direct-mutation-state": 2,
// Prevent multiple component definition per file
"react/no-multi-comp": [2, {
"ignoreStateless": true
}],
// Enforce ES6 classes for React Components
"react/prefer-es6-class": 2,
// Enforce stateless React Components to be written as a pure function
"react/prefer-stateless-function": 2,
// Prevent missing props validation in a React component definition
"react/prop-types": 2,
// Prevent missing React when using JSX
"react/react-in-jsx-scope": 2,
// Enforce component methods order
"react/sort-comp": [2, {
"order": [
"propTypes",
"defaultProps",
"contextTypes",
"state",
"displayName",
"getInitialState",
"constructor",
"static-methods",
"componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount",
"/^on.+$/",
"everything-else",
"/^render.+$/",
"render"
]
}],
// Prevent missing parentheses around multilines JSX
"react/jsx-wrap-multilines": 2,
/*STYLING*/
// enforce spacing inside array brackets
"array-bracket-spacing": [2, "never"],
// enforce one true brace style
"brace-style": [2, "1tbs", {"allowSingleLine": true }],
// require camel case names
"camelcase": [2, {"properties": "never"}],
// enforce spacing before and after comma
"comma-spacing": [2, {"before": false, "after": true}],
// enforce one true comma style
"comma-style": [2, "last"],
// disallow padding inside computed properties
"computed-property-spacing": [2, "never"],
// this option sets a specific tab width for your code
"indent": [2, 2, { "SwitchCase": 1 }],
// specify whether double or single quotes should be used in JSX attributes
"jsx-quotes": 2,
// enforces spacing between keys and values in object literal properties
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
// require a space before & after certain keywords
"keyword-spacing": 2,
// disallow mixed spaces and tabs for indentation
"no-mixed-spaces-and-tabs": 2,
// disallow multiple empty lines and only one newline at the end
"no-multiple-empty-lines": [2, {"max": 2}],
// disallow use of the Object constructor
"no-new-object": 2,
// disallow space between function identifier and application
"no-spaced-func": 2,
// disallow trailing whitespace at the end of lines
"no-trailing-spaces": 2,
// require padding inside curly braces
"object-curly-spacing": [2, "always"],
// allow just one var statement per function
"one-var": [2, "never"],
// enforce padding within blocks
"padded-blocks": [2, "never"],
// require quotes around object literal property names
"quote-props": ["error", "consistent-as-needed"],
// specify whether double or single quotes should be used
"quotes": [2, "single", "avoid-escape"],
// enforce spacing before and after semicolons
"semi-spacing": [2, {"before": false, "after": true}],
// require or disallow use of semicolons instead of ASI
"semi": [2, "always"],
// require or disallow space before blocks
"space-before-blocks": 2,
// require or disallow space before function opening parenthesis
"space-before-function-paren": [2, "never"],
// disallow spaces inside parentheses
"space-in-parens": [2, "never"],
// require spaces around operators
"space-infix-ops": 2,
// require or disallow a space immediately following the // or /* in a comment
"spaced-comment": [2, "always", {
"exceptions": ["-", "+"],
"markers": ["=", "!"] // space here to support sprockets directives
}]
}
}