-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy patheslint.config.mjs
50 lines (48 loc) · 1.6 KB
/
eslint.config.mjs
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
// @ts-check
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import reactHooks from 'eslint-plugin-react-hooks'
export default tseslint.config(
{
ignores: [
'**/.keystone/',
'**/.next/',
'**/dist/',
'**/__generated__/',
'**/node_modules/',
'**/syntax-error.js',
'**/public/',
'examples/',
],
},
eslint.configs.recommended,
...tseslint.configs.strict,
reactHooks.configs['recommended-latest'],
{
rules: {
'no-empty': ['error', { allowEmptyCatch: true }],
'prefer-const': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-require-imports': 'off', // TODO: always
'no-undef': 'off', // https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'@typescript-eslint/consistent-type-imports': [
'error',
{
disallowTypeAnnotations: true,
fixStyle: 'separate-type-imports',
prefer: 'type-imports',
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
// TODO: enable
// 'react-hooks/exhaustive-deps': 'error',
},
}
)