1
- const globals = require ( "globals" ) ;
2
1
const tseslint = require ( "typescript-eslint" ) ;
2
+ const stylisticTs = require ( "@stylistic/eslint-plugin-ts" ) ;
3
3
4
4
/**
5
5
* @return { import("eslint").Linter.FlatConfig[] }
@@ -11,6 +11,7 @@ module.exports = function typescript() {
11
11
{
12
12
plugins : {
13
13
"@typescript-eslint" : tseslint . plugin ,
14
+ "@stylistic/ts" : stylisticTs ,
14
15
} ,
15
16
languageOptions : {
16
17
parser : tseslint . parser ,
@@ -28,7 +29,7 @@ module.exports = function typescript() {
28
29
"no-useless-constructor" : "off" ,
29
30
"@typescript-eslint/no-useless-constructor" : "warn" ,
30
31
"@typescript-eslint/unified-signatures" : "warn" ,
31
- "@typescript-eslint /indent" : [ "warn" , 2 , { SwitchCase : 1 } ] ,
32
+ "@stylistic/ts /indent" : [ "warn" , 2 , { SwitchCase : 1 } ] ,
32
33
33
34
"@typescript-eslint/ban-ts-comment" : "off" ,
34
35
"@typescript-eslint/explicit-member-accessibility" : "off" ,
@@ -38,9 +39,7 @@ module.exports = function typescript() {
38
39
"@typescript-eslint/no-object-literal-type-assertion" : "off" ,
39
40
"@typescript-eslint/no-triple-slash-reference" : "off" ,
40
41
"@typescript-eslint/no-unused-vars" : "off" ,
41
- "@typescript-eslint/no-var-requires" : "off" ,
42
42
"@typescript-eslint/prefer-interface" : "off" ,
43
- "@typescript-eslint/prefer-namespace-keyword" : "off" ,
44
43
45
44
"no-shadow" : "off" ,
46
45
"@typescript-eslint/no-shadow" : "error" ,
@@ -54,7 +53,7 @@ module.exports = function typescript() {
54
53
// To delete as appropriate when reviewing the adaptation rules again.
55
54
// rules removed from `recommended` in v6
56
55
"no-extra-semi" : "off" ,
57
- "@typescript-eslint /no-extra-semi" : "error" ,
56
+ "@stylistic/ts /no-extra-semi" : "error" ,
58
57
// rules moved to `strict` in v6
59
58
"@typescript-eslint/no-non-null-assertion" : "warn" ,
60
59
// rules added to `recommended` in v6
@@ -70,6 +69,21 @@ module.exports = function typescript() {
70
69
"@typescript-eslint/no-confusing-non-null-assertion" : "off" ,
71
70
"@typescript-eslint/prefer-for-of" : "off" ,
72
71
"@typescript-eslint/prefer-function-type" : "off" ,
72
+
73
+ // rules deleted from `recommended` in v8
74
+ "no-loss-of-precision" : "off" ,
75
+ "@typescript-eslint/no-loss-of-precision" : "error" ,
76
+
77
+ // added instead of `@typescript-eslint/ban-types` in v8
78
+ "@typescript-eslint/no-empty-object-type" : "error" ,
79
+ "@typescript-eslint/no-unsafe-function-type" : "error" ,
80
+ "@typescript-eslint/no-wrapper-object-types" : "error" ,
81
+
82
+ // rules added to `recommended` in v8
83
+ "@typescript-eslint/no-require-imports" : "off" ,
84
+ "no-unused-expressions" : "error" ,
85
+ "@typescript-eslint/no-unused-expressions" : "off" ,
86
+ "@typescript-eslint/prefer-namespace-keyword" : "off" ,
73
87
} ,
74
88
} ,
75
89
] ;
0 commit comments