|
| 1 | +module.exports = { |
| 2 | + "env": { |
| 3 | + "node": true, |
| 4 | + "commonjs": true, |
| 5 | + "es6": true |
| 6 | + }, |
| 7 | + "extends": [ |
| 8 | + "eslint:recommended" |
| 9 | + ], |
| 10 | + "parserOptions": { |
| 11 | + "ecmaVersion": 2018 |
| 12 | + }, |
| 13 | + "rules": { |
| 14 | + // Bad Practices |
| 15 | + "curly": "error", |
| 16 | + "no-await-in-loop": "error", |
| 17 | + "no-eval": "error", |
| 18 | + "no-implicit-globals": "error", |
| 19 | + "no-lone-blocks": "error", |
| 20 | + "no-return-await": "error", |
| 21 | + "no-self-compare": "error", |
| 22 | + "no-sequences": "error", |
| 23 | + "no-throw-literal": "error", |
| 24 | + "no-with": "error", |
| 25 | + "prefer-arrow-callback": [ "error", { "allowNamedFunctions": true } ], |
| 26 | + "prefer-promise-reject-errors": "error", |
| 27 | + "prefer-rest-params": "warn", |
| 28 | + "no-label-var": "error", |
| 29 | + "no-undefined": "off", |
| 30 | + "no-use-before-define": "error", |
| 31 | + "no-array-constructor": "error", |
| 32 | + "no-new-object": "error", |
| 33 | + "no-continue": "error", |
| 34 | + "no-unneeded-ternary": "error", |
| 35 | + "complexity": [ "error", 70 ], |
| 36 | + |
| 37 | + // Common Mistakes |
| 38 | + "no-extra-bind": "warn", |
| 39 | + "no-floating-decimal": "warn", |
| 40 | + "no-multi-spaces": "warn", |
| 41 | + "no-useless-call": "warn", |
| 42 | + "no-useless-return": "warn", |
| 43 | + "require-await": "off", |
| 44 | + "no-mixed-operators": "warn", |
| 45 | + |
| 46 | + // Style |
| 47 | + "array-bracket-newline": [ "warn", "consistent" ], |
| 48 | + "array-bracket-spacing": [ "warn", "always" ], |
| 49 | + "array-element-newline": [ "warn", "consistent" ], |
| 50 | + "arrow-parens": [ "warn", "always" ], |
| 51 | + "arrow-spacing": "warn", |
| 52 | + "block-spacing": "warn", |
| 53 | + "brace-style": [ "warn", "allman", { "allowSingleLine": true } ], |
| 54 | + "camelcase": "warn", |
| 55 | + "comma-dangle": [ "warn", "never" ], |
| 56 | + "comma-spacing": [ "warn", { "before": false, "after": true } ], |
| 57 | + "comma-style": [ "warn", "last" ], |
| 58 | + "computed-property-spacing": [ "warn", "never" ], |
| 59 | + "consistent-this": [ "warn", "self" ], |
| 60 | + "eol-last": [ "warn", "always" ], |
| 61 | + "func-call-spacing": ["warn", "never"], |
| 62 | + "func-style": [ "warn", "declaration", { "allowArrowFunctions": true } ], |
| 63 | + "function-paren-newline": [ "warn", "multiline" ], |
| 64 | + "generator-star-spacing": [ "warn", { "before": true, "after": false } ], |
| 65 | + "id-length": [ "warn", { "min": 2, "exceptions": [ "$", "_", "i", "x", "y", "z" ] } ], |
| 66 | + "indent": [ |
| 67 | + "warn", |
| 68 | + 4, |
| 69 | + { |
| 70 | + "SwitchCase": 1, |
| 71 | + "VariableDeclarator": 1, |
| 72 | + "outerIIFEBody": 1, |
| 73 | + "MemberExpression": 1, |
| 74 | + "FunctionDeclaration": { |
| 75 | + "parameters": 1, |
| 76 | + "body": 1 |
| 77 | + }, |
| 78 | + "FunctionExpression": { |
| 79 | + "parameters": 1, |
| 80 | + "body": 1 |
| 81 | + }, |
| 82 | + "CallExpression": { |
| 83 | + "arguments": 1 |
| 84 | + }, |
| 85 | + "ArrayExpression": 1, |
| 86 | + "ObjectExpression": 1, |
| 87 | + "ImportDeclaration": 1, |
| 88 | + "flatTernaryExpressions": false |
| 89 | + } |
| 90 | + ], |
| 91 | + "key-spacing": [ "warn", { "beforeColon": false, "afterColon": true } ], |
| 92 | + "keyword-spacing": [ |
| 93 | + "warn", |
| 94 | + { |
| 95 | + "overrides": { |
| 96 | + "if": { "after": false }, |
| 97 | + "for": { "after": false }, |
| 98 | + "while": { "after": false } |
| 99 | + } |
| 100 | + } |
| 101 | + ], |
| 102 | + "lines-between-class-members": [ "warn", "always", { exceptAfterSingleLine: true } ], |
| 103 | + "new-parens": "warn", |
| 104 | + "newline-per-chained-call": [ "warn", { "ignoreChainWithDepth": 2 } ], |
| 105 | + "no-confusing-arrow": [ "warn", { "allowParens": false } ], |
| 106 | + "no-duplicate-imports": "warn", |
| 107 | + "no-lonely-if": "warn", |
| 108 | + "no-multi-assign": "warn", |
| 109 | + "no-multiple-empty-lines": [ "warn", { "max": 1, "maxBOF": 0, "maxEOF": 1 } ], |
| 110 | + "no-trailing-spaces": "warn", |
| 111 | + "no-useless-computed-key": "warn", |
| 112 | + "no-useless-rename": [ |
| 113 | + "error", |
| 114 | + { |
| 115 | + "ignoreDestructuring": false, |
| 116 | + "ignoreImport": false, |
| 117 | + "ignoreExport": false |
| 118 | + } |
| 119 | + ], |
| 120 | + "no-var": "warn", |
| 121 | + "no-whitespace-before-property": "warn", |
| 122 | + "object-curly-spacing": [ "warn", "always" ], |
| 123 | + "object-property-newline": [ "warn", { "allowAllPropertiesOnSameLine": true } ], |
| 124 | + "object-shorthand": [ "warn", "always" ], |
| 125 | + "one-var": [ "warn", "never" ], |
| 126 | + "operator-linebreak": [ "warn", "before" ], |
| 127 | + "padded-blocks": [ "warn", "never" ], |
| 128 | + "prefer-const": "warn", |
| 129 | + "prefer-object-spread": "warn", |
| 130 | + "prefer-template": "warn", |
| 131 | + "quote-props": [ "warn", "consistent-as-needed" ], |
| 132 | + "quotes": [ "warn", "single", { "avoidEscape": true, "allowTemplateLiterals": true } ], |
| 133 | + "semi": [ "error", "always" ], |
| 134 | + "semi-spacing": [ "warn", { "before": false, "after": true } ], |
| 135 | + "space-before-blocks": "warn", |
| 136 | + "space-before-function-paren": [ "warn", "never" ], |
| 137 | + "space-in-parens": [ "warn", "never" ], |
| 138 | + "space-infix-ops": "warn", |
| 139 | + "space-unary-ops": "warn", |
| 140 | + "spaced-comment": [ |
| 141 | + "warn", |
| 142 | + "always", { |
| 143 | + "line": { |
| 144 | + "markers": [ "/" ], |
| 145 | + "exceptions": [ "-", "+" ] |
| 146 | + }, |
| 147 | + "block": { |
| 148 | + "markers": ["!"], |
| 149 | + "exceptions": ["*"], |
| 150 | + "balanced": true |
| 151 | + } |
| 152 | + } |
| 153 | + ], |
| 154 | + "switch-colon-spacing": "warn", |
| 155 | + "template-curly-spacing": [ "warn", "always" ], |
| 156 | + "template-tag-spacing": "warn", |
| 157 | + "valid-jsdoc": [ |
| 158 | + "warn", |
| 159 | + { |
| 160 | + "prefer": { |
| 161 | + "arg": "param", |
| 162 | + "argument": "param", |
| 163 | + "class": "class", |
| 164 | + "return": "returns", |
| 165 | + "virtual": "abstract" |
| 166 | + }, |
| 167 | + "preferType": { |
| 168 | + "Boolean": "boolean", |
| 169 | + "Number": "number", |
| 170 | + "Object": "object", |
| 171 | + "String": "string" |
| 172 | + }, |
| 173 | + "requireReturn": true, |
| 174 | + "requireParamDescription": true, |
| 175 | + "requireParamType": true |
| 176 | + } |
| 177 | + ], |
| 178 | + "yield-star-spacing": [ "warn", "before" ], |
| 179 | + "yoda": [ "warn", "never", { "exceptRange": true } ] |
| 180 | + } |
| 181 | +}; |
0 commit comments