-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
51 lines (50 loc) · 1.42 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import eslint from '@eslint/js'
import globals from 'globals'
import prettierEslintConfigRecommended from 'eslint-plugin-prettier/recommended'
import reactHooksEslint from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import testingLibraryPlugin from 'eslint-plugin-testing-library'
import typeScriptEslint from 'typescript-eslint'
import typeScriptParser from '@typescript-eslint/parser'
export default [
eslint.configs.recommended,
...typeScriptEslint.configs.recommended,
prettierEslintConfigRecommended,
{
ignores: ['build', 'public'],
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
globals: {
...globals.browser,
},
parser: typeScriptParser,
},
linterOptions: {
reportUnusedDisableDirectives: 'warn',
},
plugins: {
'react-hooks': reactHooksEslint,
'react-refresh': reactRefresh,
'typescript-eslint': typeScriptEslint,
},
rules: {
...reactHooksEslint.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
'@typescript-eslint/no-empty-object-type': 'warn',
},
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
plugins: {
'testing-library': testingLibraryPlugin,
},
rules: testingLibraryPlugin.configs['flat/react'].rules,
},
]