-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
76 lines (76 loc) · 2.28 KB
/
.eslintrc.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
module.exports = {
env: {
'react-native/react-native': true, // react-native plugin 사용하기 위해
},
parser: '@typescript-eslint/parser', // eslint를 typescript에 적용하기위해
extends: [
'plugin:react-native/all', // react-native plugin 사용하기 위해
'plugin:@typescript-eslint/recommended', // typescript 설정 사용
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
ignorePatterns: ['/*', '!/src', '!/app', '/src/api/types.ts'],
plugins: ['@typescript-eslint', 'react', 'react-native', 'react-hooks', 'import'],
rules: {
'react-native/sort-styles': 'off',
'import/no-named-as-default-member': 'off',
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
'import/prefer-default-export': 'off',
'import/no-unresolved': 0,
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'import/no-extraneous-dependencies': 0,
'react/jsx-filename-extension': [
1,
{
extensions: ['.jsx', '.tsx', '.js'],
},
],
'import/order': [
'error',
{
groups: [
['builtin', 'external'], // 내장 모듈과 외부 모듈을 먼저
['internal'], // 내부 모듈
['parent', 'sibling', 'index'], // 상위/형제/인덱스 모듈 순서로
],
pathGroups: [
{
pattern: 'react*',
group: 'external',
position: 'before',
},
{
pattern: '@/*',
group: 'internal',
position: 'after',
},
],
'newlines-between': 'never',
alphabetize: { order: 'asc', caseInsensitive: true }, // 알파벳 순으로 정렬
},
],
'react-native/no-unused-styles': 2,
'react-native/split-platform-components': 2,
'react-native/no-inline-styles': 2,
'react-native/no-color-literals': 0,
'react-native/no-raw-text': 2,
'react-native/no-single-element-style-arrays': 0,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: true,
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};