|
1 | 1 | module.exports = { |
2 | 2 | env: { |
3 | 3 | node: true, |
| 4 | + es6: true, |
| 5 | + 'jest/globals': true, |
4 | 6 | }, |
5 | | - extends: 'eslint:recommended', |
| 7 | + extends: [ |
| 8 | + 'eslint:recommended', |
| 9 | + 'plugin:@typescript-eslint/recommended', |
| 10 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 11 | + 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier |
| 12 | + 'plugin:jest/recommended', |
| 13 | + 'plugin:prettier/recommended' |
| 14 | + ], |
| 15 | + parser: '@typescript-eslint/parser', |
6 | 16 | parserOptions: { |
| 17 | + project: 'tsconfig.json', |
7 | 18 | ecmaVersion: 2020, |
8 | 19 | sourceType: 'module', |
9 | 20 | impliedStrict: true, |
10 | 21 | ecmaFeatures: { |
11 | 22 | jsx: true, |
12 | 23 | }, |
13 | 24 | }, |
| 25 | + plugins: ['@typescript-eslint', 'jest', 'jsdoc'], |
14 | 26 | rules: { |
15 | | - 'no-console': ['error', { allow: ['warn', 'error', 'log'] }], |
16 | | - indent: ['error', 2], |
17 | | - 'linebreak-style': ['error', 'unix'], |
18 | | - quotes: ['error', 'single'], |
19 | | - semi: ['error', 'never'], |
20 | | - 'comma-dangle': [ |
| 27 | + 'prettier/prettier': 'error', |
| 28 | + 'no-unused-vars': 'off', // let typescript-eslint handle this |
| 29 | + 'no-console': 'error', |
| 30 | + 'linebreak-style': 'off', |
| 31 | + 'comma-dangle': 'off', |
| 32 | + 'constructor-super': 'error', |
| 33 | + 'for-direction': ['error'], |
| 34 | + 'getter-return': 'warn', |
| 35 | + 'no-async-promise-executor': ['error'], |
| 36 | + 'no-case-declarations': ['error'], |
| 37 | + 'no-class-assign': ['error'], |
| 38 | + 'no-compare-neg-zero': ['error'], |
| 39 | + 'no-cond-assign': 'error', |
| 40 | + 'no-const-assign': ['error'], |
| 41 | + 'no-constant-condition': ['warn'], |
| 42 | + 'no-control-regex': ['warn'], |
| 43 | + 'no-debugger': 'error', |
| 44 | + 'no-delete-var': ['error'], |
| 45 | + 'no-dupe-args': ['error'], |
| 46 | + 'no-dupe-class-members': 'warn', |
| 47 | + 'no-dupe-keys': ['error'], |
| 48 | + 'no-duplicate-case': ['error'], |
| 49 | + 'no-empty': [ |
21 | 50 | 'error', |
22 | 51 | { |
23 | | - arrays: 'always-multiline', |
24 | | - objects: 'always-multiline', |
25 | | - imports: 'always-multiline', |
26 | | - exports: 'always-multiline', |
27 | | - functions: 'never', |
| 52 | + allowEmptyCatch: true, |
| 53 | + }, |
| 54 | + ], |
| 55 | + 'no-empty-character-class': ['error'], |
| 56 | + 'no-empty-pattern': ['error'], |
| 57 | + 'no-ex-assign': ['error'], |
| 58 | + 'no-extra-boolean-cast': ['error'], |
| 59 | + 'no-extra-semi': 'off', |
| 60 | + 'no-fallthrough': 'off', |
| 61 | + 'no-func-assign': ['error'], |
| 62 | + 'no-global-assign': ['error'], |
| 63 | + 'no-inner-declarations': ['error'], |
| 64 | + 'no-invalid-regexp': ['error'], |
| 65 | + 'no-irregular-whitespace': 'off', |
| 66 | + 'no-misleading-character-class': ['error'], |
| 67 | + 'no-mixed-spaces-and-tabs': ['error'], |
| 68 | + 'no-new-symbol': ['error'], |
| 69 | + 'no-obj-calls': ['error'], |
| 70 | + 'no-octal': ['error'], |
| 71 | + 'no-prototype-builtins': ['error'], |
| 72 | + 'no-redeclare': 'warn', |
| 73 | + 'no-regex-spaces': ['error'], |
| 74 | + 'no-self-assign': ['error'], |
| 75 | + 'no-shadow-restricted-names': ['error'], |
| 76 | + 'no-sparse-arrays': ['error'], |
| 77 | + 'no-this-before-super': ['error'], |
| 78 | + 'no-undef': ['error'], |
| 79 | + 'no-unexpected-multiline': ['error'], |
| 80 | + 'no-unreachable': ['error'], |
| 81 | + 'no-unsafe-finally': 'error', |
| 82 | + 'no-unsafe-negation': ['error'], |
| 83 | + 'no-unused-labels': 'error', |
| 84 | + 'no-useless-catch': ['error'], |
| 85 | + 'no-useless-escape': 'warn', |
| 86 | + 'no-with': ['error'], |
| 87 | + 'require-yield': ['error'], |
| 88 | + 'use-isnan': 'error', |
| 89 | + 'valid-typeof': 'off', |
| 90 | + '@typescript-eslint/no-unused-vars': ["error", { "argsIgnorePattern": "^_" }], |
| 91 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 92 | + '@typescript-eslint/array-type': [ |
| 93 | + 'warn', |
| 94 | + { |
| 95 | + default: 'array', |
| 96 | + }, |
| 97 | + ], |
| 98 | + '@typescript-eslint/ban-types': [ |
| 99 | + 'error', |
| 100 | + { |
| 101 | + types: { |
| 102 | + Object: { |
| 103 | + message: 'Avoid using the `Object` type. Did you mean `object`?', |
| 104 | + }, |
| 105 | + Function: { |
| 106 | + message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', |
| 107 | + }, |
| 108 | + Boolean: { |
| 109 | + message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', |
| 110 | + }, |
| 111 | + Number: { |
| 112 | + message: 'Avoid using the `Number` type. Did you mean `number`?', |
| 113 | + }, |
| 114 | + String: { |
| 115 | + message: 'Avoid using the `String` type. Did you mean `string`?', |
| 116 | + }, |
| 117 | + Symbol: { |
| 118 | + message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', |
| 119 | + }, |
| 120 | + }, |
| 121 | + }, |
| 122 | + ], |
| 123 | + '@typescript-eslint/class-name-casing': 'error', |
| 124 | + '@typescript-eslint/prefer-regexp-exec': 'warn', |
| 125 | + '@typescript-eslint/prefer-string-starts-ends-with': 'warn', |
| 126 | + '@typescript-eslint/unbound-method': 'off', |
| 127 | + '@typescript-eslint/prefer-includes': 'warn', |
| 128 | + '@typescript-eslint/consistent-type-assertions': 'error', |
| 129 | + '@typescript-eslint/consistent-type-definitions': 'error', |
| 130 | + '@typescript-eslint/explicit-member-accessibility': [ |
| 131 | + 'error', |
| 132 | + { |
| 133 | + accessibility: 'no-public', |
| 134 | + }, |
| 135 | + ], |
| 136 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 137 | + '@typescript-eslint/member-delimiter-style': [ |
| 138 | + 'error', |
| 139 | + { |
| 140 | + multiline: { |
| 141 | + delimiter: 'none', |
| 142 | + requireLast: true, |
| 143 | + }, |
| 144 | + singleline: { |
| 145 | + delimiter: 'semi', |
| 146 | + requireLast: false, |
| 147 | + }, |
| 148 | + }, |
| 149 | + ], |
| 150 | + '@typescript-eslint/require-await': 'off', |
| 151 | + '@typescript-eslint/ban-ts-ignore': 'off', |
| 152 | + '@typescript-eslint/no-empty-function': ['error', { 'allow': ['arrowFunctions']}], |
| 153 | + '@typescript-eslint/no-empty-interface': 'off', |
| 154 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 155 | + '@typescript-eslint/no-explicit-any': 'off', |
| 156 | + '@typescript-eslint/no-for-in-array': 'error', |
| 157 | + '@typescript-eslint/no-inferrable-types': 'error', |
| 158 | + '@typescript-eslint/no-misused-new': 'error', |
| 159 | + '@typescript-eslint/no-namespace': 'warn', |
| 160 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 161 | + '@typescript-eslint/no-parameter-properties': 'off', |
| 162 | + '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', |
| 163 | + '@typescript-eslint/no-use-before-define': 'off', |
| 164 | + '@typescript-eslint/no-var-requires': 'off', |
| 165 | + '@typescript-eslint/prefer-for-of': 'off', |
| 166 | + '@typescript-eslint/prefer-function-type': 'error', |
| 167 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 168 | + '@typescript-eslint/prefer-readonly': 'error', |
| 169 | + '@typescript-eslint/triple-slash-reference': [ |
| 170 | + 'error', |
| 171 | + { |
| 172 | + path: 'always', |
| 173 | + types: 'prefer-import', |
| 174 | + lib: 'always', |
| 175 | + }, |
| 176 | + ], |
| 177 | + '@typescript-eslint/type-annotation-spacing': 'off', |
| 178 | + '@typescript-eslint/unified-signatures': 'error', |
| 179 | + '@typescript-eslint/no-unnecessary-type-assertion': 'warn', |
| 180 | + 'arrow-body-style': 'warn', |
| 181 | + 'arrow-parens': ['off', 'always'], |
| 182 | + 'brace-style': ['off', 'off'], |
| 183 | + camelcase: 'warn', |
| 184 | + 'class-methods-use-this': 'warn', |
| 185 | + complexity: 'off', |
| 186 | + curly: ['warn', 'multi-line'], |
| 187 | + 'default-case': 'error', |
| 188 | + 'dot-notation': 'error', |
| 189 | + 'eol-last': 'off', |
| 190 | + eqeqeq: ['error', 'smart'], |
| 191 | + 'guard-for-in': 'error', |
| 192 | + 'id-match': 'error', |
| 193 | + 'jsdoc/check-alignment': 'error', |
| 194 | + 'jsdoc/check-indentation': 'error', |
| 195 | + 'jsdoc/newline-after-description': 'warn', |
| 196 | + 'max-classes-per-file': 'off', |
| 197 | + 'max-len': 'off', |
| 198 | + 'new-parens': 'off', |
| 199 | + 'newline-per-chained-call': 'off', |
| 200 | + 'no-bitwise': 'off', |
| 201 | + 'no-caller': 'error', |
| 202 | + 'no-duplicate-imports': 'error', |
| 203 | + 'no-eval': 'error', |
| 204 | + 'no-invalid-this': 'off', |
| 205 | + 'no-multiple-empty-lines': 'off', |
| 206 | + 'no-new-wrappers': 'error', |
| 207 | + 'no-return-await': 'error', |
| 208 | + 'no-shadow': [ |
| 209 | + 'off', |
| 210 | + { |
| 211 | + hoist: 'all', |
| 212 | + }, |
| 213 | + ], |
| 214 | + 'no-template-curly-in-string': 'error', |
| 215 | + 'no-throw-literal': 'error', |
| 216 | + 'no-trailing-spaces': 'off', |
| 217 | + 'no-undef-init': 'error', |
| 218 | + 'no-underscore-dangle': 'off', |
| 219 | + 'no-unused-expressions': 'error', |
| 220 | + 'no-var': 'error', |
| 221 | + 'object-shorthand': 'error', |
| 222 | + 'one-var': ['error', 'never'], |
| 223 | + 'prefer-const': 'warn', |
| 224 | + 'prefer-object-spread': 'error', |
| 225 | + 'prefer-template': 'error', |
| 226 | + 'quote-props': 'off', |
| 227 | + radix: 'error', |
| 228 | + 'space-before-function-paren': 'off', |
| 229 | + 'space-in-parens': ['off', 'never'], |
| 230 | + 'spaced-comment': [ |
| 231 | + 'warn', |
| 232 | + 'always', |
| 233 | + { |
| 234 | + markers: ['/'], |
28 | 235 | }, |
29 | 236 | ], |
30 | 237 | }, |
| 238 | + settings: {}, |
31 | 239 | } |
0 commit comments