|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 |
| -const { |
4 |
| - version: typescriptESLintPluginVersion, |
5 |
| -} = require('@typescript-eslint/eslint-plugin/package.json'); |
6 |
| -const semver = require('semver'); |
7 | 3 | const globals = require('./src/globals.json');
|
8 | 4 |
|
9 |
| -const typescriptBanTypesRules = () => { |
10 |
| - if (semver.major(typescriptESLintPluginVersion) === 8) { |
11 |
| - return { |
12 |
| - '@typescript-eslint/no-empty-object-type': 'error', |
13 |
| - '@typescript-eslint/no-unsafe-function-type': 'error', |
14 |
| - '@typescript-eslint/no-wrapper-object-types': 'error', |
15 |
| - }; |
16 |
| - } |
17 |
| - |
18 |
| - return { |
19 |
| - '@typescript-eslint/ban-types': 'error', |
20 |
| - }; |
21 |
| -}; |
22 |
| - |
23 | 5 | module.exports = {
|
24 | 6 | ignorePatterns: ['!.eslint-doc-generatorrc.js', '!.eslintrc.js'],
|
25 | 7 | parser: require.resolve('@typescript-eslint/parser'),
|
@@ -49,7 +31,9 @@ module.exports = {
|
49 | 31 | '@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
|
50 | 32 | '@typescript-eslint/no-require-imports': 'error',
|
51 | 33 | '@typescript-eslint/ban-ts-comment': 'error',
|
52 |
| - ...typescriptBanTypesRules(), |
| 34 | + '@typescript-eslint/no-empty-object-type': 'error', |
| 35 | + '@typescript-eslint/no-unsafe-function-type': 'error', |
| 36 | + '@typescript-eslint/no-wrapper-object-types': 'error', |
53 | 37 | '@typescript-eslint/consistent-type-imports': [
|
54 | 38 | 'error',
|
55 | 39 | { disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' },
|
|
0 commit comments