|
| 1 | +{ |
| 2 | + "parser": "babel-eslint", |
| 3 | + "rules": { |
| 4 | + // Enforces getter/setter pairs in objects |
| 5 | + "accessor-pairs": 0, |
| 6 | + // treat var statements as if they were block scoped |
| 7 | + "block-scoped-var": 2, |
| 8 | + // specify the maximum cyclomatic complexity allowed in a program |
| 9 | + "complexity": [0, 11], |
| 10 | + // require return statements to either always or never specify values |
| 11 | + "consistent-return": 0, |
| 12 | + // specify curly brace conventions for all control statements |
| 13 | + "curly": [2, "multi-line"], |
| 14 | + // require default case in switch statements |
| 15 | + "default-case": 2, |
| 16 | + // encourages use of dot notation whenever possible |
| 17 | + "dot-notation": [2, { |
| 18 | + "allowKeywords": true |
| 19 | + }], |
| 20 | + // enforces consistent newlines before or after dots |
| 21 | + "dot-location": 0, |
| 22 | + // require the use of === and !== |
| 23 | + "eqeqeq": 2, |
| 24 | + // make sure for-in loops have an if statement |
| 25 | + "guard-for-in": 2, |
| 26 | + // disabled use of an undefined variable |
| 27 | + "no-undef": 2, |
| 28 | + // disallow the use of console |
| 29 | + "no-console": 0, |
| 30 | + // disallow the use of alert, confirm, and prompt |
| 31 | + "no-alert": 0, |
| 32 | + // disallow use of arguments.caller or arguments.callee |
| 33 | + "no-caller": 2, |
| 34 | + // disallow division operators explicitly at beginning of regular expression |
| 35 | + "no-div-regex": 0, |
| 36 | + // disallow else after a return in an if |
| 37 | + "no-else-return": 0, |
| 38 | + // disallow comparisons to null without a type-checking operator |
| 39 | + "no-eq-null": 2, |
| 40 | + // disallow use of eval() |
| 41 | + "no-eval": 2, |
| 42 | + // disallow adding to native types |
| 43 | + "no-extend-native": 2, |
| 44 | + // disallow unnecessary function binding |
| 45 | + "no-extra-bind": 2, |
| 46 | + // disallow fallthrough of case statements |
| 47 | + "no-fallthrough": 2, |
| 48 | + // disallow the use of leading or trailing decimal points in numeric literals |
| 49 | + "no-floating-decimal": 2, |
| 50 | + // disallow the type conversions with shorter notations |
| 51 | + "no-implicit-coercion": 0, |
| 52 | + // disallow use of eval()-like methods |
| 53 | + "no-implied-eval": 2, |
| 54 | + // disallow this keywords outside of classes or class-like objects |
| 55 | + "no-invalid-this": 0, |
| 56 | + // disallow usage of __iterator__ property |
| 57 | + "no-iterator": 2, |
| 58 | + // disallow use of labeled statements |
| 59 | + "no-labels": 2, |
| 60 | + // disallow unnecessary nested blocks |
| 61 | + "no-lone-blocks": 2, |
| 62 | + // disallow creation of functions within loops |
| 63 | + "no-loop-func": 2, |
| 64 | + // disallow use of multiple spaces |
| 65 | + "no-multi-spaces": 2, |
| 66 | + // disallow use of multiline strings |
| 67 | + "no-multi-str": 2, |
| 68 | + // disallow reassignments of native objects |
| 69 | + "no-native-reassign": 2, |
| 70 | + // disallow use of new operator when not part of the assignment or comparison |
| 71 | + "no-new": 2, |
| 72 | + // disallow use of new operator for Function object |
| 73 | + "no-new-func": 2, |
| 74 | + // disallows creating new instances of String,Number, and Boolean |
| 75 | + "no-new-wrappers": 2, |
| 76 | + // disallow use of (old style) octal literals |
| 77 | + "no-octal": 2, |
| 78 | + // disallow use of octal escape sequences in string literals, such as |
| 79 | + // var foo = "Copyright \251"; |
| 80 | + "no-octal-escape": 2, |
| 81 | + // disallow reassignment of function parameters |
| 82 | + "no-param-reassign": 0, |
| 83 | + // disallow use of process.env |
| 84 | + "no-process-env": 0, |
| 85 | + // disallow usage of __proto__ property |
| 86 | + "no-proto": 2, |
| 87 | + // disallow declaring the same variable more then once |
| 88 | + "no-redeclare": 2, |
| 89 | + // disallow use of assignment in return statement |
| 90 | + "no-return-assign": 2, |
| 91 | + // disallow use of `javascript:` urls. |
| 92 | + "no-script-url": 2, |
| 93 | + // disallow comparisons where both sides are exactly the same |
| 94 | + "no-self-compare": 2, |
| 95 | + // disallow use of comma operator |
| 96 | + "no-sequences": 2, |
| 97 | + // restrict what can be thrown as an exception |
| 98 | + "no-throw-literal": 2, |
| 99 | + // disallow usage of expressions in statement position |
| 100 | + "no-unused-expressions": 2, |
| 101 | + // disallow unused variables/imports |
| 102 | + "no-unused-vars": [2, { "vars": "all", "args": "none" }], |
| 103 | + // disallow unnecessary .call() and .apply() |
| 104 | + "no-useless-call": 0, |
| 105 | + // disallow use of void operator |
| 106 | + "no-void": 0, |
| 107 | + // disallow usage of configurable warning terms in comments: e.g. todo |
| 108 | + "no-warning-comments": [0, { |
| 109 | + "terms": ["todo", "fixme", "xxx"], |
| 110 | + "location": "start" |
| 111 | + }], |
| 112 | + // disallow use of the with statement |
| 113 | + "no-with": 2, |
| 114 | + // require use of the second argument for parseInt() |
| 115 | + "radix": 2, |
| 116 | + // requires to declare all vars on top of their containing scope |
| 117 | + "vars-on-top": 2, |
| 118 | + // require immediate function invocation to be wrapped in parentheses |
| 119 | + "wrap-iife": [2, "any"], |
| 120 | + // require or disallow Yoda conditions |
| 121 | + "yoda": 2, |
| 122 | + // enforce spacing inside array brackets |
| 123 | + "array-bracket-spacing": 2, |
| 124 | + // enforce one true brace style |
| 125 | + "brace-style": [2, "1tbs", { |
| 126 | + "allowSingleLine": true |
| 127 | + }], |
| 128 | + // require camel case names |
| 129 | + "camelcase": [2, { |
| 130 | + "properties": "never" |
| 131 | + }], |
| 132 | + // enforce spacing before and after comma |
| 133 | + "comma-spacing": [2, { |
| 134 | + "before": false, |
| 135 | + "after": true |
| 136 | + }], |
| 137 | + // enforce one true comma style |
| 138 | + "comma-style": [2, "last"], |
| 139 | + // require or disallow padding inside computed properties |
| 140 | + "computed-property-spacing": 2, |
| 141 | + // enforces consistent naming when capturing the current execution context |
| 142 | + "consistent-this": 0, |
| 143 | + // enforce newline at the end of file, with no multiple empty lines |
| 144 | + "eol-last": 2, |
| 145 | + // require function expressions to have a name |
| 146 | + "func-names": 0, |
| 147 | + // enforces use of function declarations or expressions |
| 148 | + "func-style": 0, |
| 149 | + // this option enforces minimum and maximum identifier lengths (variable names, property names etc.) |
| 150 | + "id-length": 0, |
| 151 | + // this option sets a specific tab width for your code |
| 152 | + "indent": [2, 2, { "SwitchCase": 1 }], |
| 153 | + // enforces spacing between keys and values in object literal properties |
| 154 | + "key-spacing": [2, { |
| 155 | + "beforeColon": false, |
| 156 | + "afterColon": true |
| 157 | + }], |
| 158 | + "keyword-spacing": 2, |
| 159 | + // enforces empty lines around comments |
| 160 | + "lines-around-comment": 0, |
| 161 | + // disallow mixed "LF" and "CRLF" as linebreaks |
| 162 | + "linebreak-style": [2, "unix"], |
| 163 | + // specify the maximum depth callbacks can be nested |
| 164 | + "max-nested-callbacks": 0, |
| 165 | + // require a capital letter for constructors |
| 166 | + "new-cap": [2, { |
| 167 | + "newIsCap": true |
| 168 | + }], |
| 169 | + // disallow the omission of parentheses when invoking a constructor with no arguments |
| 170 | + "new-parens": 2, |
| 171 | + // allow/disallow an empty newline after var statement |
| 172 | + "newline-after-var": 0, |
| 173 | + // disallow use of the Array constructor |
| 174 | + "no-array-constructor": 0, |
| 175 | + // disallow use of the continue statement |
| 176 | + "no-continue": 0, |
| 177 | + // disallow comments inline after code |
| 178 | + "no-inline-comments": 0, |
| 179 | + // disallow if as the only statement in an else block |
| 180 | + "no-lonely-if": 0, |
| 181 | + // disallow mixed spaces and tabs for indentation |
| 182 | + "no-mixed-spaces-and-tabs": 2, |
| 183 | + // disallow multiple empty lines |
| 184 | + "no-multiple-empty-lines": [2, { |
| 185 | + "max": 2 |
| 186 | + }], |
| 187 | + // disallow nested ternary expressions |
| 188 | + "no-nested-ternary": 2, |
| 189 | + // disallow use of the Object constructor |
| 190 | + "no-new-object": 2, |
| 191 | + // disallow space between function identifier and application |
| 192 | + "no-spaced-func": 2, |
| 193 | + // disallow the use of ternary operators |
| 194 | + "no-ternary": 0, |
| 195 | + // disallow trailing whitespace at the end of lines |
| 196 | + "no-trailing-spaces": 2, |
| 197 | + // disallow dangling underscores in identifiers |
| 198 | + "no-underscore-dangle": 0, |
| 199 | + // disallow the use of Boolean literals in conditional expressions |
| 200 | + "no-unneeded-ternary": 2, |
| 201 | + // require or disallow padding inside curly braces |
| 202 | + "object-curly-spacing": [2, "always"], |
| 203 | + // allow just one var statement per function |
| 204 | + "one-var": [2, "never"], |
| 205 | + // require assignment operator shorthand where possible or prohibit it entirely |
| 206 | + "operator-assignment": 0, |
| 207 | + // enforce operators to be placed before or after line breaks |
| 208 | + "operator-linebreak": 0, |
| 209 | + // enforce padding within blocks |
| 210 | + "padded-blocks": [2, "never"], |
| 211 | + // require quotes around object literal property names |
| 212 | + "quote-props": [2, "as-needed"], |
| 213 | + // specify whether double or single quotes should be used |
| 214 | + "quotes": [2, "single", "avoid-escape"], |
| 215 | + // require identifiers to match the provided regular expression |
| 216 | + "id-match": 0, |
| 217 | + // enforce spacing before and after semicolons |
| 218 | + "semi-spacing": [2, { |
| 219 | + "before": false, |
| 220 | + "after": true |
| 221 | + }], |
| 222 | + // require or disallow use of semicolons instead of ASI |
| 223 | + "semi": [2, "always"], |
| 224 | + // sort variables within the same declaration block |
| 225 | + "sort-vars": 0, |
| 226 | + // require or disallow space before blocks |
| 227 | + "space-before-blocks": 2, |
| 228 | + // require or disallow space before function opening parenthesis |
| 229 | + "space-before-function-paren": [0, { "anonymous": "always", "named": "never" }], |
| 230 | + // require or disallow spaces inside parentheses |
| 231 | + "space-in-parens": 0, |
| 232 | + // require spaces around operators |
| 233 | + "space-infix-ops": 2, |
| 234 | + // Require or disallow spaces before/after unary operators |
| 235 | + "space-unary-ops": 2, |
| 236 | + |
| 237 | + /* ES6+ */ |
| 238 | + // disallow using `var`. Must use `let` or `const` |
| 239 | + "no-var": 2, |
| 240 | + "no-class-assign": 2, |
| 241 | + "no-const-assign": 2, |
| 242 | + "no-dupe-class-members": 2, |
| 243 | + "no-this-before-super": 2, |
| 244 | + "prefer-const": 0, |
| 245 | + "prefer-spread": 2, |
| 246 | + // require object literal shorthand |
| 247 | + "object-shorthand": [2, "always"], |
| 248 | + "arrow-spacing": 2, |
| 249 | + "prefer-arrow-callback": 2, |
| 250 | + "arrow-parens": [0, "as-needed"], |
| 251 | + }, |
| 252 | + "env": { |
| 253 | + "browser": true, |
| 254 | + "es6": true |
| 255 | + }, |
| 256 | + "globals": { |
| 257 | + "require": true |
| 258 | + }, |
| 259 | + "ecmaFeatures": { |
| 260 | + "jsx": true |
| 261 | + } |
| 262 | +} |
0 commit comments