-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.json
94 lines (93 loc) ยท 3.97 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
93
94
{
// ์คํ ํ๊ฒฝ ์ค์
"env": {
"browser": true,
"es2021": true,
"node": true,
"es6": true
},
"plugins": ["react", "react-hooks", "@typescript-eslint", "simple-import-sort", "prettier", "import"],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended", //ํ์
์คํฌ๋ฆฝํธ์ ์ถฉ๋ํ๋ ๊ท์น ๋นํ์ฑํ, ํธํ์ฑ ์ ์ง
"plugin:@typescript-eslint/recommended", //ํ์
์คํฌ๋ฆฝํธ ๊ท์น ์ ์ฉ
"plugin:react-hooks/recommended", // react-hooks ๊ท์น ์ ์ฉ
"plugin:prettier/recommended", // eslint, prettier ์ค๋ณต๋๋ ๊ท์น์ ๋นํ์ฑํ.
"plugin:import/recommended", // import ๊ด๋ จ ๊ท์น์ ์ ์ฉ
"plugin:import/typescript", //typescript์์ import ๊ด๋ จ ๊ท์น์ ์ ์ฉํ ์ ์๊ฒ ์ง์
"plugin:@tanstack/eslint-plugin-query/recommended" // eslint-plugin-query ๊ท์น ์ ์ฉ
],
"rules": {
"@typescript-eslint/no-unused-vars": "warn",
"indent": ["warn", 2], // ๋ค์ฌ์ฐ๊ธฐ 2์นธ
"quotes": ["off", "single"], // ์๋ฐ์ดํ๊ฐ ์๋ ํ๋ฐ์ดํ๋ฅผ ์ฌ์ฉ
"semi": ["warn", "always"], // semi colon๊ฐ์
"no-multiple-empty-lines": ["warn", { "max": 1, "maxEOF": 0 }],
"no-multi-spaces": "warn", // ์คํ์ด์ค ์ฌ๋ฌ๊ฐ ๊ธ์ง
"object-curly-spacing": ["warn", "always"], // ๊ฐ์ฒด ๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐ
"space-in-parens": ["warn", "never"], // ์ผ๋ฐ ๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐ
"computed-property-spacing": ["warn", "never"], // ๋๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐํ์ง ์์
"comma-spacing": ["warn", { "before": false, "after": true }], // ๋ฐ์ ์ ๋ค ๊ณต๋ฐฑ: ์์๋ ์๊ณ , ๋ค์๋ ์๊ฒ
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "off", // Checks effect dependencies
"simple-import-sort/imports": "warn", //import ์ ๋ ฌ ๊ฐ์
"simple-import-sort/exports": "warn", //export ์ ๋ ฌ ๊ฐ์
"react/react-in-jsx-scope": "off", // import React from "react"๊ฐ ํ์์๋ ์๊ธฐ์ ํ์ํ ๊ท์น์ด๋ฏ๋ก off
"no-unused-vars": "warn",
"no-console": "warn"
},
"overrides": [
//import ์ ๋ ฌ ๋ฐฉ์ ์ฌ์ ์
//react, next, packages, @, ~, ../, ./, style, side effect ์์ผ๋ก ์ ๋ ฌ
{
"files": ["**/*.js", "**/*.ts", "**/*.tsx"],
"rules": {
"simple-import-sort/imports": [
"error",
{
"groups": [
// react๋ฅผ ๋จผ์ ์ ๋ ฌ, ๊ทธ ๋ค์ ์๋ฌธ์๋ก ์์ํ๋ ๋ค๋ฅธ ๋
ธ๋ ๋ชจ๋ ์ ๋ ฌ
["^react$", "^[a-z]"],
// `@`๋ก ์์ํ๋ ํจํค์ง ์ ๋ ฌ. @material-ui ๊ฐ์
["^@"],
// Packages starting with `~`
["^~"],
// Imports starting with `../` ์์ ๋๋ ํ ๋ฆฌ
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Imports starting with `./` ํ์ฌ ๋๋ ํ ๋ฆฌ
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
//css, scss ํ์ผ ์ ๋ ฌ
["^.+\\.s?css$"],
// ์ฌ์ด๋ ์ดํํธ ํ์ผ ์ ๋ ฌ
["^\\u0000"]
]
}
]
}
}
],
"parser": "@typescript-eslint/parser", //eslint๊ฐ typescript๋ฅผ ์ดํดํ ์ ์๊ฒ ํด์ค
"parserOptions": {
"ecmaFeatures": {
"jsx": true //jsx์ง์
},
"ecmaVersion": "latest", //์ต์ ecmascript ์ฌ์ฉ
"sourceType": "module" //ecmascript ๋ชจ๋ ์ฌ์ฉ
},
"settings": {
//eslint-plugin-import๊ฐ ๋ชจ๋ ํด์ํ ๋ ์ด๋ป๊ฒ ๊ฒฝ๋ก๋ฅผ ์ฐพ์์ง ์ค์
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "src/"], //๋ชจ๋์ ์ฐพ์ ๋ node_modules, src/์์ ์ฐพ์
"extensions": [".js", ".jsx", ".ts", ".tsx", ".d.ts"] //์ธ์ํ ํ์ฅ์ ์ค์
}
},
"react": {
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx", ".js"] //ts, tsx, js ํ์ผ์ ํ์ฑํ ๋ ์ฌ์ฉํ parser ์ค์
}
}
}