11import js from '@eslint/js'
22import type { TSESLint } from '@typescript-eslint/utils'
33import prettierConfig from 'eslint-config-prettier'
4- import globals from 'globals'
54import 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'
96
107/**
118 * Represents the global variables provided by Vitest.
@@ -84,22 +81,16 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
8481 languageOptions : {
8582 globals : {
8683 ...vitestGlobals ,
87- ...nodeBuiltin ,
88- ...browser ,
89- ...node ,
9084 } ,
9185 parser,
9286 parserOptions : {
9387 projectService : {
94- allowDefaultProject : [ './*.?(m|c)[tj]s?(x)' ] ,
9588 defaultProject : './tsconfig.json' ,
9689 } ,
97- project : [ './tsconfig.json' ] ,
9890 ecmaVersion : 'latest' ,
9991 } ,
10092 } ,
10193 rules : {
102- 'prefer-const' : [ 2 ] ,
10394 'no-undef' : [ 0 ] ,
10495 '@typescript-eslint/consistent-type-imports' : [
10596 2 ,
@@ -109,15 +100,20 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
109100 '@typescript-eslint/no-unused-vars' : [ 0 ] ,
110101 '@typescript-eslint/array-type' : [ 2 , { default : 'array-simple' } ] ,
111102 '@typescript-eslint/no-explicit-any' : [ 0 ] ,
112- '@typescript-eslint/no-empty-interface ' : [
103+ '@typescript-eslint/no-empty-object-type ' : [
113104 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+ } ,
115116 ] ,
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 ] ,
121117 '@typescript-eslint/no-namespace' : [
122118 2 ,
123119 { allowDeclarations : true , allowDefinitionFiles : true } ,
@@ -135,7 +131,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
135131 } ,
136132 ] ,
137133 } ,
138- plugins : { '@typescript-eslint' : plugin } ,
139134 linterOptions : { reportUnusedDisableDirectives : 2 } ,
140135 } ,
141136 {
@@ -146,11 +141,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
146141 '@typescript-eslint/no-require-imports' : [ 0 ] ,
147142 } ,
148143 } ,
149- {
150- name : 'typescript-declaration-files' ,
151- files : [ '**/*.d.?(c|m)ts' ] ,
152- rules : { '@typescript-eslint/no-empty-object-type' : [ 0 ] } ,
153- } ,
154144)
155145
156146/**
0 commit comments