-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
74 lines (71 loc) · 2.21 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// @ts-check
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import compat from 'eslint-plugin-compat';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.stylisticTypeChecked,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
// reactHooks.configs.recommended,
compat.configs['flat/recommended'],
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
languageOptions: {
...react.configs.flat?.recommended.languageOptions,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
},
globals: {
...globals.browser,
},
},
plugins: {
"react-hooks": reactHooks.configs.recommended
},
rules: {
"no-unused-vars": "off",
"react/jsx-uses-vars": "error",
"react/jsx-uses-react": "error",
"react/prop-types": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true
}
],
"@typescript-eslint/no-empty-function": [
"error",
{
"allow": ["arrowFunctions"]
}
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
varsIgnorePattern: "^_",
}
]
},
settings: {
polyfills: [
"Promise",
"fetch"
],
react: {
"version": "detect"
}
}
},
)