|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +module.exports = { |
| 4 | + rules: { |
| 5 | + // require corresponding getters for any setters |
| 6 | + 'accessor-pairs': 'error', |
| 7 | + |
| 8 | + // treat var statements as if they were block scoped |
| 9 | + 'block-scoped-var': 'error', |
| 10 | + |
| 11 | + // verify calls of super() in constructors |
| 12 | + 'constructor-super': 'error', |
| 13 | + |
| 14 | + // require the use of === and !== |
| 15 | + eqeqeq: 'error', |
| 16 | + |
| 17 | + // make sure for-in loops have an if statement |
| 18 | + 'guard-for-in': 'error', |
| 19 | + |
| 20 | + // require a capital letter for constructors |
| 21 | + 'new-cap': 'error', |
| 22 | + |
| 23 | + // disallow the omission of parentheses when invoking a constructor with no arguments |
| 24 | + 'new-parens': 'error', |
| 25 | + |
| 26 | + // disallow use of the Array constructor |
| 27 | + 'no-array-constructor': 'error', |
| 28 | + |
| 29 | + // disallow use of bitwise operators |
| 30 | + 'no-bitwise': 'error', |
| 31 | + |
| 32 | + // disallow use of arguments.caller or arguments.callee |
| 33 | + 'no-caller': 'error', |
| 34 | + |
| 35 | + // disallow the catch clause parameter name being the same as a variable in the outer scope |
| 36 | + 'no-catch-shadow': 'warn', |
| 37 | + |
| 38 | + // disallow assignment in conditional expressions |
| 39 | + 'no-cond-assign': 'error', |
| 40 | + |
| 41 | + // disallow control characters in regular expressions |
| 42 | + 'no-control-regex': 'error', |
| 43 | + |
| 44 | + // disallow use of debugger |
| 45 | + 'no-debugger': 'error', |
| 46 | + |
| 47 | + // disallow deletion of variables |
| 48 | + 'no-delete-var': 'error', |
| 49 | + |
| 50 | + // disallow division operators explicitly at beginning of regular expression |
| 51 | + 'no-div-regex': 'error', |
| 52 | + |
| 53 | + // disallow duplicate argument names in functions |
| 54 | + 'no-dupe-args': 'error', |
| 55 | + |
| 56 | + // disallow duplicate keys when creating object literals |
| 57 | + 'no-dupe-keys': 'error', |
| 58 | + |
| 59 | + // disallow duplicate case labels |
| 60 | + 'no-duplicate-case': 'error', |
| 61 | + |
| 62 | + // disallow empty statements |
| 63 | + 'no-empty': 'error', |
| 64 | + |
| 65 | + // disallow the use of empty character classes in regular expressions |
| 66 | + 'no-empty-character-class': 'error', |
| 67 | + |
| 68 | + // disallow comparisons to null without a type-checking operator |
| 69 | + 'no-eq-null': 'error', |
| 70 | + |
| 71 | + // disallow use of eval() |
| 72 | + 'no-eval': 'error', |
| 73 | + |
| 74 | + // disallow adding to native types |
| 75 | + 'no-extend-native': 'error', |
| 76 | + |
| 77 | + // disallow unnecessary function binding |
| 78 | + 'no-extra-bind': 'error', |
| 79 | + |
| 80 | + // disallow double-negation boolean casts in a boolean context |
| 81 | + 'no-extra-boolean-cast': 'error', |
| 82 | + |
| 83 | + // disallow unnecessary semicolons |
| 84 | + 'no-extra-semi': 'error', |
| 85 | + |
| 86 | + // disallow fallthrough of case statements |
| 87 | + 'no-fallthrough': 'error', |
| 88 | + |
| 89 | + // disallow the use of leading or trailing decimal points in numeric literals |
| 90 | + 'no-floating-decimal': 'error', |
| 91 | + |
| 92 | + // disallow overwriting functions written as function declarations |
| 93 | + 'no-func-assign': 'error', |
| 94 | + |
| 95 | + // disallow use of eval()-like methods |
| 96 | + 'no-implied-eval': 'error', |
| 97 | + |
| 98 | + // disallow function or variable declarations in nested blocks |
| 99 | + 'no-inner-declarations': 'error', |
| 100 | + |
| 101 | + // disallow invalid regular expression strings in the RegExp constructor |
| 102 | + 'no-invalid-regexp': 'error', |
| 103 | + |
| 104 | + // disallow usage of __iterator__ property |
| 105 | + 'no-iterator': 'error', |
| 106 | + |
| 107 | + // disallow labels that share a name with a variable |
| 108 | + 'no-label-var': 'error', |
| 109 | + |
| 110 | + // disallow use of labeled statements |
| 111 | + 'no-labels': 'error', |
| 112 | + |
| 113 | + // disallow unnecessary nested blocks |
| 114 | + 'no-lone-blocks': 'warn', |
| 115 | + |
| 116 | + // disallow creation of functions within loops |
| 117 | + 'no-loop-func': 'warn', |
| 118 | + |
| 119 | + // disallow use of multiline strings |
| 120 | + 'no-multi-str': 'error', |
| 121 | + |
| 122 | + // disallow reassignments of native objects |
| 123 | + 'no-native-reassign': 'error', |
| 124 | + |
| 125 | + // disallow negation of the left operand of an in expression |
| 126 | + 'no-negated-in-lhs': 'error', |
| 127 | + |
| 128 | + // disallow use of new operator when not part of the assignment or comparison |
| 129 | + 'no-new': 'error', |
| 130 | + |
| 131 | + // disallow use of new operator for Function object |
| 132 | + 'no-new-func': 'error', |
| 133 | + |
| 134 | + // disallow use of the Object constructor |
| 135 | + 'no-new-object': 'error', |
| 136 | + |
| 137 | + // disallows creating new instances of String, Number, and Boolean |
| 138 | + 'no-new-wrappers': 'error', |
| 139 | + |
| 140 | + // disallow the use of object properties of the global object (Math and JSON) as functions |
| 141 | + 'no-obj-calls': 'error', |
| 142 | + |
| 143 | + // disallow use of octal literals |
| 144 | + 'no-octal': 'error', |
| 145 | + |
| 146 | + // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \050"; |
| 147 | + 'no-octal-escape': 'error', |
| 148 | + |
| 149 | + // disallow usage of __proto__ property |
| 150 | + 'no-proto': 'error', |
| 151 | + |
| 152 | + // disallow declaring the same variable more then once |
| 153 | + 'no-redeclare': 'error', |
| 154 | + |
| 155 | + // disallow use of javascript: urls. |
| 156 | + 'no-script-url': 'error', |
| 157 | + |
| 158 | + // disallow comparisons where both sides are exactly the same |
| 159 | + 'no-self-compare': 'error', |
| 160 | + |
| 161 | + // disallow use of comma operator |
| 162 | + 'no-sequences': 'error', |
| 163 | + |
| 164 | + // disallow declaration of variables already declared in the outer scope |
| 165 | + 'no-shadow': 'warn', |
| 166 | + |
| 167 | + // disallow shadowing of names such as arguments |
| 168 | + 'no-shadow-restricted-names': 'error', |
| 169 | + |
| 170 | + // disallow sparse arrays |
| 171 | + 'no-sparse-arrays': 'error', |
| 172 | + |
| 173 | + // disallow throwing non-Error objects |
| 174 | + 'no-throw-literal': 'error', |
| 175 | + |
| 176 | + // disallow use of void operator |
| 177 | + 'no-void': 'error', |
| 178 | + |
| 179 | + // disallow use of the with statement |
| 180 | + 'no-with': 'error', |
| 181 | + |
| 182 | + // require assignment operator shorthand where possible |
| 183 | + 'operator-assignment': 'error', |
| 184 | + |
| 185 | + // disallow comparisons with the value NaN |
| 186 | + 'use-isnan': 'error', |
| 187 | + |
| 188 | + // Ensure that the results of typeof are compared against a valid string |
| 189 | + 'valid-typeof': 'error', |
| 190 | + |
| 191 | + // require immediate function invocation to be wrapped in parentheses |
| 192 | + 'wrap-iife': 'error', |
| 193 | + |
| 194 | + // disallow Yoda conditions |
| 195 | + yoda: 'error', |
| 196 | + |
| 197 | + } |
| 198 | +}; |
0 commit comments