-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.import.js
More file actions
79 lines (70 loc) ยท 2.22 KB
/
eslint.config.import.js
File metadata and controls
79 lines (70 loc) ยท 2.22 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
// eslint-config-import.js
import importPlugin from 'eslint-plugin-import';
import path from 'path';
export default {
plugins: {
import: importPlugin,
},
settings: {
'import/resolver': {
typescript: {
project: path.resolve(process.cwd(), 'tsconfig.json'),
},
},
},
rules: {
'import/order': [
'error',
{
groups: [
// ์ธ๋ถ ํจํค์ง
'external',
// Node.js ๋ด์ฅ ๋ชจ๋
'builtin',
// ๋ด๋ถ ๋ชจ๋
'internal',
// ์์ ๋๋ ํ ๋ฆฌ
'parent',
// ๊ฐ์ ๋๋ ํ ๋ฆฌ
'sibling',
// index ํ์ผ
'index',
// ๊ฐ์ฒด import
'object',
// ํ์
import
'type',
],
// NOTE: FSD์ ๋จ๋ฐฉํฅ ์์กด์ฑ์ ์ ์งํ๊ธฐ ์ํ ์ค์
pathGroups: [
// another alias
{ pattern: '@/**', group: 'internal', position: 'before' },
// FSD Layer
{ pattern: '@app/**', group: 'internal', position: 'after' },
{ pattern: '@pages/**', group: 'internal', position: 'after' },
{ pattern: '@widgets/**', group: 'internal', position: 'after' },
{ pattern: '@features/**', group: 'internal', position: 'after' },
{ pattern: '@entities/**', group: 'internal', position: 'after' },
{ pattern: '@shared/**', group: 'internal', position: 'after' },
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: { order: 'asc' },
},
],
// import๋ฌธ์ ์ต์๋จ์ ์์น
'import/first': 'error',
// import ์ดํ ์ ๋ผ์ธ ์ถ๊ฐ
'import/newline-after-import': 'error',
// export ๊ตฌ๋ฌธ์ ํ์ผ์ ๋ง์ง๋ง์ ์์นํด์ผ ํจ
'import/exports-last': 'off',
// ์กด์ฌํ์ง ์๋ ๋ชจ๋ import ๊ธ์ง
'import/no-unresolved': 'error',
// ๊ฐ์ ๋ชจ๋์ ๋ ๋ฒ import ๊ธ์ง
'import/no-duplicates': 'error',
// import ์ํ ์ฐธ์กฐ ๊ธ์ง
'import/no-cycle': 'error',
// ์๊ธฐ ์์ import ๊ธ์ง
'import/no-self-import': 'error',
// ๋ถํ์ํ ๊ฒฝ๋ก ์ธ๊ทธ๋จผํธ ๊ธ์ง (./foo/index โ ./foo)
'import/no-useless-path-segments': 'error',
},
};