-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eslintrc.json
92 lines (91 loc) · 2.69 KB
/
.eslintrc.json
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
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "import"],
"parserOptions": {
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"env": {
// 전역객체를 eslint가 인식하는 구간
"browser": true, // document나 window 인식되게 함
"node": true,
"es6": true
},
"ignorePatterns": ["node_modules/"], // eslint 미적용될 폴더나 파일 명시
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended", // ts 권장
"plugin:prettier/recommended", // eslint의 포매팅을 prettier로 사용
"prettier", // eslint-config-prettier prettier와 중복된 eslint 규칙 제거
"eslint-config-prettier",
"plugin:import/recommended",
"plugin:import/typescript",
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"settings": {
"import/resolver": {
"typescript": {}
},
"import/parsers": { "@typescript-eslint/parser": [".ts"] }
},
"rules": {
"react/prop-types": "off", //props 오류 해결하기 위해 설정
"@typescript-eslint/no-explicit-any": "off",
"react/react-in-jsx-scope": "on", // react 17부턴 import 안해도돼서 기능 끔 -> 오류 해결하려고 다시 on으로 변경
// 경고표시, 파일 확장자를 .ts나 .tsx 모두 허용함
"react/jsx-filename-extension": ["warn", { "extensions": [".ts", ".tsx"] }],
"react/function-component-definition": [
2,
{ "namedComponents": ["arrow-function", "function-declaration"] }
],
"sort-imports": [
"error",
{
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": false
}
],
"import/order": [
"error",
{
"groups": [
["builtin", "external"],
"internal",
["parent", "sibling"],
"index",
"object"
],
"pathGroups": [
{
"pattern": "~/**",
"group": "external",
"position": "before"
},
{ "pattern": "@*", "group": "external", "position": "after" },
{ "pattern": "@*/**", "group": "external", "position": "after" }
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}