|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + es6: true, |
| 4 | + node: true |
| 5 | + }, |
| 6 | + ignorePatterns: ['.eslintrc.js', 'jest.config.js'], |
| 7 | + extends: [ |
| 8 | + 'plugin:@typescript-eslint/recommended', |
| 9 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 10 | + 'prettier' |
| 11 | + ], |
| 12 | + parser: '@typescript-eslint/parser', |
| 13 | + parserOptions: { |
| 14 | + project: ['tsconfig.json', 'test/tsconfig.json'], |
| 15 | + sourceType: 'module' |
| 16 | + }, |
| 17 | + plugins: ['eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', '@typescript-eslint'], |
| 18 | + root: true, |
| 19 | + rules: { |
| 20 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 21 | + '@typescript-eslint/array-type': [ |
| 22 | + 'error', |
| 23 | + { |
| 24 | + default: 'generic' |
| 25 | + } |
| 26 | + ], |
| 27 | + '@typescript-eslint/ban-types': 'off', |
| 28 | + '@typescript-eslint/consistent-type-assertions': 'error', |
| 29 | + '@typescript-eslint/dot-notation': 'off', |
| 30 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 31 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 32 | + '@typescript-eslint/indent': 'off', |
| 33 | + '@typescript-eslint/member-delimiter-style': [ |
| 34 | + 'error', |
| 35 | + { |
| 36 | + multiline: { |
| 37 | + delimiter: 'semi', |
| 38 | + requireLast: true |
| 39 | + }, |
| 40 | + singleline: { |
| 41 | + delimiter: 'semi', |
| 42 | + requireLast: false |
| 43 | + } |
| 44 | + } |
| 45 | + ], |
| 46 | + '@typescript-eslint/naming-convention': [ |
| 47 | + 'off', |
| 48 | + { |
| 49 | + selector: 'variable', |
| 50 | + format: ['camelCase', 'UPPER_CASE', 'PascalCase'], |
| 51 | + leadingUnderscore: 'allow', |
| 52 | + trailingUnderscore: 'forbid' |
| 53 | + } |
| 54 | + ], |
| 55 | + '@typescript-eslint/no-empty-function': 'error', |
| 56 | + '@typescript-eslint/no-empty-interface': 'error', |
| 57 | + '@typescript-eslint/no-explicit-any': 'off', |
| 58 | + '@typescript-eslint/no-misused-new': 'error', |
| 59 | + '@typescript-eslint/no-namespace': 'error', |
| 60 | + '@typescript-eslint/no-parameter-properties': 'off', |
| 61 | + '@typescript-eslint/no-shadow': [ |
| 62 | + 'error', |
| 63 | + { |
| 64 | + hoist: 'all' |
| 65 | + } |
| 66 | + ], |
| 67 | + '@typescript-eslint/no-unused-expressions': 'error', |
| 68 | + '@typescript-eslint/no-use-before-define': 'off', |
| 69 | + '@typescript-eslint/no-var-requires': 'off', |
| 70 | + '@typescript-eslint/prefer-for-of': 'error', |
| 71 | + '@typescript-eslint/prefer-function-type': 'error', |
| 72 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 73 | + '@typescript-eslint/semi': ['error', 'always'], |
| 74 | + '@typescript-eslint/triple-slash-reference': [ |
| 75 | + 'error', |
| 76 | + { |
| 77 | + path: 'always', |
| 78 | + types: 'prefer-import', |
| 79 | + lib: 'always' |
| 80 | + } |
| 81 | + ], |
| 82 | + '@typescript-eslint/type-annotation-spacing': 'off', |
| 83 | + '@typescript-eslint/typedef': 'off', |
| 84 | + '@typescript-eslint/unified-signatures': 'error', |
| 85 | + 'arrow-parens': ['off', 'always'], |
| 86 | + 'brace-style': ['off', 'off'], |
| 87 | + 'comma-dangle': 'off', |
| 88 | + complexity: 'off', |
| 89 | + 'constructor-super': 'error', |
| 90 | + 'dot-notation': 'off', |
| 91 | + 'eol-last': 'off', |
| 92 | + eqeqeq: ['error', 'smart'], |
| 93 | + 'guard-for-in': 'error', |
| 94 | + 'id-denylist': [ |
| 95 | + 'error', |
| 96 | + 'any', |
| 97 | + 'Number', |
| 98 | + 'number', |
| 99 | + 'String', |
| 100 | + 'string', |
| 101 | + 'Boolean', |
| 102 | + 'boolean', |
| 103 | + 'Undefined', |
| 104 | + 'undefined' |
| 105 | + ], |
| 106 | + 'id-match': 'error', |
| 107 | + indent: 'off', |
| 108 | + 'jsdoc/check-alignment': 'error', |
| 109 | + 'jsdoc/check-indentation': 'error', |
| 110 | + // "jsdoc/newline-after-description": "error", |
| 111 | + 'linebreak-style': 'off', |
| 112 | + 'max-classes-per-file': 'off', |
| 113 | + 'max-len': 'off', |
| 114 | + 'new-parens': 'off', |
| 115 | + 'newline-per-chained-call': 'off', |
| 116 | + 'no-bitwise': 'error', |
| 117 | + 'no-caller': 'error', |
| 118 | + 'no-cond-assign': 'error', |
| 119 | + 'no-console': [ |
| 120 | + 'error', |
| 121 | + { |
| 122 | + allow: [ |
| 123 | + 'warn', |
| 124 | + 'dir', |
| 125 | + 'time', |
| 126 | + 'timeEnd', |
| 127 | + 'timeLog', |
| 128 | + 'trace', |
| 129 | + 'assert', |
| 130 | + 'clear', |
| 131 | + 'count', |
| 132 | + 'countReset', |
| 133 | + 'group', |
| 134 | + 'groupEnd', |
| 135 | + 'table', |
| 136 | + 'debug', |
| 137 | + 'info', |
| 138 | + 'dirxml', |
| 139 | + 'groupCollapsed', |
| 140 | + 'Console', |
| 141 | + 'profile', |
| 142 | + 'profileEnd', |
| 143 | + 'timeStamp', |
| 144 | + 'context', |
| 145 | + 'createTask' |
| 146 | + ] |
| 147 | + } |
| 148 | + ], |
| 149 | + 'no-debugger': 'error', |
| 150 | + 'no-empty': 'error', |
| 151 | + 'no-empty-function': 'off', |
| 152 | + 'no-eval': 'error', |
| 153 | + 'no-extra-semi': 'off', |
| 154 | + 'no-fallthrough': 'off', |
| 155 | + 'no-invalid-this': 'off', |
| 156 | + 'no-irregular-whitespace': 'off', |
| 157 | + 'no-multiple-empty-lines': 'off', |
| 158 | + 'no-new-wrappers': 'error', |
| 159 | + 'no-shadow': 'off', |
| 160 | + 'no-throw-literal': 'error', |
| 161 | + 'no-trailing-spaces': 'off', |
| 162 | + 'no-undef-init': 'error', |
| 163 | + 'no-underscore-dangle': 'off', |
| 164 | + 'no-unsafe-finally': 'error', |
| 165 | + 'no-unused-expressions': 'off', |
| 166 | + 'no-unused-labels': 'error', |
| 167 | + 'no-use-before-define': 'off', |
| 168 | + 'no-var': 'error', |
| 169 | + 'object-shorthand': ['error', 'never'], |
| 170 | + 'one-var': ['error', 'never'], |
| 171 | + 'padded-blocks': [ |
| 172 | + 'off', |
| 173 | + { |
| 174 | + blocks: 'never' |
| 175 | + }, |
| 176 | + { |
| 177 | + allowSingleLineBlocks: true |
| 178 | + } |
| 179 | + ], |
| 180 | + 'prefer-arrow/prefer-arrow-functions': [ |
| 181 | + 'error', |
| 182 | + { |
| 183 | + allowStandaloneDeclarations: true |
| 184 | + } |
| 185 | + ], |
| 186 | + 'prefer-const': 'error', |
| 187 | + 'quote-props': 'off', |
| 188 | + radix: 'error', |
| 189 | + 'react/jsx-curly-spacing': 'off', |
| 190 | + 'react/jsx-equals-spacing': 'off', |
| 191 | + 'react/jsx-tag-spacing': [ |
| 192 | + 'off', |
| 193 | + { |
| 194 | + afterOpening: 'allow', |
| 195 | + closingSlash: 'allow' |
| 196 | + } |
| 197 | + ], |
| 198 | + 'react/jsx-wrap-multilines': 'off', |
| 199 | + semi: 'off', |
| 200 | + 'space-before-function-paren': 'off', |
| 201 | + 'space-in-parens': ['off', 'never'], |
| 202 | + 'spaced-comment': [ |
| 203 | + 'error', |
| 204 | + 'always', |
| 205 | + { |
| 206 | + markers: ['/'] |
| 207 | + } |
| 208 | + ], |
| 209 | + 'use-isnan': 'error', |
| 210 | + 'valid-typeof': 'off', |
| 211 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 212 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 213 | + 'constructor-super': 'off', |
| 214 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 215 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 216 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 217 | + '@typescript-eslint/unbound-method': 'off', |
| 218 | + '@typescript-eslint/no-unused-vars': [ |
| 219 | + 'error', |
| 220 | + { |
| 221 | + argsIgnorePattern: '^_', |
| 222 | + varsIgnorePattern: '^_' |
| 223 | + } |
| 224 | + ] |
| 225 | + } |
| 226 | +}; |
0 commit comments