-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
113 lines (111 loc) ยท 3.23 KB
/
eslint.config.js
File metadata and controls
113 lines (111 loc) ยท 3.23 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import js from '@eslint/js';
import globals from 'globals';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import eslintPluginImport from 'eslint-plugin-import';
export default tseslint.config(
{ ignores: ['dist', 'custom.d.ts', 'vite.config.ts'] },
{
files: ['**/*.{ts,tsx}'],
extends: [js.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@typescript-eslint': tseslint.plugin,
import: eslintPluginImport,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react/react-in-jsx-scope': 'off',
'react/jsx-boolean-value': ['error', 'never'],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
['parent', 'sibling', 'index'], // ํ ๊ทธ๋ฃน์ผ๋ก ๋ณด๊ฒ๋
'object',
'type',
],
pathGroups: [
{
pattern: 'react', // react ์ ์ผ ์๋ก
group: 'external',
position: 'before',
},
{
pattern: 'react*', // react ๊ด๋ จ ์ ์ผ ์๋ก
group: 'external',
position: 'before',
},
{
pattern: '@tanstack/*', // query ๊ด๋ จ ๊ทธ ๋ค์์ผ๋ก
group: 'external',
position: 'before',
},
{
pattern: '@apis/**', // api ๊ด๋ จ ๋ด๋ถ๋ชจ๋ ์๋ก
group: 'internal',
position: 'before',
},
{
pattern: '@lotties',
group: 'internal',
position: 'after',
},
{
pattern: '@svgs',
group: 'internal',
position: 'after',
},
{
pattern: '{@image/*, @styles/*}',
group: 'internal',
position: 'after',
},
{
pattern: '{@pages/*, @components, @hooks, @routes, @constants}',
group: 'internal',
position: 'after',
},
{
pattern: '@types', // type ๊ด๋ จ์ type ๊ทธ๋ฃน ์๋ก
group: 'type',
position: 'before',
},
{
pattern: '{./pageRoutes, ./routePath}',
group: 'sibling',
position: 'after',
},
],
alphabetize: { order: 'asc', caseInsensitive: true },
'newlines-between': 'always',
},
],
},
settings: {
// typeScript ๊ฐ ํ์ผ์ ์ ์ฝ์ง ๋ชปํด์ ์๊ธฐ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํด์ฃผ๋ ๋ถ๋ถ
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.app.json',
},
},
},
}
);