Skip to content

Commit 5de9d01

Browse files
author
soliury
committed
add .eslintrc
1 parent 874889d commit 5de9d01

1 file changed

Lines changed: 379 additions & 0 deletions

File tree

.eslintrc

Lines changed: 379 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,379 @@
1+
{
2+
"parser": "babel-eslint",
3+
"ecmaFeatures": {
4+
"jsx": true
5+
},
6+
"env": {
7+
"es6": true,
8+
"jasmine": true,
9+
},
10+
"plugins": [
11+
"react"
12+
],
13+
// Map from global var to bool specifying if it can be redefined
14+
"globals": {
15+
"__DEV__": true,
16+
"__dirname": false,
17+
"__fbBatchedBridgeConfig": false,
18+
"cancelAnimationFrame": false,
19+
"clearImmediate": true,
20+
"clearInterval": false,
21+
"clearTimeout": false,
22+
"console": false,
23+
"document": false,
24+
"escape": false,
25+
"exports": false,
26+
"fetch": false,
27+
"global": false,
28+
"jest": false,
29+
"Map": true,
30+
"module": false,
31+
"navigator": false,
32+
"process": false,
33+
"Promise": true,
34+
"requestAnimationFrame": true,
35+
"require": false,
36+
"Set": true,
37+
"setImmediate": true,
38+
"setInterval": false,
39+
"setTimeout": false,
40+
"window": false,
41+
"XMLHttpRequest": false,
42+
"pit": false
43+
},
44+
"rules": {
45+
"comma-dangle": 0,
46+
// disallow trailing commas in object literals
47+
"no-cond-assign": 1,
48+
// disallow assignment in conditional expressions
49+
"no-console": 0,
50+
// disallow use of console (off by default in the node environment)
51+
"no-constant-condition": 0,
52+
// disallow use of constant expressions in conditions
53+
"no-control-regex": 1,
54+
// disallow control characters in regular expressions
55+
"no-debugger": 1,
56+
// disallow use of debugger
57+
"no-dupe-keys": 1,
58+
// disallow duplicate keys when creating object literals
59+
"no-empty": 0,
60+
// disallow empty statements
61+
"no-empty-class": 1,
62+
// disallow the use of empty character classes in regular expressions
63+
"no-ex-assign": 1,
64+
// disallow assigning to the exception in a catch block
65+
"no-extra-boolean-cast": 1,
66+
// disallow double-negation boolean casts in a boolean context
67+
"no-extra-parens": 0,
68+
// disallow unnecessary parentheses (off by default)
69+
"no-extra-semi": 1,
70+
// disallow unnecessary semicolons
71+
"no-func-assign": 1,
72+
// disallow overwriting functions written as function declarations
73+
"no-inner-declarations": 0,
74+
// disallow function or variable declarations in nested blocks
75+
"no-invalid-regexp": 1,
76+
// disallow invalid regular expression strings in the RegExp constructor
77+
"no-negated-in-lhs": 1,
78+
// disallow negation of the left operand of an in expression
79+
"no-obj-calls": 1,
80+
// disallow the use of object properties of the global object (Math and JSON) as functions
81+
"no-regex-spaces": 1,
82+
// disallow multiple spaces in a regular expression literal
83+
"no-reserved-keys": 0,
84+
// disallow reserved words being used as object literal keys (off by default)
85+
"no-sparse-arrays": 1,
86+
// disallow sparse arrays
87+
"no-unreachable": 1,
88+
// disallow unreachable statements after a return, throw, continue, or break statement
89+
"use-isnan": 1,
90+
// disallow comparisons with the value NaN
91+
"valid-jsdoc": 0,
92+
// Ensure JSDoc comments are valid (off by default)
93+
"valid-typeof": 1,
94+
// Ensure that the results of typeof are compared against a valid string
95+
96+
// Best Practices
97+
// These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.
98+
99+
"block-scoped-var": 0,
100+
// treat var statements as if they were block scoped (off by default)
101+
"complexity": 0,
102+
// specify the maximum cyclomatic complexity allowed in a program (off by default)
103+
"consistent-return": 0,
104+
// require return statements to either always or never specify values
105+
"curly": 1,
106+
// specify curly brace conventions for all control statements
107+
"default-case": 0,
108+
// require default case in switch statements (off by default)
109+
"dot-notation": 1,
110+
// encourages use of dot notation whenever possible
111+
"eqeqeq": 1,
112+
// require the use of === and !==
113+
"guard-for-in": 0,
114+
// make sure for-in loops have an if statement (off by default)
115+
"no-alert": 1,
116+
// disallow the use of alert, confirm, and prompt
117+
"no-caller": 1,
118+
// disallow use of arguments.caller or arguments.callee
119+
"no-div-regex": 1,
120+
// disallow division operators explicitly at beginning of regular expression (off by default)
121+
"no-else-return": 0,
122+
// disallow else after a return in an if (off by default)
123+
"no-empty-label": 1,
124+
// disallow use of labels for anything other then loops and switches
125+
"no-eq-null": 0,
126+
// disallow comparisons to null without a type-checking operator (off by default)
127+
"no-eval": 1,
128+
// disallow use of eval()
129+
"no-extend-native": 1,
130+
// disallow adding to native types
131+
"no-extra-bind": 1,
132+
// disallow unnecessary function binding
133+
"no-fallthrough": 1,
134+
// disallow fallthrough of case statements
135+
"no-floating-decimal": 1,
136+
// disallow the use of leading or trailing decimal points in numeric literals (off by default)
137+
"no-implied-eval": 1,
138+
// disallow use of eval()-like methods
139+
"no-labels": 1,
140+
// disallow use of labeled statements
141+
"no-iterator": 1,
142+
// disallow usage of __iterator__ property
143+
"no-lone-blocks": 1,
144+
// disallow unnecessary nested blocks
145+
"no-loop-func": 0,
146+
// disallow creation of functions within loops
147+
"no-multi-str": 0,
148+
// disallow use of multiline strings
149+
"no-native-reassign": 0,
150+
// disallow reassignments of native objects
151+
"no-new": 1,
152+
// disallow use of new operator when not part of the assignment or comparison
153+
"no-new-func": 1,
154+
// disallow use of new operator for Function object
155+
"no-new-wrappers": 1,
156+
// disallows creating new instances of String,Number, and Boolean
157+
"no-octal": 1,
158+
// disallow use of octal literals
159+
"no-octal-escape": 1,
160+
// disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
161+
"no-proto": 1,
162+
// disallow usage of __proto__ property
163+
"no-redeclare": 0,
164+
// disallow declaring the same variable more then once
165+
"no-return-assign": 1,
166+
// disallow use of assignment in return statement
167+
"no-script-url": 1,
168+
// disallow use of javascript: urls.
169+
"no-self-compare": 1,
170+
// disallow comparisons where both sides are exactly the same (off by default)
171+
"no-sequences": 1,
172+
// disallow use of comma operator
173+
"no-unused-expressions": 0,
174+
// disallow usage of expressions in statement position
175+
"no-void": 1,
176+
// disallow use of void operator (off by default)
177+
"no-warning-comments": 0,
178+
// disallow usage of configurable warning terms in comments": 1, // e.g. TODO or FIXME (off by default)
179+
"no-with": 1,
180+
// disallow use of the with statement
181+
"radix": 1,
182+
// require use of the second argument for parseInt() (off by default)
183+
"semi-spacing": 1,
184+
// require a space after a semi-colon
185+
"vars-on-top": 0,
186+
// requires to declare all vars on top of their containing scope (off by default)
187+
"wrap-iife": 0,
188+
// require immediate function invocation to be wrapped in parentheses (off by default)
189+
"yoda": 1,
190+
// require or disallow Yoda conditions
191+
192+
// Strict Mode
193+
// These rules relate to using strict mode.
194+
195+
"global-strict": [
196+
2,
197+
"always"
198+
],
199+
// require or disallow the "use strict" pragma in the global scope (off by default in the node environment)
200+
"no-extra-strict": 1,
201+
// disallow unnecessary use of "use strict"; when already in strict mode
202+
"strict": 0,
203+
// require that all functions are run in strict mode
204+
205+
// Variables
206+
// These rules have to do with variable declarations.
207+
208+
"no-catch-shadow": 1,
209+
// disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
210+
"no-delete-var": 1,
211+
// disallow deletion of variables
212+
"no-label-var": 1,
213+
// disallow labels that share a name with a variable
214+
"no-shadow": 1,
215+
// disallow declaration of variables already declared in the outer scope
216+
"no-shadow-restricted-names": 1,
217+
// disallow shadowing of names such as arguments
218+
"no-undef": 2,
219+
// disallow use of undeclared variables unless mentioned in a /*global */ block
220+
"no-undefined": 0,
221+
// disallow use of undefined variable (off by default)
222+
"no-undef-init": 1,
223+
// disallow use of undefined when initializing variables
224+
"no-unused-vars": [
225+
1,
226+
{
227+
"vars": "all",
228+
"args": "none"
229+
}
230+
],
231+
// disallow declaration of variables that are not used in the code
232+
"no-use-before-define": 0,
233+
// disallow use of variables before they are defined
234+
235+
// Node.js
236+
// These rules are specific to JavaScript running on Node.js.
237+
238+
"handle-callback-err": 1,
239+
// enforces error handling in callbacks (off by default) (on by default in the node environment)
240+
"no-mixed-requires": 1,
241+
// disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)
242+
"no-new-require": 1,
243+
// disallow use of new operator with the require function (off by default) (on by default in the node environment)
244+
"no-path-concat": 1,
245+
// disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)
246+
"no-process-exit": 0,
247+
// disallow process.exit() (on by default in the node environment)
248+
"no-restricted-modules": 1,
249+
// restrict usage of specified node modules (off by default)
250+
"no-sync": 0,
251+
// disallow use of synchronous methods (off by default)
252+
253+
// Stylistic Issues
254+
// These rules are purely matters of style and are quite subjective.
255+
256+
"key-spacing": 0,
257+
"comma-spacing": 0,
258+
"no-multi-spaces": 0,
259+
"brace-style": 0,
260+
// enforce one true brace style (off by default)
261+
"camelcase": 0,
262+
// require camel case names
263+
"consistent-this": [
264+
1,
265+
"self"
266+
],
267+
// enforces consistent naming when capturing the current execution context (off by default)
268+
"eol-last": 1,
269+
// enforce newline at the end of file, with no multiple empty lines
270+
"func-names": 0,
271+
// require function expressions to have a name (off by default)
272+
"func-style": 0,
273+
// enforces use of function declarations or expressions (off by default)
274+
"new-cap": 0,
275+
// require a capital letter for constructors
276+
"new-parens": 1,
277+
// disallow the omission of parentheses when invoking a constructor with no arguments
278+
"no-nested-ternary": 0,
279+
// disallow nested ternary expressions (off by default)
280+
"no-array-constructor": 1,
281+
// disallow use of the Array constructor
282+
"no-lonely-if": 0,
283+
// disallow if as the only statement in an else block (off by default)
284+
"no-new-object": 1,
285+
// disallow use of the Object constructor
286+
"no-spaced-func": 1,
287+
// disallow space between function identifier and application
288+
"no-space-before-semi": 1,
289+
// disallow space before semicolon
290+
"no-ternary": 0,
291+
// disallow the use of ternary operators (off by default)
292+
"no-trailing-spaces": 1,
293+
// disallow trailing whitespace at the end of lines
294+
"no-underscore-dangle": 0,
295+
// disallow dangling underscores in identifiers
296+
"no-wrap-func": 1,
297+
// disallow wrapping of non-IIFE statements in parens
298+
"no-mixed-spaces-and-tabs": 1,
299+
// disallow mixed spaces and tabs for indentation
300+
"quotes": [
301+
1,
302+
"single",
303+
"avoid-escape"
304+
],
305+
// specify whether double or single quotes should be used
306+
"quote-props": 0,
307+
// require quotes around object literal property names (off by default)
308+
"semi": 1,
309+
// require or disallow use of semicolons instead of ASI
310+
"sort-vars": 0,
311+
// sort variables within the same declaration block (off by default)
312+
"space-after-keywords": 1,
313+
// require a space after certain keywords (off by default)
314+
"space-in-brackets": 0,
315+
// require or disallow spaces inside brackets (off by default)
316+
"space-in-parens": 0,
317+
// require or disallow spaces inside parentheses (off by default)
318+
"space-infix-ops": 1,
319+
// require spaces around operators
320+
"space-return-throw-case": 1,
321+
// require a space after return, throw, and case
322+
"space-unary-ops": [
323+
1,
324+
{
325+
"words": true,
326+
"nonwords": false
327+
}
328+
],
329+
// require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
330+
"max-nested-callbacks": 0,
331+
// specify the maximum depth callbacks can be nested (off by default)
332+
"one-var": 0,
333+
// allow just one var statement per function (off by default)
334+
"wrap-regex": 0,
335+
// require regex literals to be wrapped in parentheses (off by default)
336+
337+
// Legacy
338+
// The following rules are included for compatibility with JSHint and JSLint. While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.
339+
340+
"max-depth": 0,
341+
// specify the maximum depth that blocks can be nested (off by default)
342+
"max-len": 0,
343+
// specify the maximum length of a line in your program (off by default)
344+
"max-params": 0,
345+
// limits the number of parameters that can be used in the function declaration. (off by default)
346+
"max-statements": 0,
347+
// specify the maximum number of statement allowed in a function (off by default)
348+
"no-bitwise": 1,
349+
// disallow use of bitwise operators (off by default)
350+
"no-plusplus": 0,
351+
// disallow use of unary operators, ++ and -- (off by default)
352+
353+
"react/display-name": 0,
354+
"react/jsx-boolean-value": 0,
355+
"react/jsx-quotes": [
356+
1,
357+
"double",
358+
"avoid-escape"
359+
],
360+
"react/jsx-no-undef": 1,
361+
"react/jsx-sort-props": 0,
362+
"react/jsx-uses-react": 0,
363+
"react/jsx-uses-vars": 1,
364+
"react/no-did-mount-set-state": [
365+
1,
366+
"allow-in-func"
367+
],
368+
"react/no-did-update-set-state": [
369+
1,
370+
"allow-in-func"
371+
],
372+
"react/no-multi-comp": 0,
373+
"react/no-unknown-property": 0,
374+
"react/prop-types": 0,
375+
"react/react-in-jsx-scope": 0,
376+
"react/self-closing-comp": 1,
377+
"react/wrap-multilines": 0
378+
}
379+
}

0 commit comments

Comments
 (0)