-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
eslint.config.js
67 lines (66 loc) · 2.08 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
67
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import importPlugin from 'eslint-plugin-import';
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
import: importPlugin,
},
settings: {
react: { version: '18.2' },
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
alias: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
map: [
['@assets', './src/assets'],
['@components', './src/components'],
['@icons', './src/components/icons'],
['@constants', './src/constants'],
['@features', './src/features'],
['@hooks', './src/hooks'],
['@layouts', './src/layouts'],
['@pages', './src/pages'],
['@routes', './src/routes'],
['@services', './src/services'],
['@states', './src/states'],
['@utils', './src/utils'],
['@wrapper', './src/wrapper'],
['@locales', './src/locales'],
['@definition', './src/definition'],
['@global', './src/global'],
['@db', './src/indexedDb'],
['@views', './src/views'],
],
},
},
},
rules: {
...reactHooks.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'import/no-cycle': ['error', { maxDepth: 9999 }],
},
},
];