-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
46 lines (43 loc) · 1.63 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
import { FlatCompat } from '@eslint/eslintrc'
import pluginQuery from '@tanstack/eslint-plugin-query'
import pluginJsxA11y from 'eslint-plugin-jsx-a11y'
import pluginReact from 'eslint-plugin-react'
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
})
const eslintConfig = [
...compat.config({
extends: ['next/core-web-vitals', 'next/typescript', 'prettier'],
}),
...pluginQuery.configs['flat/recommended'],
{
...pluginJsxA11y.flatConfigs.strict,
...pluginReact.configs.flat.recommended,
rules: {
'react/boolean-prop-naming': ['warn'],
'react/forward-ref-uses-ref': ['warn'],
'react/hook-use-state': ['warn'],
'react/iframe-missing-sandbox': ['warn'],
'react/jsx-boolean-value': ['warn', 'never'],
'react/jsx-fragments': ['warn'],
'react/jsx-handler-names': ['warn'],
'react/jsx-no-bind': ['error'],
'react/jsx-no-leaked-render': ['error'],
'react/jsx-no-useless-fragment': ['warn', { allowExpressions: true }],
'react/jsx-props-no-spread-multi': ['warn'],
'react/sort-default-props': ['warn'],
'react/jsx-sort-props': ['warn'],
'react/no-array-index-key': ['error'],
'react/no-invalid-html-attribute': ['warn'],
'react/no-this-in-sfc': ['warn'],
'react/no-unstable-nested-components': ['error'],
'react/no-unused-state': ['warn'],
'react/no-will-update-set-state': ['warn'],
'react/prefer-read-only-props': ['warn'],
'react/prefer-stateless-function': ['error'],
'react/require-default-props': ['error'],
'react/style-prop-object': ['warn'],
},
},
]
export default eslintConfig