1+ import js from '@eslint/js' ;
2+ import globals from 'globals' ;
3+ import tseslint from 'typescript-eslint' ;
4+ import eslintReact from 'eslint-plugin-react' ;
5+ import eslintReactHooks from 'eslint-plugin-react-hooks' ;
6+ import prettierPlugin from 'eslint-plugin-prettier' ;
7+ import eslintConfigPrettier from 'eslint-config-prettier' ;
8+ import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort' ;
9+ import eslintPluginImport from 'eslint-plugin-import' ;
10+
11+ /** @type {import('eslint').Linter.FlatConfig[] } */
12+ export default tseslint . config (
13+ {
14+ plugins : {
15+ '@typescript-eslint' : tseslint . plugin ,
16+ 'react' : eslintReact ,
17+ 'react-hooks' : eslintReactHooks ,
18+ prettier : prettierPlugin ,
19+ 'simple-import-sort' : eslintPluginSimpleImportSort ,
20+ 'import' : eslintPluginImport ,
21+ } ,
22+ } ,
23+ {
24+ ignores : [ 'dist' , 'node_modules' , 'coverage' , 'eslint.config.mjs' , "icons" ] ,
25+ } ,
26+ js . configs . recommended ,
27+ ...tseslint . configs . recommended ,
28+ {
29+ languageOptions : {
30+ globals : {
31+ ...globals . browser ,
32+ ...globals . node ,
33+ ...globals . es2020 ,
34+ } ,
35+ parserOptions : {
36+ project : [ 'tsconfig.json' ] ,
37+ } ,
38+ parser : tseslint . parser ,
39+ ecmaVersion : 'latest'
40+ } ,
41+ } ,
42+ {
43+ files : [ '**/*.{ts,tsx}' ] ,
44+ extends : [ tseslint . configs . disableTypeChecked ] ,
45+ rules : {
46+ ...eslintConfigPrettier . rules ,
47+ ...eslintPluginImport . configs . recommended . rules ,
48+ '@typescript-eslint/no-empty-interface' : 'off' ,
49+ '@typescript-eslint/no-explicit-any' : 'warn' ,
50+ 'prettier/prettier' : 'warn' ,
51+ 'simple-import-sort/imports' : 'error' ,
52+ 'simple-import-sort/exports' : 'warn' ,
53+ 'import/first' : 'error' ,
54+ 'import/no-duplicates' : 'error' ,
55+ 'import/no-named-as-default' : 'off' ,
56+ 'import/no-unresolved' : 'off' ,
57+ 'import/no-named-as-default-member' : 'off' ,
58+ 'import/namespace' : 'off' ,
59+ 'import/named' : 'off' ,
60+ '@typescript-eslint/no-require-imports' : 'off'
61+ } ,
62+ } ,
63+ ) ;
0 commit comments