-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
113 lines (111 loc) Β· 3.23 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
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',
},
},
},
}
);