1
1
import js from '@eslint/js'
2
2
import type { TSESLint } from '@typescript-eslint/utils'
3
3
import prettierConfig from 'eslint-config-prettier'
4
- import globals from 'globals'
5
4
import type { ConfigWithExtends } from 'typescript-eslint'
6
- import { config , configs , parser , plugin } from 'typescript-eslint'
7
-
8
- const { browser, node, nodeBuiltin } = globals
5
+ import { config , configs , parser } from 'typescript-eslint'
9
6
10
7
/**
11
8
* Represents the global variables provided by Vitest.
@@ -82,22 +79,16 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
82
79
languageOptions : {
83
80
globals : {
84
81
...vitestGlobals ,
85
- ...nodeBuiltin ,
86
- ...browser ,
87
- ...node ,
88
82
} ,
89
83
parser,
90
84
parserOptions : {
91
85
projectService : {
92
- allowDefaultProject : [ './*.?(m|c)[tj]s?(x)' ] ,
93
86
defaultProject : './tsconfig.json' ,
94
87
} ,
95
- project : [ './tsconfig.json' ] ,
96
88
ecmaVersion : 'latest' ,
97
89
} ,
98
90
} ,
99
91
rules : {
100
- 'prefer-const' : [ 2 ] ,
101
92
'no-undef' : [ 0 ] ,
102
93
'@typescript-eslint/consistent-type-imports' : [
103
94
2 ,
@@ -107,15 +98,20 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
107
98
'@typescript-eslint/no-unused-vars' : [ 0 ] ,
108
99
'@typescript-eslint/array-type' : [ 2 , { default : 'array-simple' } ] ,
109
100
'@typescript-eslint/no-explicit-any' : [ 0 ] ,
110
- '@typescript-eslint/no-empty-interface ' : [
101
+ '@typescript-eslint/no-empty-object-type ' : [
111
102
2 ,
112
- { allowSingleExtends : true } ,
103
+ { allowInterfaces : 'with-single-extends' } ,
104
+ ] ,
105
+ '@typescript-eslint/no-restricted-types' : [
106
+ 2 ,
107
+ {
108
+ types : {
109
+ '{}' : {
110
+ suggest : [ 'AnyNonNullishValue' , 'EmptyObject' , 'AnyObject' ] ,
111
+ } ,
112
+ } ,
113
+ } ,
113
114
] ,
114
- '@typescript-eslint/no-unsafe-argument' : [ 0 ] ,
115
- '@typescript-eslint/no-restricted-types' : [ 2 ] ,
116
- '@typescript-eslint/no-empty-object-type' : [ 2 ] ,
117
- '@typescript-eslint/no-unsafe-function-type' : [ 2 ] ,
118
- '@typescript-eslint/no-wrapper-object-types' : [ 2 ] ,
119
115
'@typescript-eslint/no-namespace' : [
120
116
2 ,
121
117
{ allowDeclarations : true , allowDefinitionFiles : true } ,
@@ -133,7 +129,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
133
129
} ,
134
130
] ,
135
131
} ,
136
- plugins : { '@typescript-eslint' : plugin } ,
137
132
linterOptions : { reportUnusedDisableDirectives : 2 } ,
138
133
} ,
139
134
{
@@ -144,11 +139,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
144
139
'@typescript-eslint/no-require-imports' : [ 0 ] ,
145
140
} ,
146
141
} ,
147
- {
148
- name : 'typescript-declaration-files' ,
149
- files : [ '**/*.d.?(c|m)ts' ] ,
150
- rules : { '@typescript-eslint/no-empty-object-type' : [ 0 ] } ,
151
- } ,
152
142
)
153
143
154
144
/**
0 commit comments