|
| 1 | +/* |
| 2 | +👋 Hi! This file was autogenerated by tslint-to-eslint-config. |
| 3 | +https://github.com/typescript-eslint/tslint-to-eslint-config |
| 4 | +
|
| 5 | +It represents the closest reasonable ESLint configuration to this |
| 6 | +project's original TSLint configuration. |
| 7 | +
|
| 8 | +We recommend eventually switching this configuration to extend from |
| 9 | +the recommended rulesets in typescript-eslint. |
| 10 | +https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md |
| 11 | +
|
| 12 | +Happy linting! 💖 |
| 13 | +*/ |
| 14 | +module.exports = { |
| 15 | + env: { |
| 16 | + browser: true, |
| 17 | + }, |
| 18 | + extends: [ |
| 19 | + 'plugin:@typescript-eslint/recommended', |
| 20 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 21 | + 'plugin:react/recommended', |
| 22 | + 'prettier', |
| 23 | + ], |
| 24 | + parser: '@typescript-eslint/parser', |
| 25 | + parserOptions: { |
| 26 | + project: 'tsconfig.json', |
| 27 | + sourceType: 'module', |
| 28 | + }, |
| 29 | + plugins: [ |
| 30 | + 'eslint-plugin-react', |
| 31 | + 'eslint-plugin-jsdoc', |
| 32 | + 'eslint-plugin-prefer-arrow', |
| 33 | + '@typescript-eslint', |
| 34 | + '@typescript-eslint/tslint', |
| 35 | + ], |
| 36 | + root: true, |
| 37 | + rules: { |
| 38 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 39 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 40 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 41 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 42 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 43 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 44 | + '@typescript-eslint/array-type': [ |
| 45 | + 'error', |
| 46 | + { |
| 47 | + default: 'array', |
| 48 | + }, |
| 49 | + ], |
| 50 | + '@typescript-eslint/ban-types': [ |
| 51 | + 'warn', |
| 52 | + { |
| 53 | + types: { |
| 54 | + Object: { |
| 55 | + message: 'Avoid using the `Object` type. Did you mean `object`?', |
| 56 | + }, |
| 57 | + Function: { |
| 58 | + message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', |
| 59 | + }, |
| 60 | + Boolean: { |
| 61 | + message: 'Avoid using the `Boolean` type. Did you mean `boolean`?', |
| 62 | + }, |
| 63 | + Number: { |
| 64 | + message: 'Avoid using the `Number` type. Did you mean `number`?', |
| 65 | + }, |
| 66 | + String: { |
| 67 | + message: 'Avoid using the `String` type. Did you mean `string`?', |
| 68 | + }, |
| 69 | + Symbol: { |
| 70 | + message: 'Avoid using the `Symbol` type. Did you mean `symbol`?', |
| 71 | + }, |
| 72 | + }, |
| 73 | + }, |
| 74 | + ], |
| 75 | + '@typescript-eslint/consistent-type-assertions': 'error', |
| 76 | + '@typescript-eslint/dot-notation': 'error', |
| 77 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 78 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 79 | + '@typescript-eslint/indent': ['warn', 2], |
| 80 | + '@typescript-eslint/member-delimiter-style': [ |
| 81 | + 'error', |
| 82 | + { |
| 83 | + multiline: { |
| 84 | + delimiter: 'semi', |
| 85 | + requireLast: true, |
| 86 | + }, |
| 87 | + singleline: { |
| 88 | + delimiter: 'semi', |
| 89 | + requireLast: false, |
| 90 | + }, |
| 91 | + }, |
| 92 | + ], |
| 93 | + '@typescript-eslint/naming-convention': [ |
| 94 | + 'off', |
| 95 | + { |
| 96 | + selector: 'variable', |
| 97 | + format: ['camelCase', 'UPPER_CASE', 'PascalCase'], |
| 98 | + leadingUnderscore: 'allow', |
| 99 | + trailingUnderscore: 'forbid', |
| 100 | + }, |
| 101 | + ], |
| 102 | + '@typescript-eslint/no-empty-function': 'error', |
| 103 | + '@typescript-eslint/no-empty-interface': 'error', |
| 104 | + '@typescript-eslint/no-explicit-any': 'off', |
| 105 | + '@typescript-eslint/no-misused-new': 'error', |
| 106 | + '@typescript-eslint/no-namespace': 'error', |
| 107 | + '@typescript-eslint/no-parameter-properties': 'off', |
| 108 | + '@typescript-eslint/no-shadow': [ |
| 109 | + 'error', |
| 110 | + { |
| 111 | + hoist: 'all', |
| 112 | + }, |
| 113 | + ], |
| 114 | + '@typescript-eslint/no-unused-expressions': 'error', |
| 115 | + '@typescript-eslint/no-use-before-define': 'off', |
| 116 | + '@typescript-eslint/no-var-requires': 'error', |
| 117 | + '@typescript-eslint/prefer-for-of': 'error', |
| 118 | + '@typescript-eslint/prefer-function-type': 'error', |
| 119 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 120 | + '@typescript-eslint/quotes': [ |
| 121 | + 'error', |
| 122 | + 'single', |
| 123 | + { |
| 124 | + avoidEscape: true, |
| 125 | + }, |
| 126 | + ], |
| 127 | + '@typescript-eslint/require-await': 'error', |
| 128 | + '@typescript-eslint/semi': ['error', 'always'], |
| 129 | + '@typescript-eslint/triple-slash-reference': [ |
| 130 | + 'error', |
| 131 | + { |
| 132 | + path: 'always', |
| 133 | + types: 'prefer-import', |
| 134 | + lib: 'always', |
| 135 | + }, |
| 136 | + ], |
| 137 | + '@typescript-eslint/type-annotation-spacing': 'off', |
| 138 | + '@typescript-eslint/typedef': 'off', |
| 139 | + '@typescript-eslint/unified-signatures': 'error', |
| 140 | + 'arrow-parens': ['error', 'always'], |
| 141 | + 'brace-style': ['off', 'off'], |
| 142 | + 'comma-dangle': 'off', |
| 143 | + complexity: 'off', |
| 144 | + 'constructor-super': 'error', |
| 145 | + curly: 'error', |
| 146 | + 'dot-notation': 'off', |
| 147 | + 'eol-last': 'off', |
| 148 | + eqeqeq: ['error', 'always'], |
| 149 | + 'guard-for-in': 'error', |
| 150 | + 'id-denylist': [ |
| 151 | + 'error', |
| 152 | + 'any', |
| 153 | + 'Number', |
| 154 | + 'number', |
| 155 | + 'String', |
| 156 | + 'string', |
| 157 | + 'Boolean', |
| 158 | + 'boolean', |
| 159 | + 'Undefined', |
| 160 | + 'undefined', |
| 161 | + ], |
| 162 | + 'id-match': 'error', |
| 163 | + indent: 'off', |
| 164 | + 'jsdoc/check-alignment': 'error', |
| 165 | + 'jsdoc/check-indentation': 'off', |
| 166 | + 'jsdoc/newline-after-description': 'off', |
| 167 | + 'linebreak-style': ['error', 'unix'], |
| 168 | + 'max-classes-per-file': ['error', 1], |
| 169 | + 'max-len': 'off', |
| 170 | + 'new-parens': 'error', |
| 171 | + 'newline-per-chained-call': 'off', |
| 172 | + 'no-bitwise': 'error', |
| 173 | + 'no-caller': 'error', |
| 174 | + 'no-cond-assign': 'error', |
| 175 | + 'no-console': [ |
| 176 | + 'error', |
| 177 | + { |
| 178 | + allow: [ |
| 179 | + 'warn', |
| 180 | + 'dir', |
| 181 | + 'time', |
| 182 | + 'timeEnd', |
| 183 | + 'timeLog', |
| 184 | + 'trace', |
| 185 | + 'assert', |
| 186 | + 'clear', |
| 187 | + 'count', |
| 188 | + 'countReset', |
| 189 | + 'group', |
| 190 | + 'groupEnd', |
| 191 | + 'table', |
| 192 | + 'debug', |
| 193 | + 'info', |
| 194 | + 'dirxml', |
| 195 | + 'error', |
| 196 | + 'groupCollapsed', |
| 197 | + 'Console', |
| 198 | + 'profile', |
| 199 | + 'profileEnd', |
| 200 | + 'timeStamp', |
| 201 | + 'context', |
| 202 | + 'createTask', |
| 203 | + ], |
| 204 | + }, |
| 205 | + ], |
| 206 | + 'no-constant-condition': 'error', |
| 207 | + 'no-debugger': 'error', |
| 208 | + 'no-empty': 'error', |
| 209 | + 'no-empty-function': 'off', |
| 210 | + 'no-eval': 'error', |
| 211 | + 'no-extra-semi': 'off', |
| 212 | + 'no-fallthrough': 'off', |
| 213 | + 'no-invalid-this': 'off', |
| 214 | + 'no-irregular-whitespace': 'error', |
| 215 | + 'no-multiple-empty-lines': 'off', |
| 216 | + 'no-new-wrappers': 'error', |
| 217 | + 'no-redeclare': 'error', |
| 218 | + 'no-shadow': 'off', |
| 219 | + 'no-sparse-arrays': 'error', |
| 220 | + 'no-throw-literal': 'error', |
| 221 | + 'no-trailing-spaces': 'error', |
| 222 | + 'no-undef-init': 'error', |
| 223 | + 'no-underscore-dangle': 'off', |
| 224 | + 'no-unsafe-finally': 'error', |
| 225 | + 'no-unused-expressions': 'off', |
| 226 | + 'no-unused-labels': 'error', |
| 227 | + 'no-use-before-define': 'off', |
| 228 | + 'no-var': 'error', |
| 229 | + 'object-shorthand': 'error', |
| 230 | + 'one-var': ['error', 'never'], |
| 231 | + 'padded-blocks': [ |
| 232 | + 'off', |
| 233 | + { |
| 234 | + blocks: 'never', |
| 235 | + }, |
| 236 | + { |
| 237 | + allowSingleLineBlocks: true, |
| 238 | + }, |
| 239 | + ], |
| 240 | + 'padding-line-between-statements': [ |
| 241 | + 'error', |
| 242 | + { |
| 243 | + blankLine: 'always', |
| 244 | + prev: '*', |
| 245 | + next: 'return', |
| 246 | + }, |
| 247 | + ], |
| 248 | + 'prefer-arrow/prefer-arrow-functions': [ |
| 249 | + 'warn', |
| 250 | + { |
| 251 | + allowStandaloneDeclarations: true, |
| 252 | + }, |
| 253 | + ], |
| 254 | + 'prefer-const': 'error', |
| 255 | + 'quote-props': 'off', |
| 256 | + quotes: 'off', |
| 257 | + radix: 'error', |
| 258 | + 'react/no-unescaped-entities': 'off', |
| 259 | + 'react/jsx-boolean-value': 'off', |
| 260 | + 'react/jsx-curly-spacing': 'off', |
| 261 | + 'react/jsx-equals-spacing': 'off', |
| 262 | + 'react/jsx-key': 'error', |
| 263 | + 'react/jsx-no-bind': 'off', |
| 264 | + 'react/jsx-tag-spacing': [ |
| 265 | + 'off', |
| 266 | + { |
| 267 | + afterOpening: 'allow', |
| 268 | + closingSlash: 'allow', |
| 269 | + }, |
| 270 | + ], |
| 271 | + 'react/jsx-wrap-multilines': 'off', |
| 272 | + 'react/self-closing-comp': 'error', |
| 273 | + 'require-await': 'off', |
| 274 | + semi: 'off', |
| 275 | + 'space-before-function-paren': 'off', |
| 276 | + 'space-in-parens': ['off', 'never'], |
| 277 | + 'spaced-comment': [ |
| 278 | + 'error', |
| 279 | + 'always', |
| 280 | + { |
| 281 | + markers: ['/'], |
| 282 | + }, |
| 283 | + ], |
| 284 | + 'use-isnan': 'error', |
| 285 | + 'valid-typeof': 'off', |
| 286 | + '@typescript-eslint/tslint/config': [ |
| 287 | + 'error', |
| 288 | + { |
| 289 | + rules: { |
| 290 | + whitespace: true, |
| 291 | + }, |
| 292 | + }, |
| 293 | + ], |
| 294 | + }, |
| 295 | +}; |
0 commit comments