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.
@@ -82,22 +79,16 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
8279 languageOptions : {
8380 globals : {
8481 ...vitestGlobals ,
85- ...nodeBuiltin ,
86- ...browser ,
87- ...node ,
8882 } ,
8983 parser,
9084 parserOptions : {
9185 projectService : {
92- allowDefaultProject : [ './*.?(m|c)[tj]s?(x)' ] ,
9386 defaultProject : './tsconfig.json' ,
9487 } ,
95- project : [ './tsconfig.json' ] ,
9688 ecmaVersion : 'latest' ,
9789 } ,
9890 } ,
9991 rules : {
100- 'prefer-const' : [ 2 ] ,
10192 'no-undef' : [ 0 ] ,
10293 '@typescript-eslint/consistent-type-imports' : [
10394 2 ,
@@ -107,15 +98,20 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
10798 '@typescript-eslint/no-unused-vars' : [ 0 ] ,
10899 '@typescript-eslint/array-type' : [ 2 , { default : 'array-simple' } ] ,
109100 '@typescript-eslint/no-explicit-any' : [ 0 ] ,
110- '@typescript-eslint/no-empty-interface ' : [
101+ '@typescript-eslint/no-empty-object-type ' : [
111102 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+ } ,
113114 ] ,
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 ] ,
119115 '@typescript-eslint/no-namespace' : [
120116 2 ,
121117 { allowDeclarations : true , allowDefinitionFiles : true } ,
@@ -133,7 +129,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
133129 } ,
134130 ] ,
135131 } ,
136- plugins : { '@typescript-eslint' : plugin } ,
137132 linterOptions : { reportUnusedDisableDirectives : 2 } ,
138133 } ,
139134 {
@@ -144,11 +139,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
144139 '@typescript-eslint/no-require-imports' : [ 0 ] ,
145140 } ,
146141 } ,
147- {
148- name : 'typescript-declaration-files' ,
149- files : [ '**/*.d.?(c|m)ts' ] ,
150- rules : { '@typescript-eslint/no-empty-object-type' : [ 0 ] } ,
151- } ,
152142)
153143
154144/**
0 commit comments