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