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