File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ const {
4
+ version : typescriptESLintPluginVersion ,
5
+ } = require ( '@typescript-eslint/eslint-plugin/package.json' ) ;
6
+ const semver = require ( 'semver' ) ;
3
7
const globals = require ( './src/globals.json' ) ;
4
8
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
+
5
23
module . exports = {
6
24
parser : require . resolve ( '@typescript-eslint/parser' ) ,
7
25
extends : [
@@ -30,6 +48,7 @@ module.exports = {
30
48
'@typescript-eslint/array-type' : [ 'error' , { default : 'array-simple' } ] ,
31
49
'@typescript-eslint/no-require-imports' : 'error' ,
32
50
'@typescript-eslint/ban-ts-comment' : 'error' ,
51
+ ...typescriptBanTypesRules ( ) ,
33
52
'@typescript-eslint/ban-types' : 'error' ,
34
53
'@typescript-eslint/consistent-type-imports' : [
35
54
'error' ,
You can’t perform that action at this time.
0 commit comments