-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc
178 lines (163 loc) · 8.24 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
/***************************************************************************************
* *
* The file contains rules which are thought that they would be used in the project. *
* *
* http://eslint.org/docs/rules/ *
* *
***************************************************************************************/
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true,
},
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"restParams": true, // Indicated by three dots (...). That named parameter becomes an Array containing the rest of the parameters passed to the function.
"superInFunctions": true,
"templateStrings": true, // Used inside of `` type quotes.
"jsx": true,
},
// Map from global var to bool specifying if it can be redefined
"globals": {
"__dirname": false,
"cancelAnimationFrame": false,
"clearImmediate": true,
"clearInterval": false,
"clearTimeout": false,
"console": false,
"document": false,
"escape": false,
"exports": false,
"fetch": false,
"global": false,
"jest": false,
"Map": true,
"module": false,
"navigator": false,
"process": false,
"Promise": true,
"requestAnimationFrame": true,
"require": false,
"Set": true,
"setImmediate": true,
"setInterval": false,
"setTimeout": false,
"window": false,
"XMLHttpRequest": false,
"pit": false
},
"rules": {
/* Possible Errors */
"comma-dangle": 0,
"no-console": 1,
"no-debugger": 1,
"no-dupe-keys": 2,
"no-dupe-args": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 1,
"no-extra-parens": 0,
"no-extra-semi": 1,
"no-invalid-regexp": 1,
"no-negated-in-lhs": 1,
"no-obj-calls": 1,
"no-regex-spaces": 1,
"no-reserved-keys": 0,
"no-sparse-arrays": 1,
"no-unreachable": 1,
"use-isnan": 1,
"valid-jsdoc": 0,
"valid-typeof": 1,
/* Best Practices */
"accessor-pairs": [1, {"getWithoutSet": true}], // Enforces getter/setter pairs in objects
"block-scoped-var": 0, // treat var statements as if they were block scoped (off by default)
"complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
"consistent-return": 0, // require return statements to either always or never specify values
"curly": 1, // specify curly brace conventions for all control statements
"default-case": 0, // require default case in switch statements (off by default)
"dot-location": [1, "property"], // enforces consistent newlines before or after dots
"dot-notation": 1, // encourages use of dot notation whenever possible
"eqeqeq": [1, "smart"], // require the use of === and !==
"guard-for-in": 0, // make sure for-in loops have an if statement (off by default)
"no-alert": 1, // disallow the use of alert, confirm and prompt
"no-caller": 1, // disallow use of arguments.caller or arguments.callee
"no-case-declarations": 1, // disallow lexical declarations in case clauses
"no-div-regex": 1, // disallow division operators explicitly at beginning of regular expression (off by default)
"no-else-return": 0, // disallow else after a return in an if (off by default)
"no-empty-label": 1, // disallow use of labels for anything other then loops and switches
"no-eq-null": 0, // disallow comparisons to null without a type-checking operator (off by default)
"no-eval": 1, // disallow use of eval()
"no-extend-native": 1, // disallow adding to native types
"no-extra-bind": 1, // disallow unnecessary function binding
"no-fallthrough": 1, // disallow fallthrough of case statements
"no-floating-decimal": 1, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
"no-implicit-coercion": 1, // disallow the type conversions with shorter notations
"no-implied-eval": 1, // disallow use of eval()-like methods
"no-invalid-this": 1, // disallow this keywords outside of classes or class-like objects
"no-iterator": 1, // disallow usage of __iterator__ property
"no-labels": 1, // disallow use of labeled statements
"no-lone-blocks": 1, // disallow unnecessary nested blocks
"no-loop-func": 0, // disallow creation of functions within loops
"no-magic-numbers": 0, // disallow the use of magic numbers
"no-multi-spaces": 1, // disallow use of multiple spaces (fixable)
"no-multi-str": 0, // disallow use of multiline strings
"no-native-reassign": 0, // disallow reassignments of native objects
"no-new-func": 1, // disallow use of new operator for Function object
"no-new-wrappers": 1, // disallows creating new instances of String,Number, and Boolean
"no-new": 1, // disallow use of new operator when not part of the assignment or comparison
"no-octal-escape": 1, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
"no-octal": 1, // disallow use of octal literals
"no-param-reassign": 0, // disallow reassignment of function parameters
"no-process-env": 0, // disallow use of process.env in Node.js
"no-proto": 1, // disallow usage of __proto__ property
"no-redeclare": 0, // disallow declaring the same variable more then once
"no-return-assign": 1, // disallow use of assignment in return statement
"no-script-url": 1, // disallow use of javascript: urls.
"no-self-compare": 1, // disallow comparisons where both sides are exactly the same (off by default)
"no-sequences": 1, // disallow use of comma operator
"no-throw-literal": 1, // restrict what can be thrown as an exception
"no-unused-expressions": 0, // disallow usage of expressions in statement position
"no-useless-call": 1, // disallow unnecessary .call() and .apply()
"no-useless-concat": 1, // disallow unnecessary concatenation of literals or template literals
"no-void": 1, // disallow use of void operator (off by default)
"no-warning-comments": 0, // disallow usage of configurable warning terms in comments": 1, // e.g. TODO or FIXME (off by default)
"no-with": 1, // disallow use of the with statement
"radix": 1, // require use of the second argument for parseInt() (off by default)
"vars-on-top": 0, // requires to declare all vars on top of their containing scope (off by default)
"wrap-iife": 0, // require immediate function invocation to be wrapped in parentheses (off by default)
"yoda": 1, // require or disallow Yoda conditions
/* Strict Mode */
"strict": [2, "global"],
/* Variables */
"no-undef": 2,
"no-undef-init": 1,
"no-unused-vars": [1, {"vars": "all", "args": "none"}], // disallow declaration of variables that are not used in the code
"no-shadow-restricted-names": 1,
/* Stylistic Issues */
"camelcase": [1, {"properties": "never"}],
"eol-last": 1,
"indent": [1, "tab"],
"quotes": [1, "single", "avoid-escape"],
"linebreak-style": [2, "unix"],
"new-parens": 1,
"no-trailing-spaces": 1,
"semi": [1, "always"],
"semi-spacing": 1, // require a space after a semi-colon
"space-after-keywords": 1,
"space-infix-ops": 1,
"space-return-throw-case": 1,
/* ECMAScript 6 */
"no-class-assign": 2,
"object-shorthand": 0,
}
}