|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + es6: true, |
| 4 | + node: true, |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + "eslint:recommended", |
| 8 | + ], |
| 9 | + parser: "@typescript-eslint/parser", |
| 10 | + parserOptions: { |
| 11 | + project: [ |
| 12 | + "tsconfig.json", |
| 13 | + ], |
| 14 | + tsconfigRootDir: __dirname, |
| 15 | + }, |
| 16 | + plugins: [ |
| 17 | + "@typescript-eslint", |
| 18 | + ], |
| 19 | + reportUnusedDisableDirectives: true, |
| 20 | + rules: { |
| 21 | + "@typescript-eslint/adjacent-overload-signatures": "warn", |
| 22 | + "@typescript-eslint/array-type": [ |
| 23 | + "warn", |
| 24 | + { |
| 25 | + default: "array-simple", |
| 26 | + readonly: "generic" |
| 27 | + }, |
| 28 | + ], |
| 29 | + "@typescript-eslint/ban-ts-comment": "warn", |
| 30 | + "@typescript-eslint/ban-types": [ |
| 31 | + "warn", |
| 32 | + { |
| 33 | + "types": { |
| 34 | + "{}": false, |
| 35 | + }, |
| 36 | + extendDefaults: true, |
| 37 | + } |
| 38 | + ], |
| 39 | + "@typescript-eslint/consistent-type-assertions": "off", // * |
| 40 | + "@typescript-eslint/consistent-type-definitions": "off", |
| 41 | + "@typescript-eslint/dot-notation": "warn", |
| 42 | + "@typescript-eslint/explicit-member-accessibility": [ |
| 43 | + "warn", |
| 44 | + { |
| 45 | + accessibility: "no-public", |
| 46 | + }, |
| 47 | + ], |
| 48 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 49 | + "@typescript-eslint/indent": "off", |
| 50 | + "@typescript-eslint/interface-name-prefix": "off", |
| 51 | + "@typescript-eslint/member-delimiter-style": [ |
| 52 | + "warn", |
| 53 | + { |
| 54 | + multiline: { |
| 55 | + delimiter: "semi", |
| 56 | + requireLast: true, |
| 57 | + }, |
| 58 | + singleline: { |
| 59 | + delimiter: "comma", |
| 60 | + requireLast: false, |
| 61 | + }, |
| 62 | + }, |
| 63 | + ], |
| 64 | + "@typescript-eslint/no-empty-function": "warn", |
| 65 | + "@typescript-eslint/no-empty-interface": "warn", |
| 66 | + "@typescript-eslint/no-explicit-any": "off", // we might want this on |
| 67 | + "@typescript-eslint/no-floating-promises": "off", |
| 68 | + "@typescript-eslint/no-implied-eval": "warn", |
| 69 | + "@typescript-eslint/no-inferrable-types": "off", // * |
| 70 | + "@typescript-eslint/no-misused-new": "warn", |
| 71 | + "@typescript-eslint/no-misused-promises": "warn", |
| 72 | + "@typescript-eslint/no-namespace": "warn", |
| 73 | + "@typescript-eslint/no-parameter-properties": "off", |
| 74 | + "@typescript-eslint/no-redeclare": "warn", |
| 75 | + "@typescript-eslint/no-require-imports": "warn", |
| 76 | + "@typescript-eslint/no-shadow": [ |
| 77 | + "warn", |
| 78 | + { |
| 79 | + ignoreTypeValueShadow: true, |
| 80 | + } |
| 81 | + ], |
| 82 | + "@typescript-eslint/no-this-alias": "warn", |
| 83 | + "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off", // * was error |
| 84 | + "@typescript-eslint/no-unnecessary-type-arguments": "warn", |
| 85 | + "@typescript-eslint/no-unnecessary-type-assertion": "warn", |
| 86 | + "@typescript-eslint/no-unsafe-assignment": "warn", |
| 87 | + "@typescript-eslint/no-unsafe-call": "warn", |
| 88 | + "@typescript-eslint/no-unsafe-member-access": "off", // Would be nice to be able to turn on |
| 89 | + "@typescript-eslint/no-unsafe-return": "off", // Would be nice to be able to turn on |
| 90 | + "@typescript-eslint/no-unused-expressions": [ |
| 91 | + "warn", |
| 92 | + { |
| 93 | + "allowShortCircuit": true, |
| 94 | + "allowTernary": true, |
| 95 | + "allowTaggedTemplates": true |
| 96 | + } |
| 97 | + ], |
| 98 | + "@typescript-eslint/no-unused-vars": "warn", |
| 99 | + "@typescript-eslint/no-use-before-define": "off", |
| 100 | + "@typescript-eslint/no-var-requires": "warn", |
| 101 | + "@typescript-eslint/prefer-for-of": "warn", |
| 102 | + "@typescript-eslint/prefer-function-type": "warn", |
| 103 | + "@typescript-eslint/prefer-namespace-keyword": "warn", |
| 104 | + "@typescript-eslint/prefer-readonly": "warn", |
| 105 | + "@typescript-eslint/prefer-regexp-exec": "warn", |
| 106 | + "@typescript-eslint/restrict-template-expressions": "off", |
| 107 | + "@typescript-eslint/restrict-plus-operands": "warn", |
| 108 | + "@typescript-eslint/semi": ["warn"], |
| 109 | + "@typescript-eslint/strict-boolean-expressions": "off", // * |
| 110 | + "@typescript-eslint/triple-slash-reference": [ |
| 111 | + "warn", |
| 112 | + { |
| 113 | + path: "always", |
| 114 | + types: "prefer-import", |
| 115 | + lib: "always", |
| 116 | + }, |
| 117 | + ], |
| 118 | + "@typescript-eslint/typedef": [ |
| 119 | + "warn", |
| 120 | + { |
| 121 | + "parameter": true, |
| 122 | + "propertyDeclaration": true, |
| 123 | + } |
| 124 | + ], |
| 125 | + "@typescript-eslint/unbound-method": "off", // * |
| 126 | + "@typescript-eslint/unified-signatures": "warn", |
| 127 | + "arrow-parens": ["off", "always"], |
| 128 | + "camelcase": "warn", |
| 129 | + "comma-dangle": "off", |
| 130 | + "comma-spacing": "warn", |
| 131 | + "complexity": "off", |
| 132 | + "constructor-super": "warn", |
| 133 | + "eol-last": "off", |
| 134 | + "eqeqeq": ["warn", "smart"], |
| 135 | + "guard-for-in": "warn", |
| 136 | + "id-blacklist": [ |
| 137 | + "warn", |
| 138 | + "any", |
| 139 | + "Number", |
| 140 | + "number", |
| 141 | + "String", |
| 142 | + "string", |
| 143 | + "Boolean", |
| 144 | + "boolean", |
| 145 | + "Undefined", |
| 146 | + "undefined", |
| 147 | + ], |
| 148 | + "id-match": "warn", |
| 149 | + "import/order": "off", |
| 150 | + "max-classes-per-file": "off", |
| 151 | + "max-len": "off", |
| 152 | + "new-parens": "warn", |
| 153 | + "no-bitwise": "warn", |
| 154 | + "no-caller": "warn", |
| 155 | + "no-cond-assign": "warn", |
| 156 | + "no-console": "warn", |
| 157 | + "no-debugger": "warn", |
| 158 | + "no-duplicate-imports": "warn", |
| 159 | + "no-empty": "warn", |
| 160 | + "no-eval": "warn", |
| 161 | + "no-extra-bind": "warn", |
| 162 | + "no-extra-boolean-cast": "warn", |
| 163 | + "no-case-declarations": "warn", |
| 164 | + "no-constant-condition": "warn", |
| 165 | + "no-fallthrough": "off", // Handled by tsconfig option |
| 166 | + "no-invalid-this": "off", // * was warn |
| 167 | + "no-irregular-whitespace": "warn", |
| 168 | + "no-multiple-empty-lines": "off", |
| 169 | + "no-new-wrappers": "warn", |
| 170 | + "no-prototype-builtins": "warn", |
| 171 | + "no-redeclare": "off", // Handled by @typescript-eslint/no-redeclare |
| 172 | + "no-shadow": "off", // Handled by @typescript-eslint/no-shadow |
| 173 | + "no-throw-literal": "warn", |
| 174 | + "no-trailing-spaces": "warn", |
| 175 | + "no-undef-init": "warn", |
| 176 | + "no-underscore-dangle": "off", // * was warn |
| 177 | + "no-unexpected-multiline": "warn", |
| 178 | + "no-unused-expressions": "off", // Disabled because of @typescript-eslint/no-unused-expressions |
| 179 | + "no-unsafe-finally": "warn", |
| 180 | + "no-unsafe-optional-chaining": "warn", |
| 181 | + "no-unused-labels": "warn", |
| 182 | + "no-unused-vars": "off", // Disabled because of @typescript-eslint/no-unused-vars |
| 183 | + "no-useless-escape": "warn", |
| 184 | + "no-var": "warn", |
| 185 | + "no-void": ["warn", { "allowAsStatement": true }], |
| 186 | + "object-shorthand": "off", |
| 187 | + "one-var": ["off", "never"], |
| 188 | + "prefer-arrow/prefer-arrow-functions": "off", |
| 189 | + "prefer-const": "warn", |
| 190 | + "quotes": ["warn", "single", { "avoidEscape": true, "allowTemplateLiterals": true }], |
| 191 | + "quote-props": "off", |
| 192 | + "radix": "off", |
| 193 | + "sort-imports": "warn", |
| 194 | + "spaced-comment": ["warn", "always", { "exceptions": ["*-"], "markers": ["/"] }], |
| 195 | + "use-isnan": "warn", |
| 196 | + "valid-typeof": ["warn", { "requireStringLiterals": true }] |
| 197 | + } |
| 198 | +}; |
| 199 | + |
| 200 | + |
0 commit comments