-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
75 lines (73 loc) · 2.1 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// @ts-check
import eslint from '@eslint/js'
import configPrettier from 'eslint-config-prettier'
import perfectionist from 'eslint-plugin-perfectionist'
import reactPlugin from 'eslint-plugin-react'
import hooksPlugin from 'eslint-plugin-react-hooks'
import reactRefreshPlugin from 'eslint-plugin-react-refresh'
import testingLibraryPlugin from 'eslint-plugin-testing-library'
import tsEslintPlugin from 'typescript-eslint'
export default tsEslintPlugin.config(
eslint.configs.recommended,
...tsEslintPlugin.configs.strictTypeChecked,
...tsEslintPlugin.configs.stylisticTypeChecked,
{
...perfectionist.configs['recommended-natural'],
rules: {
...perfectionist.configs['recommended-natural'].rules,
'perfectionist/sort-modules': 0,
},
},
{
files: ['src/**/*.{ts,tsx}'],
linterOptions: {
reportUnusedDisableDirectives: 'warn',
},
},
{
plugins: {
react: reactPlugin,
'react-hooks': hooksPlugin,
'react-refresh': reactRefreshPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
...hooksPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
plugins: {
'testing-library': testingLibraryPlugin,
},
rules: {
...testingLibraryPlugin.configs.react.rules,
},
},
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
extends: [tsEslintPlugin.configs.disableTypeChecked],
files: ['**/*.js'],
},
configPrettier,
)