-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.js
81 lines (79 loc) · 1.81 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
76
77
78
79
80
81
import js from '@eslint/js'
import tseslint from 'typescript-eslint'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import globals from 'globals'
const config = tseslint.config(
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
ecmaFeatures: {
jsx: true
}
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
...globals.es2015
}
},
settings: {
react: {
version: 'detect'
}
},
plugins: {
react,
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
},
rules: {
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
'no-console': 'error',
'react/react-in-jsx-scope': 'off'
}
},
{
files: ['**/__tests__/*'],
rules: {
'@typescript-eslint/unbound-method': 'off'
}
},
{
files: ['**/__tests__/hook.tsx', '**/__tests__/component.tsx'],
rules: {
/**
* Turn off until @types/react supports v19. Possibly will fix this issue.
* Need to use await act(async) but triggers lint error.
*/
'@typescript-eslint/require-await': 'off'
}
},
{
files: ['**/src/component.tsx', '**/src/story.tsx'],
rules: {
/**
* Allow onClick handlers for the player controls to return Promise<void>.
*/
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
attributes: false
}
}
]
}
},
{
ignores: ['dist', 'build', 'coverage'],
}
)
export default config