-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
212 lines (207 loc) · 9.52 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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true
},
"ecmaFeatures": {
"modules": true,
"classes": true,
"jsx": true
},
"plugins": [
"react"
],
"rules": { // http://eslint.org/docs/rules/
// Possible errors
"no-cond-assign": [2, "always"], // Disallow assignment in conditional expressions
"no-console": 0, // Allow use of console
"no-constant-condition": 1, // Disallow use of constant expressions in conditions
"no-control-regex": 2, // Disallow Controls Characters in Regular Expressions
"no-debugger": 1, // Disallow use of debugger
"no-dupe-keys": 2, // Disallow duplicate keys
"no-duplicate-case": 2, // Disallow a duplicate case label
"no-empty-character-class": 2, // Disallow empty character classes in regular expressions
"no-empty": 1, // Disallow empty statements
"no-ex-assign": 1, // Disallow assigning to the exception in a catch block
"no-extra-boolean-cast": 2, // Disallow double-negation boolean casts in a boolean context
"no-extra-semi": 2, // Disallow unnecessary semicolons
"no-func-assign": 2, // Disallow overwriting functions written as function declarations
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2, // Disallow invalid regular expression strings in the RegExp constructor
"no-irregular-whitespace": 2, // Disallow irregular whitespace outside of strings and comments
"no-negated-in-lhs": 2, // Disallow negation of the left operand of an in expression
"no-regex-spaces": 2, // Disallow multiple spaces in a regular expression literal
"no-sparse-arrays": 2, // Disallow sparse arrays
"no-unreachable": 1, // Disallow unreachable statements after a return, throw, continue, or break statement
"use-isnan": 2, // Disallow comparisons with the value NaN
"valid-jsdoc": [1, { // Ensure JSDoc comments are valid
"requireReturnDescription": false
}],
"valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
"no-unexpected-multiline": 1, // Avoid code that looks like two expressions but is actually one
// Best practices
"block-scoped-var": 1, // Treat var statements as if they were block scoped
"consistent-return": 1, // Require return statements to either always or never specify values
"curly": [2, "all"], // Require curly braces for all control statements
"dot-notation": 1, // encourages use of dot notation whenever possible
"eqeqeq": [2, "allow-null"], // Require the use of === and !==
"no-alert": 1, // Disallow the use of alert, confirm, and prompt
"no-eval": 2, // Disallow use of eval()
"no-extend-native": 2, // Disallow adding to native types
"no-extra-bind": 2, // Disallow unnecessary function binding
"no-fallthrough": 0, // Disallow fallthrough of case statements
"no-implicit-coercion": [2, { // Disallow the type conversion with shorter notations for numbers and strings
"boolean": false,
"number": true,
"string": true
}],
"no-implied-eval": 2, // Disallow use of eval()-like methods
"no-labels": 2, // Disallow use of labeled statements
"no-loop-func": 2, // Disallow creation of functions within loops
"no-multi-spaces": [1, {"exceptions": { // Disallow use of multiple spaces
"Property": false
}}],
"no-multi-str": 2, // Disallow use of multiline strings
"no-native-reassign": 2, // Disallow reassignments of native objects
"no-new-func": 2, // Disallow use of new operator for Function object
"no-new-wrappers": 1, // Disallows creating new instances of String,Number, and Boolean
"no-new": 0, // Allow use of new operator when not part of the assignment or comparison
"no-octal": 2, // Disallow use of octal literals
"no-redeclare": 2, // Disallow declaring the same variable more than once
"no-return-assign": 2, // Disallow use of assignment in return statement
"no-self-compare": 2, // Disallow comparisons where both sides are exactly the same
"no-sequences": 1, // Disallow use of comma operator
"no-throw-literal": 2, // Restrict what can be thrown as an exception
"no-unused-expressions": 1, // Disallow usage of expressions in statement position
"no-void": 2, // Disallow use of void operator (off by default)
"no-with": 2, // Disallow use of the with statement
"prefer-spread": 2, // Suggest using the spread operator instead of .apply()
"radix": 2, // Require use of the second argument for parseInt()
"wrap-iife": [1, "outside"], // Require immediate function invocation to be wrapped in parentheses
"yoda": [2, "never", { // Disallow Yoda conditions
"exceptRange": true
}],
// Variables
"no-delete-var": 2, // Disallow deletion of variables
"no-shadow-restricted-names": 2, // Disallow shadowing of names such as arguments
"no-shadow": [1, {"hoist": "functions"}], // Disallow declaration of variables already declared in the outer scope
"no-undef": 2, // Disallow use of undeclared variables unless mentioned in a /*global */ block
"no-unused-vars": 1, // Disallow declaration of variables that are not used in the code
// Stylistic issues
"array-bracket-spacing": [1, "never"], // Disallow spaces inside of brackets
"brace-style": [1, "stroustrup", { // Stroustrup brace style (else on a separate line)
"allowSingleLine": false
}],
"camelcase": [1, { // Require camel case names except properties
"properties": "never"
}],
"comma-spacing": [1, { // No space before comma, space after coma
"before": false,
"after": true
}],
"comma-style": [1, "last"], // Do not start line with comma
"computed-property-spacing": [1, "never"], // Disallow padding inside computed properties
"eol-last": 0, // Do not require file to end with single newline
"indent": [1, "tab", { // Tabs indentation
"SwitchCase": 1
}],
"key-spacing": [2, { // No space before colon, space after colon
"beforeColon": false,
"afterColon": true
}],
"lines-around-comment": 0, // Do not require new line before comments
"linebreak-style": [2, "unix"], // Unix linebreaks
"max-nested-callbacks": [1, 3], // No more than 3 levels of nested callbacks
"new-cap": 0, // Do not require capital letter for constructors
"new-parens": 2, // Disallow the omission of parentheses when invoking a constructor with no arguments
"no-lonely-if": 1, // Disallow if as the only statement in an else block
"no-mixed-spaces-and-tabs": 1, // Disallow mixed spaces and tabs for indentation
"no-multiple-empty-lines": [1, { // No more than 2 empty lines
"max": 2
}],
"no-nested-ternary": 1, // Disallow nested ternary expressions
"no-new-object": 1, // Disallow use of the Object constructor
"no-spaced-func": 1, // Disallow space between function identifier and application
"no-trailing-spaces": 1, // Disallow trailing whitespace at the end of lines
"no-underscore-dangle": 0, // Allow dangling underscores in identifiers
"no-unneeded-ternary": 1, // Disallow the use of Boolean literals in conditional expressions
"no-useless-concat": 1, // Disallow unncessary concatenation of strings
"operator-assignment": [1, "always"], // Require assignment operator shorthand where possible
"operator-linebreak": [1, "after"], // Operators should be placed before line breaks
"quote-props": 0, // Do not require quotes around object literal property names
"quotes": [1, "single", "avoid-escape"], // Single quotes
"semi-spacing": [1, { // No space before semicolon, space after semicolon
"before": false,
"after": true
}],
"semi": [2, "always"], // Require use of semicolons
"space-after-keywords": [1, "always"], // Require space after keywords (if, else, etc.)
"space-before-blocks": [1, "always"], // Require space after blocks
"space-before-function-paren": [1, { // Disallow space before function opening parenthesis
"anonymous": "never",
"named": "never"
}],
"space-in-parens": [1, "never"], // Disallow spaces inside parentheses
"space-infix-ops": 1, // Require spaces around operators
"space-return-throw-case": 1, // Require space after return, throw, and case
"space-unary-ops": [1, { // Require spaces before/after unary operators
"words": true,
"nonwords": false
}],
"spaced-comment": [1, "always"], // Require space immediately following the // or /* in a comment
// ECMAScript 6
"arrow-spacing": [2, { // Require space before and after arrow function's arrow
"before": true,
"after": true
}],
"jsx-quotes": [1, "prefer-double"],
"no-var": 0, // Do not require let or const instead of var (becau
// React: https://github.com/yannickcr/eslint-plugin-react
"react/display-name": 0,
"react/jsx-boolean-value": [2, "never"],
"react/jsx-closing-bracket-location": [1, {
"location": "tag-aligned"
}],
"react/jsx-curly-spacing": [1, "never"],
"react/jsx-indent-props": [1, 4],
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-sort-prop-types": 0,
"react/jsx-sort-props": 0,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 0,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/no-unknown-property": 1,
"react/prop-types": [1, {
"ignore": [
"actions",
"dispatch",
"state"
]
}],
"react/require-extension": 0,
"react/self-closing-comp": 1,
// "react/sort-comp": [1, {
// "order": [
// "/^handle.+$/",
// "lifecycle",
// "everything-else",
// "/^render.+$/",
// "render"
// ],
// }],
"react/wrap-multilines": 1
},
"globals": {
"describe": false,
"it": false,
"expect": false,
"expectReactShallow": false
}
}