1+ import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort' ;
2+ import eslintPluginPrettier from 'eslint-plugin-prettier' ;
3+ import eslintPluginPath from 'eslint-plugin-path' ;
4+ import eslintUnusedImports from 'eslint-plugin-unused-imports' ;
5+ import { flatConfigs as importFlatConfig } from 'eslint-plugin-import' ;
6+ import jsLint from '@eslint/js' ;
7+ import tsLint from 'typescript-eslint' ;
8+ import eslintConfigPrettier from 'eslint-config-prettier' ;
9+ import pluginReact from 'eslint-plugin-react' ;
10+ import pluginReactHooks from 'eslint-plugin-react-hooks' ;
11+ import globals from 'globals' ;
12+
13+ export default [
14+ {
15+ ignores : [
16+ 'node_modules/*' ,
17+ '**/package.json' ,
18+ '**/package-lock.json' ,
19+ '**/yarn.lock' ,
20+ '**/yarn-error.log' ,
21+ ] ,
22+ } ,
23+ {
24+ files : [ './{src,setup}/**/*.{ts,tsx}' ] ,
25+ languageOptions : {
26+ ecmaVersion : 5 ,
27+ globals : {
28+ ...globals . browser ,
29+ ...globals . node ,
30+ ...globals . jest ,
31+ } ,
32+ parser : '@typescript-eslint/parser' ,
33+ parserOptions : {
34+ ecmaFeatures : {
35+ experimentalObjectRestSpread : true ,
36+ jsx : true ,
37+ legacyDecorators : true ,
38+ } ,
39+ project : './tsconfig.json' ,
40+ useJSXTextNode : true ,
41+ } ,
42+
43+ sourceType : 'module' ,
44+ } ,
45+ } ,
46+ jsLint . configs . recommended ,
47+ ...tsLint . configs . recommended ,
48+ eslintConfigPrettier ,
49+ importFlatConfig ?. typescript ,
50+ {
51+ files : [ './{src,setup}/**/*.{ts,tsx}' ] ,
52+ plugins : {
53+ prettier : eslintPluginPrettier ,
54+ path : eslintPluginPath ,
55+ 'simple-import-sort' : pluginSimpleImportSort ,
56+ 'unused-imports' : eslintUnusedImports ,
57+ 'react-hooks' : pluginReactHooks ,
58+ 'react' : pluginReact ,
59+ } ,
60+ rules : {
61+ ...pluginReact . configs . recommended . rules ,
62+ ...pluginReactHooks . configs . recommended . rules ,
63+ semi : [ 'off' ] ,
64+ 'no-shadow' : [ 'off' ] ,
65+ 'no-undef' : 'off' ,
66+ 'no-bitwise' : 'off' ,
67+ 'no-unused-vars' : 'off' ,
68+ 'react/hook-use-state' : [ 2 , { allowDestructuredState : true } ] ,
69+ 'path/no-relative-imports' : [
70+ 'error' ,
71+ {
72+ maxDepth : 2 ,
73+ suggested : false ,
74+ } ,
75+ ] ,
76+ 'prettier/prettier' : [
77+ 'error' ,
78+ {
79+ arrowParens : 'avoid' ,
80+ bracketSpacing : true ,
81+ printWidth : 100 ,
82+ semi : true ,
83+ singleQuote : true ,
84+ tabWidth : 2 ,
85+ trailingComma : 'all' ,
86+ endOfLine : 'lf' ,
87+ } ,
88+ ] ,
89+ 'react/jsx-no-target-blank' : 'off' ,
90+ 'react/prop-types' : 'off' ,
91+ 'simple-import-sort/imports' : [
92+ 'error' ,
93+ {
94+ groups : [
95+ [ '^\\u0000' , '^react$' , '^react' , '^@?\\w' , '^__mocks__(/.*|$)' ] ,
96+ [ '^(containers|core|data|domain|presentation|types)(/.*|$)' ] ,
97+ [ '^\\.\\.(?!/?$)' , '^\\.\\./?$' , '^\\./(?=.*/)(?!/?$)' , '^\\.(?!/?$)' , '^\\./?$' ] ,
98+ ] ,
99+ } ,
100+ ] ,
101+ 'unused-imports/no-unused-imports' : 'error' ,
102+ 'unused-imports/no-unused-vars' : [
103+ 'warn' ,
104+ {
105+ vars : 'all' ,
106+ varsIgnorePattern : '^_' ,
107+ args : 'after-used' ,
108+ argsIgnorePattern : '^_' ,
109+ } ,
110+ ] ,
111+ '@typescript-eslint/no-unsafe-assignment' : 'off' ,
112+ '@typescript-eslint/no-unsafe-member-access' : 'off' ,
113+ '@typescript-eslint/no-unsafe-call' : 'off' ,
114+ '@typescript-eslint/no-unsafe-return' : 'off' ,
115+ '@typescript-eslint/no-explicit-any' : 'off' ,
116+ '@typescript-eslint/no-unsafe-argument' : 'off' ,
117+ '@typescript-eslint/no-unsafe-enum-comparison' : 'off' ,
118+ '@typescript-eslint/no-floating-promises' : 'off' ,
119+ '@typescript-eslint/no-misused-promises' : 'off' ,
120+ '@typescript-eslint/no-redundant-type-constituents' : 'off' ,
121+ '@typescript-eslint/no-unused-vars' : 'off' ,
122+ '@typescript-eslint/no-var-requires' : 'off' ,
123+ '@typescript-eslint/func-call-spacing' : 'off' ,
124+ '@typescript-eslint/no-namespace' : 'off' ,
125+ } ,
126+ settings : {
127+ 'import/resolver' : {
128+ node : {
129+ extensions : [ '.js' , '.jsx' , '.ts' , '.tsx' ] ,
130+ moduleDirectory : [ 'node_modules' , 'src/' , './' ] ,
131+ } ,
132+ } ,
133+ react : {
134+ version : 'detect' ,
135+ } ,
136+ } ,
137+ } ,
138+ ] ;
0 commit comments