1- import js from '@eslint/js'
2- import globals from 'globals'
3- import reactHooks from 'eslint-plugin-react-hooks'
4- import reactRefresh from 'eslint-plugin-react-refresh'
5- import tseslint from 'typescript-eslint'
6- import { defineConfig , globalIgnores } from 'eslint/config'
1+ import js from '@eslint/js' ;
2+ import typescript from '@typescript-eslint/eslint-plugin' ;
3+ import typescriptParser from '@typescript-eslint/parser' ;
74
8- export default defineConfig ( [
9- globalIgnores ( [ 'dist' ] ) ,
5+ export default [
6+ js . configs . recommended ,
107 {
11- files : [ '**/*.{ts,tsx}' ] ,
12- extends : [
13- js . configs . recommended ,
14- tseslint . configs . recommended ,
15- reactHooks . configs . flat . recommended ,
16- reactRefresh . configs . vite ,
17- ] ,
8+ files : [ '**/*.ts' , '**/*.tsx' , '**/*.js' , '**/*.jsx' ] ,
189 languageOptions : {
19- ecmaVersion : 2020 ,
20- globals : globals . browser ,
10+ parser : typescriptParser ,
11+ parserOptions : {
12+ ecmaVersion : 'latest' ,
13+ sourceType : 'module' ,
14+ ecmaFeatures : {
15+ jsx : true ,
16+ } ,
17+ } ,
18+ globals : {
19+ console : 'readonly' ,
20+ document : 'readonly' ,
21+ window : 'readonly' ,
22+ fetch : 'readonly' ,
23+ FormData : 'readonly' ,
24+ File : 'readonly' ,
25+ setTimeout : 'readonly' ,
26+ clearTimeout : 'readonly' ,
27+ localStorage : 'readonly' ,
28+ sessionStorage : 'readonly' ,
29+ URL : 'readonly' ,
30+ Blob : 'readonly' ,
31+ FileReader : 'readonly' ,
32+ } ,
33+ } ,
34+ plugins : {
35+ '@typescript-eslint' : typescript ,
36+ } ,
37+ rules : {
38+ '@typescript-eslint/no-explicit-any' : 'warn' ,
39+ '@typescript-eslint/no-unused-vars' : [ 'error' , {
40+ argsIgnorePattern : '^_' ,
41+ varsIgnorePattern : '^_'
42+ } ] ,
43+ 'no-undef' : 'off' ,
44+ 'no-unused-vars' : 'off' ,
45+ } ,
46+ settings : {
47+ react : {
48+ version : 'detect' ,
49+ } ,
2150 } ,
2251 } ,
23- ] )
52+ ] ;
0 commit comments