-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
executable file
ยท86 lines (86 loc) ยท 3.61 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
{
"env": {
"browser": true,
"node": true,
"es6": true
// "es2021": true
},
"extends": [
// "next", "react" ์ถฉ๋ ERROR
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended", // ์ถ๊ฐ
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended", // ์ถ๊ฐ
"plugin:jsx-a11y/recommended", // ์ถ๊ฐ
"plugin:react-hooks/recommended" // ์ถ๊ฐ
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest", // ์ฌ์ฉํ ECMAScript ๋ฒ์ ์ ์ค์
"sourceType": "module" // parser์ export ํํ๋ฅผ ์ค์
},
"plugins": [
"react",
"react-hooks",
"simple-import-sort",
"prettier",
"jsx-a11y",
"import",
"@typescript-eslint/eslint-plugin"
],
"rules": {
// 0: off 1: warn 2: error ๋ก ํ๊ธฐ ๊ฐ๋ฅ
"indent": ["error", 2, { "SwitchCase": 1 }], // ๋ค์ฌ์ฐ๊ธฐ ๋ช ์นธ? ๊ธฐ๋ณธ 2์นธ์ผ๋ก ํ๋, switch๋ฌธ์์๋ 1์นธ์ผ๋ก ์ง์
"quotes": ["error", "double", { "avoidEscape": true }], // ์๋ฐ์ดํ๊ฐ ์๋ ํ๋ฐ์ดํ๋ฅผ ์ฌ์ฉ
"semi": ["error", "always"], // semi colon์ ๊ฐ์ ํจ
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"comma-dangle": ["error", "always-multiline"], // ๋ ์ค ์ด์์ ๊ฒฝ์ฐ์๋ ํํ ์ผํ๋ฅผ ํญ์ ์ฌ์ฉ, ํ ๊ฐ ์ผ ๋๋ ์ฌ์ฉํ์ง ์์
"object-curly-spacing": ["error", "always"], // ๊ฐ์ฒด ๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐ
"space-in-parens": ["error", "never"], // ์ผ๋ฐ ๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐ
"computed-property-spacing": ["error", "never"], // ๋๊ดํธ ์ ๋ค ๊ณต๋ฐฑ ์ถ๊ฐํ์ง ์์
"comma-spacing": ["error", { "before": false, "after": true }], // ๋ฐ์ ์ ๋ค ๊ณต๋ฐฑ: ์์๋ ์๊ณ , ๋ค์๋ ์๊ฒ
"eol-last": ["error", "always"], // line์ ๊ฐ์ฅ ๋ง์ง๋ง ์ค์๋ ๊ฐํ ๋ฃ๊ธฐ
"no-tabs": ["error", { "allowIndentationTabs": true }], // \t์ ์ฌ์ฉ์ ๊ธ์งํ๊ณ tabํค์ ์ฌ์ฉ์ ํ์ฉ
"object-shorthand": "error", // ๊ฐ์ฒด์ ๊ฐํธ ์ฌ์ฉ(es6)์ ๊ฐ์ ํ ๊ฒ์ธ๊ฐ? -> https://eslint.org/docs/rules/object-shorthand
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
}
],
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "off", // Checks effect dependencies
"react/react-in-jsx-scope": "off", // import React from "react"๊ฐ ํ์์๋ ์๊ธฐ์ ํ์ํ ๊ท์น
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/no-named-as-default": 0, // default๋ก ์ ์๋์ง ์์ ์์ด๋ค์ ๋ถ๋ฌ์์์ ์๋ ค์ค
"@typescript-eslint/no-empty-function": "off", // ๋น ํจ์ ์ค์ฝํ ์๋ฌ ์ ๊ฑฐ
"@typescript-eslint/no-unused-vars": ["warn", { "caughtErrors": "none" }], // no-unused-vars๊ฐ ์๋ ํ์ค ์ ์ฉ์ผ๋ก ๋ฐ๊ฟ์ผ interface ์ ์ธ ๋ฑ์ ์ํฉ๋ ๊ณ ๋ คํด์ค
"jsx-a11y/no-autofocus": "off" // autoFocus ํ์ฉ
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"import/parsers": {
// ์ถ๊ฐ
"@typescript-eslint/parser": [".ts", ".tsx", ".js"]
}
}
}