-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
52 lines (51 loc) · 1.79 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
51
52
import antfu, {
react as reactConfig,
} from '@antfu/eslint-config'
import pluginQuery from '@tanstack/eslint-plugin-query'
import reactCompiler from 'eslint-plugin-react-compiler'
import tailwind from 'eslint-plugin-tailwindcss'
export default antfu(
{
react: false,
typescript: {
tsconfigPath: './tsconfig.json',
},
lessOpinionated: false,
ignores: ['dist', '.yarn', '.eslintcache', 'node_modules', 'public', 'yarn.lock', 'tsconfig.app.tsbuildinfo', 'tsconfig.node.json', '.dockerignore', 'Dockerfile', 'nginx.config.template'],
stylistic: {
overrides: {
'antfu/if-newline': 'off',
},
},
},
reactConfig({
files: ['**/*.tsx'],
tsconfigPath: './tsconfig.json',
overrides: {
'react/no-leaked-conditional-rendering': 'error',
'react-hooks/exhaustive-deps': 'error',
'react-hooks-extra/no-direct-set-state-in-use-effect': 'error',
'react-hooks-extra/no-direct-set-state-in-use-layout-effect': 'error',
'react-hooks-extra/no-redundant-custom-hook': 'error',
'react-hooks-extra/no-unnecessary-use-callback': 'error',
'react-hooks-extra/no-unnecessary-use-memo': 'error',
'react-hooks-extra/prefer-use-state-lazy-initialization': 'error',
'react-hooks-extra/ensure-custom-hooks-using-other-hooks': 'error',
'react-hooks-extra/ensure-use-memo-has-non-empty-deps': 'error',
'react-naming-convention/component-name': 'error',
'react-naming-convention/use-state': 'error',
},
}),
{
files: ['**/*.{ts,tsx}'],
plugins: {
'react-compiler': reactCompiler,
},
rules: {
'ts/strict-boolean-expressions': 'off',
'react-compiler/react-compiler': 'error',
},
},
...tailwind.configs['flat/recommended'],
...pluginQuery.configs['flat/recommended'],
)