|
| 1 | +{ |
| 2 | +"env": { |
| 3 | +"node":true, |
| 4 | +"browser":true, |
| 5 | +"es2021":true |
| 6 | + }, |
| 7 | +"extends": [ |
| 8 | +// "eslint:recommended", |
| 9 | +"prettier" |
| 10 | + ], |
| 11 | +"parserOptions": { |
| 12 | +"sourceType":"module" |
| 13 | + }, |
| 14 | +"rules": { |
| 15 | +// Possible Errors (overrides from recommended set) |
| 16 | + |
| 17 | +// "no-extra-parens": "error", |
| 18 | +// "no-unexpected-multiline": "error", |
| 19 | + |
| 20 | +// All JSDoc comments must be valid |
| 21 | + |
| 22 | +// "valid-jsdoc": [ "error", { |
| 23 | +// "requireReturn": false, |
| 24 | +// "requireReturnDescription": false, |
| 25 | +// "requireParamDescription": true, |
| 26 | +// "prefer": { |
| 27 | +// "return": "returns" |
| 28 | +// } |
| 29 | +// }], |
| 30 | + |
| 31 | +// Best Practices |
| 32 | + |
| 33 | +// Allowed a getter without setter, but all setters require getters |
| 34 | + |
| 35 | +// "accessor-pairs": [ "error", { |
| 36 | +// "getWithoutSet": false, |
| 37 | +// "setWithoutGet": true |
| 38 | +// }], |
| 39 | +// "block-scoped-var": "warn", |
| 40 | +// "consistent-return": "error", |
| 41 | +// "curly": "error", |
| 42 | +// "default-case": "warn", |
| 43 | + |
| 44 | +// the dot goes with the property when doing multiline |
| 45 | + |
| 46 | +// "dot-location": [ "warn", "property" ], |
| 47 | +// "dot-notation": "warn", |
| 48 | +// "eqeqeq": [ "error", "smart" ], |
| 49 | +// "guard-for-in": "warn", |
| 50 | +// "no-alert": "error", |
| 51 | +// "no-caller": "error", |
| 52 | +// "no-case-declarations": "warn", |
| 53 | +// "no-div-regex": "warn", |
| 54 | +// "no-else-return": "warn", |
| 55 | +// "no-empty-label": "warn", |
| 56 | +// "no-empty-pattern": "warn", |
| 57 | +// "no-eq-null": "warn", |
| 58 | +// "no-eval": "error", |
| 59 | +// "no-extend-native": "error", |
| 60 | +// "no-extra-bind": "warn", |
| 61 | +// "no-floating-decimal": "warn", |
| 62 | +// "no-implicit-coercion": [ "warn", { |
| 63 | +// "boolean": true, |
| 64 | +// "number": true, |
| 65 | +// "string": true |
| 66 | +// }], |
| 67 | +// "no-implied-eval": "error", |
| 68 | +// "no-invalid-this": "error", |
| 69 | +// "no-iterator": "error", |
| 70 | +// "no-labels": "warn", |
| 71 | +// "no-lone-blocks": "warn", |
| 72 | +// "no-loop-func": "error", |
| 73 | +// "no-magic-numbers": "warn", |
| 74 | +// "no-multi-spaces": "error", |
| 75 | +// "no-multi-str": "warn", |
| 76 | +// "no-native-reassign": "error", |
| 77 | +// "no-new-func": "error", |
| 78 | +// "no-new-wrappers": "error", |
| 79 | +// "no-new": "error", |
| 80 | +// "no-octal-escape": "error", |
| 81 | +// "no-param-reassign": "error", |
| 82 | +// "no-process-env": "warn", |
| 83 | +// "no-proto": "error", |
| 84 | +// "no-redeclare": "error", |
| 85 | +// "no-return-assign": "error", |
| 86 | +// "no-script-url": "error", |
| 87 | +// "no-self-compare": "error", |
| 88 | +// "no-throw-literal": "error", |
| 89 | +// "no-unused-expressions": "error", |
| 90 | +// "no-useless-call": "error", |
| 91 | +// "no-useless-concat": "error", |
| 92 | +// "no-void": "warn", |
| 93 | + |
| 94 | +// Produce warnings when something is commented as TODO or FIXME |
| 95 | + |
| 96 | +// "no-warning-comments": [ "warn", { |
| 97 | +// "terms": [ "TODO", "FIXME" ], |
| 98 | +// "location": "start" |
| 99 | +// }], |
| 100 | +// "no-with": "warn", |
| 101 | +// "radix": "warn", |
| 102 | +// "vars-on-top": "error", |
| 103 | + |
| 104 | +// Enforces the style of wrapped functions |
| 105 | +// "wrap-iife": [ "error", "outside" ], |
| 106 | +// "yoda": "error", |
| 107 | + |
| 108 | +// Strict Mode - for ES6, never use strict. |
| 109 | +// "strict": [ "error", "never" ], |
| 110 | + |
| 111 | +// Variables |
| 112 | + |
| 113 | +// "init-declarations": [ "error", "always" ], |
| 114 | +// "no-catch-shadow": "warn", |
| 115 | +// "no-delete-var": "error", |
| 116 | +// "no-label-var": "error", |
| 117 | +// "no-shadow-restricted-names": "error", |
| 118 | +// "no-shadow": "warn", |
| 119 | + |
| 120 | +// We require all vars to be initialized (see init-declarations) |
| 121 | +// If we NEED a var to be initialized to undefined, it needs to be explicit |
| 122 | + |
| 123 | +"no-undef-init":"off", |
| 124 | +"no-undef":"error", |
| 125 | +"no-undefined":"off", |
| 126 | +"no-unused-vars":"warn", |
| 127 | + |
| 128 | +// Disallow hoisting - let & const don't allow hoisting anyhow |
| 129 | + |
| 130 | +// "no-use-before-define": "error", |
| 131 | + |
| 132 | +// Node.js and CommonJS |
| 133 | + |
| 134 | +// "callback-return": [ "warn", [ "callback", "next" ]], |
| 135 | +// "global-require": "error", |
| 136 | +// "handle-callback-err": "warn", |
| 137 | +// "no-mixed-requires": "warn", |
| 138 | +// "no-new-require": "error", |
| 139 | + |
| 140 | +// Use path.concat instead |
| 141 | + |
| 142 | +// "no-path-concat": "error", |
| 143 | +// "no-process-exit": "error", |
| 144 | +// "no-restricted-modules": "off", |
| 145 | +// "no-sync": "warn", |
| 146 | + |
| 147 | +// ECMAScript 6 support |
| 148 | + |
| 149 | +// "arrow-body-style": [ "error", "always" ], |
| 150 | +// "arrow-parens": [ "error", "always" ], |
| 151 | +// "arrow-spacing": [ "error", { "before": true, "after": true }], |
| 152 | +// "constructor-super": "error", |
| 153 | +// "generator-star-spacing": [ "error", "before" ], |
| 154 | +// "no-arrow-condition": "error", |
| 155 | +// "no-class-assign": "error", |
| 156 | +// "no-const-assign": "error", |
| 157 | +// "no-dupe-class-members": "error", |
| 158 | +// "no-this-before-super": "error", |
| 159 | +// "no-var": "warn", |
| 160 | +"object-shorthand": ["warn" ] |
| 161 | +// "prefer-arrow-callback": "warn", |
| 162 | +// "prefer-spread": "warn", |
| 163 | +// "prefer-template": "warn", |
| 164 | +// "require-yield": "error", |
| 165 | + |
| 166 | +// Stylistic - everything here is a warning because of style. |
| 167 | + |
| 168 | +// "array-bracket-spacing": [ "warn", "always" ], |
| 169 | +// "block-spacing": [ "warn", "always" ], |
| 170 | +// "brace-style": [ "warn", "1tbs", { "allowSingleLine": false } ], |
| 171 | +// "camelcase": "warn", |
| 172 | +// "comma-spacing": [ "warn", { "before": false, "after": true } ], |
| 173 | +// "comma-style": [ "warn", "last" ], |
| 174 | +// "computed-property-spacing": [ "warn", "never" ], |
| 175 | +// "consistent-this": [ "warn", "self" ], |
| 176 | +// "eol-last": "warn", |
| 177 | +// "func-names": "warn", |
| 178 | +// "func-style": [ "warn", "declaration" ], |
| 179 | +// "id-length": [ "warn", { "min": 2, "max": 32 } ], |
| 180 | +// "indent": [ "warn", 4 ], |
| 181 | +// "jsx-quotes": [ "warn", "prefer-double" ], |
| 182 | +// "linebreak-style": [ "warn", "unix" ], |
| 183 | +// "lines-around-comment": [ "warn", { "beforeBlockComment": true } ], |
| 184 | +// "max-depth": [ "warn", 8 ], |
| 185 | +// "max-len": [ "warn", 132 ], |
| 186 | +// "max-nested-callbacks": [ "warn", 8 ], |
| 187 | +// "max-params": [ "warn", 8 ], |
| 188 | +// "new-cap": "warn", |
| 189 | +// "new-parens": "warn", |
| 190 | +// "no-array-constructor": "warn", |
| 191 | +// "no-bitwise": "off", |
| 192 | +// "no-continue": "off", |
| 193 | +// "no-inline-comments": "off", |
| 194 | +// "no-lonely-if": "warn", |
| 195 | +// "no-mixed-spaces-and-tabs": "warn", |
| 196 | +// "no-multiple-empty-lines": "warn", |
| 197 | +// "no-negated-condition": "off", |
| 198 | +// "no-nested-ternary": "warn", |
| 199 | +// "no-new-object": "warn", |
| 200 | +// "no-plusplus": "off", |
| 201 | +// "no-spaced-func": "warn", |
| 202 | +// "no-ternary": "off", |
| 203 | +// "no-trailing-spaces": "warn", |
| 204 | +// "no-underscore-dangle": "warn", |
| 205 | +// "no-unneeded-ternary": "warn", |
| 206 | +// "object-curly-spacing": [ "warn", "always" ], |
| 207 | +// "one-var": "off", |
| 208 | +// "operator-assignment": [ "warn", "never" ], |
| 209 | +// "operator-linebreak": [ "warn", "after" ], |
| 210 | +// "padded-blocks": [ "warn", "never" ], |
| 211 | +// "quote-props": [ "warn", "consistent-as-needed" ], |
| 212 | +// "quotes": [ "warn", "single" ], |
| 213 | +// "require-jsdoc": [ "warn", { |
| 214 | +// "require": { |
| 215 | +// "FunctionDeclaration": true, |
| 216 | +// "MethodDefinition": true, |
| 217 | +// "ClassDeclaration": false |
| 218 | +// } |
| 219 | +// }], |
| 220 | +// "semi-spacing": [ "warn", { "before": false, "after": true }], |
| 221 | +// "semi": [ "error", "always" ], |
| 222 | +// "sort-vars": "off", |
| 223 | +// "space-after-keywords": [ "warn", "always" ], |
| 224 | +// "space-before-blocks": [ "warn", "always" ], |
| 225 | +// "space-before-function-paren": [ "warn", "never" ], |
| 226 | +// "space-before-keywords": [ "warn", "always" ], |
| 227 | +// "space-in-parens": [ "warn", "never" ], |
| 228 | +// "space-infix-ops": [ "warn", { "int32Hint": true } ], |
| 229 | +// "space-return-throw-case": "error", |
| 230 | +// "space-unary-ops": "error", |
| 231 | +// "spaced-comment": [ "warn", "always" ], |
| 232 | +// "wrap-regex": "warn" |
| 233 | + } |
| 234 | +} |