-
Notifications
You must be signed in to change notification settings - Fork 2
/
bugs.js
171 lines (119 loc) · 4.97 KB
/
bugs.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
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
"use strict";
module.exports = {
rules: {
// require corresponding getters for any setters
"accessor-pairs": "error",
// treat var statements as if they were block scoped
"block-scoped-var": "error",
// verify calls of super() in constructors
"constructor-super": "error",
// require the use of === and !==
eqeqeq: "error",
// make sure for-in loops have an if statement
"guard-for-in": "error",
// disallow use of the Array constructor
"no-array-constructor": "error",
// disallow use of bitwise operators
"no-bitwise": "error",
// disallow assignment in conditional expressions
"no-cond-assign": "error",
// disallow control characters in regular expressions
"no-control-regex": "error",
// disallow use of debugger
"no-debugger": "error",
// disallow deletion of variables
"no-delete-var": "error",
// disallow division operators explicitly at beginning of regular expression
"no-div-regex": "error",
// disallow duplicate argument names in functions
"no-dupe-args": "error",
// disallow duplicate keys when creating object literals
"no-dupe-keys": "error",
// disallow duplicate case labels
"no-duplicate-case": "error",
// disallow empty statements
"no-empty": "error",
// disallow the use of empty character classes in regular expressions
"no-empty-character-class": "error",
// disallow comparisons to null without a type-checking operator
"no-eq-null": "error",
// disallow adding to native types
"no-extend-native": "error",
// disallow unnecessary function binding
"no-extra-bind": "error",
// disallow double-negation boolean casts in a boolean context
"no-extra-boolean-cast": "error",
// disallow unnecessary semicolons
"no-extra-semi": "error",
// disallow fallthrough of case statements
"no-fallthrough": "error",
// disallow the use of leading or trailing decimal points in numeric literals
"no-floating-decimal": "error",
// disallow overwriting functions written as function declarations
"no-func-assign": "error",
// disallow function or variable declarations in nested blocks
"no-inner-declarations": "error",
// disallow invalid regular expression strings in the RegExp constructor
"no-invalid-regexp": "error",
// disallow usage of __iterator__ property
"no-iterator": "error",
// disallow labels that share a name with a variable
"no-label-var": "error",
// disallow unnecessary nested blocks
"no-lone-blocks": "warn",
// disallow creation of functions within loops
"no-loop-func": "warn",
// disallow reassignments of native objects
"no-native-reassign": "error",
// disallow negation of the left operand of an in expression
"no-negated-in-lhs": "error",
// disallow use of new operator when not part of the assignment or comparison
"no-new": "error",
// disallow use of new operator for Function object
"no-new-func": "error",
// disallow use of the Object constructor
"no-new-object": "error",
// disallows creating new instances of String, Number, and Boolean
"no-new-wrappers": "error",
// disallow the use of object properties of the global object (Math and JSON) as functions
"no-obj-calls": "error",
// disallow use of octal literals
"no-octal": "error",
// disallow use of octal escape sequences in string literals, such as var foo = "Copyright \050";
"no-octal-escape": "error",
// disallow declaring the same variable more then once
"no-redeclare": "error",
// disallow comparisons where both sides are exactly the same
"no-self-compare": "error",
// disallow declaration of variables already declared in the outer scope
"no-shadow": "warn",
// disallow sparse arrays
"no-sparse-arrays": "error",
// disallow use of undeclared variables unless mentioned in a /*global */ block
"no-undef": "error",
// disallow unreachable statements after a return, throw, continue, or break statement
"no-unreachable": "warn",
// disallow usage of expressions in statement position
"no-unused-expressions": [
"error",
{
allowShortCircuit: true, // allow short-circuited expressions (e.g. foo && bar())
allowTernary: true, // allow ternary expressions (e.g. foo ? bar() : baz())
},
],
// disallow declaration of variables that are not used in the code
"no-unused-vars": [
"error",
{
vars: "all", // check "all" variables (as opposed to just "local" variables)
args: "after-used", // check any arguments that come "after-used" arguments
},
],
// disallow comparisons with the value NaN
"use-isnan": "error",
// Ensure that the results of typeof are compared against a valid string
"valid-typeof": "error",
// require immediate function invocation to be wrapped in parentheses
"wrap-iife": "error",
}
};