-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
66 lines (64 loc) · 2.01 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
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import importPlugin from 'eslint-plugin-import';
import hooksPlugin from 'eslint-plugin-react-hooks';
export default [
importPlugin.flatConfigs.recommended,
...tseslint.config(...tseslint.configs.recommended),
eslintPluginPrettierRecommended,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
// env: {
// node: true,
// jest: true,
// },
files: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.js', 'src/**/*.jsx'],
plugins: {
'react-hooks': hooksPlugin,
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "<root>/tsconfig.json",
},
}
},
// plugins: ['@typescript-eslint', '@typescript-eslint/tslint', 'react-hooks', 'react', 'prettier'],
rules: {
'prettier/prettier': 'error',
'global-require': 'off',
'no-undef': 'off',
// 'import/no-dynamic-require': 'off',
// 'import/no-named-as-default': 'off',
// 'import/no-extraneous-dependencies': [
// 'error',
// { devDependencies: ['**/*.spec.ts', '**/*.spec.tsx'] },
// ],
// 'import/no-named-as-default-member': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'functional/prefer-immutable-types': 'off',
// '@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
// 'import/prefer-default-export': 'off',
// 'import/extensions': 'off',
// 'import/no-unresolved': 'off',
'no-unused-vars': 'off',
'react-hooks/rules-of-hooks': 'error',
"react-hooks/exhaustive-deps": ["warn", {
"additionalHooks": "(useEventListener)"
}],
'react-hooks/exhaustive-deps': 'warn',
},
},
];