|
| 1 | +{ |
| 2 | + "parser": "babel-eslint", |
| 3 | + "env": { |
| 4 | + "browser": true, |
| 5 | + "commonjs": true, |
| 6 | + "es6": true, |
| 7 | + "node": true |
| 8 | + }, |
| 9 | + "parserOptions": { |
| 10 | + "ecmaVersion": 6, |
| 11 | + "sourceType": "module", |
| 12 | + "ecmaFeatures": { |
| 13 | + "experimentalObjectRestSpread": true |
| 14 | + } |
| 15 | + }, |
| 16 | + "rules": { |
| 17 | + // require function declarations instead of expressions |
| 18 | + "func-style": [ |
| 19 | + "warn", |
| 20 | + "declaration", |
| 21 | + { "allowArrowFunctions": true } |
| 22 | + ], |
| 23 | + |
| 24 | + // disallow declaration of variables already declared in the outer scope |
| 25 | + // "no-shadow": "warn", |
| 26 | + |
| 27 | + // require let or const instead of var |
| 28 | + "no-var": "warn", |
| 29 | + |
| 30 | + "no-unused-vars": "warn", |
| 31 | + |
| 32 | + "max-len": [ |
| 33 | + "warn", |
| 34 | + 120 |
| 35 | + ], |
| 36 | + |
| 37 | + // require or disallow use of semicolons instead of ASI |
| 38 | + "semi": [ |
| 39 | + "warn", |
| 40 | + "never" |
| 41 | + ], |
| 42 | + |
| 43 | + // require the use of === and !== except null comparison |
| 44 | + "eqeqeq": [ |
| 45 | + "warn", |
| 46 | + "smart" |
| 47 | + ], |
| 48 | + |
| 49 | + // specify whether double or single quotes should be used |
| 50 | + "quotes": [ |
| 51 | + "warn", |
| 52 | + "single", |
| 53 | + "avoid-escape" |
| 54 | + ], |
| 55 | + |
| 56 | + // require space before/after arrow function"s arrow |
| 57 | + "arrow-spacing": [ |
| 58 | + "warn", |
| 59 | + { |
| 60 | + "before": true, |
| 61 | + "after": true |
| 62 | + } |
| 63 | + ], |
| 64 | + |
| 65 | + "arrow-parens": ["warn", "as-needed"], |
| 66 | + |
| 67 | + // suggest using of const declaration for variables that are never modified after declared |
| 68 | + "prefer-const": "warn", |
| 69 | + |
| 70 | + // restrict what can be thrown as an exception |
| 71 | + "no-throw-literal": "warn", |
| 72 | + |
| 73 | + // disallow Unused Expressions |
| 74 | + "no-unused-expressions": [ |
| 75 | + "warn", |
| 76 | + { |
| 77 | + "allowShortCircuit": true |
| 78 | + } |
| 79 | + ], |
| 80 | + |
| 81 | + // require padding inside curly braces |
| 82 | + "object-curly-spacing": [ |
| 83 | + "warn", |
| 84 | + "always" |
| 85 | + ] |
| 86 | + } |
| 87 | +} |
0 commit comments