Skip to content

Commit 198b58d

Browse files
committed
๐Ÿ”ง: eslint ๊ทœ์น™ ์„ค๋ช… ์ถ”๊ฐ€ ๋ฐ arrow-function test ํ™•์ธ
1 parent 5babf5d commit 198b58d

File tree

3 files changed

+59
-35
lines changed

3 files changed

+59
-35
lines changed

โ€Žfront/.eslintrcโ€Ž

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"env": {
33
"browser": true,
44
"es6": true,
5+
56
"node": true
67
},
78
"parser": "@typescript-eslint/parser",
@@ -27,36 +28,60 @@
2728
"rules": {
2829
"react/function-component-definition": "off",
2930
// ์ด ํ•จ์ˆ˜ํ˜• ์ปดํฌ๋„ŒํŠธ๋ฅผ ์–ด๋–ค ํ•จ์ˆ˜ ์œ ํ˜•์œผ๋กœ ์‚ฌ์šฉํ• ์ง€ ๋ฏธ๋ฆฌ ์ •ํ•˜๊ณ  rules์— ๋ช…์‹œํ•ด ๋‘์–ด์•ผ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค. ๋”ฐ๋ผ์„œ ๊ทธ๋ผ์šด๋“œ ๋ฃฐ์ด ๋ช…ํ™•ํ•˜์ง€ ์•Š์œผ๋ฉด ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๊ฒŒ ์ข‹๋‹ค.
30-
"react/react-in-jsx-scope": "off",
31-
"react/jsx-uses-react": "off",
32-
"linebreak-style": 0,
33-
"import/no-dynamic-require": 0,
34-
"import/no-unresolved": 0,
35-
"import/prefer-default-export": 0,
36-
"global-require": 0,
37-
"import/no-extraneous-dependencies": 0,
38-
"jsx-quotes": ["error", "prefer-single"],
39-
"react/jsx-props-no-spreading": 0,
40-
"react/forbid-prop-types": 0,
41-
"react/jsx-filename-extension": [
42-
2,
43-
{ "extensions": [".js", ".jsx", ".ts", ".tsx"] }
44-
],
45-
"import/extensions": 0,
46-
"no-use-before-define": 0,
47-
"@typescript-eslint/no-empty-interface": 0,
48-
"@typescript-eslint/no-explicit-any": 0,
49-
"@typescript-eslint/no-var-requires": 0,
50-
"no-shadow": "off",
51-
"react/prop-types": 0,
52-
"no-empty-pattern": 0,
53-
"no-alert": 0,
54-
"react-hooks/exhaustive-deps": 0,
55-
"prefer-arrow/prefer-arrow-functions": "error"
56-
// "react/function-component-definition": ["error", {
57-
// "named": "function-declaration",
58-
// "unnamed": "arrow-function"
59-
// }]
31+
"react/react-in-jsx-scope": "off", // JSX๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด React๋ฅผ ์ž„ํฌํŠธํ•  ํ•„์š”๊ฐ€ ์—†๋‹ค๊ณ  ESLint์—๊ฒŒ ์•Œ๋ฆผ. React 17๋ถ€ํ„ฐ JSX ๋ณ€ํ™˜์ด ์ž๋™์œผ๋กœ ์ฒ˜๋ฆฌ๋˜๋ฏ€๋กœ ์ด ๊ทœ์น™์„ ๋”.
32+
33+
"react/jsx-uses-react": "off", // JSX์—์„œ React๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋”๋ผ๋„ "React" ๋ณ€์ˆ˜๊ฐ€ ์ •์˜๋˜์ง€ ์•Š์•˜๋‹ค๊ณ  ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š๋„๋ก ์„ค์ •. React 17 ์ดํ›„๋กœ๋Š” JSX์— React๋ฅผ ์ง์ ‘ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋จ.
34+
35+
"linebreak-style": 0, // ์ค„ ๋ฐ”๊ฟˆ ์Šคํƒ€์ผ์— ๋Œ€ํ•œ ๊ทœ์น™์„ ๋น„ํ™œ์„ฑํ™”. ํ”Œ๋žซํผ์— ๋”ฐ๋ผ ์ค„ ๋ฐ”๊ฟˆ ์Šคํƒ€์ผ์„ ๋‹ค๋ฅด๊ฒŒ ๊ฐ•์ œํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ์ด ๊ทœ์น™์„ ๋„๋Š” ๊ฒƒ์œผ๋กœ ์„ค์ •.
36+
37+
"import/no-dynamic-require": 0, // `require()`๋ฅผ ๋™์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”. ๋Ÿฐํƒ€์ž„์—์„œ ๋™์ ์œผ๋กœ ๋ชจ๋“ˆ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๊ฒƒ์„ ํ—ˆ์šฉ.
38+
39+
"import/no-unresolved": 0, // ๋ชจ๋“ˆ ๊ฒฝ๋กœ๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ทœ์น™์„ ๋น„ํ™œ์„ฑํ™”. ๊ฒฝ๋กœ๊ฐ€ ์ž˜๋ชป๋˜์–ด๋„ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š์Œ.
40+
41+
"import/prefer-default-export": 0, // ๋‹จ์ผ `export`๋ฅผ ํ•  ๋•Œ `export default`๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๊ฐ•์ œํ•˜๋Š” ๊ทœ์น™์„ ๋น„ํ™œ์„ฑํ™”. ๋ช…์‹œ์  `export`๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ.
42+
43+
"global-require": 0, // ๋ชจ๋“ˆ์„ ๋™์ ์œผ๋กœ ๋กœ๋“œํ•  ๋•Œ `require()`๋ฅผ ์‚ฌ์šฉํ•˜๋”๋ผ๋„ ๊ฒฝ๊ณ ๋ฅผ ํ‘œ์‹œํ•˜์ง€ ์•Š๋„๋ก ์„ค์ •.
44+
45+
"import/no-extraneous-dependencies": 0, // `package.json`์— ๋ช…์‹œ๋˜์ง€ ์•Š์€ ์˜์กด์„ฑ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”. ์ข…์†์„ฑ์œผ๋กœ `devDependencies`์— ํฌํ•จ๋˜์ง€ ์•Š์€ ๊ฒƒ์„ ์‚ฌ์šฉํ•  ๋•Œ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š์Œ.
46+
47+
"jsx-quotes": ["error", "prefer-single"], // JSX ์†์„ฑ ๊ฐ’์—์„œ ํ•ญ์ƒ ์‹ฑ๊ธ€ ์ฟผํŠธ(`'`)๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๊ฐ•์ œ. ๋”๋ธ” ์ฟผํŠธ(`"`) ๋Œ€์‹  ์‹ฑ๊ธ€ ์ฟผํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋ผ๋Š” ๊ทœ์น™.
48+
49+
"react/jsx-props-no-spreading": 0, // JSX์—์„œ ํ”„๋กœํผํ‹ฐ ์ „ํŒŒ(`{...props}`) ์‚ฌ์šฉ์„ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š๋„๋ก ์„ค์ •.
50+
51+
"react/forbid-prop-types": 0, // `prop-types` ์‚ฌ์šฉ์„ ๊ธˆ์ง€ํ•˜๋Š” ๊ทœ์น™์„ ๋น„ํ™œ์„ฑํ™”. React ์ปดํฌ๋„ŒํŠธ์˜ props์— ๋Œ€ํ•œ ํƒ€์ž… ๊ฒ€์‚ฌ๋ฅผ ์œ„ํ•ด `prop-types`๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ—ˆ์šฉ.
52+
53+
"react/jsx-filename-extension": [
54+
2,
55+
{ "extensions": [".js", ".jsx", ".ts", ".tsx"] }
56+
], // JSX๋ฅผ ํฌํ•จํ•˜๋Š” ํŒŒ์ผ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ํ™•์žฅ์ž๋ฅผ ์„ค์ •. `.js`, `.jsx`, `.ts`, `.tsx` ํŒŒ์ผ์—์„œ JSX๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ—ˆ์šฉ.
57+
58+
"import/extensions": 0, // ํŒŒ์ผ ํ™•์žฅ์ž์— ๋Œ€ํ•œ ๊ทœ์น™์„ ๋น„ํ™œ์„ฑํ™”. `import` ๋ฌธ์—์„œ ํ™•์žฅ์ž๋ฅผ ๋ช…์‹œํ• ์ง€ ์—ฌ๋ถ€์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ํ•˜์ง€ ์•Š์Œ.
59+
60+
"no-use-before-define": 0, // ๋ณ€์ˆ˜๋‚˜ ํ•จ์ˆ˜ ์„ ์–ธ ์ „์— ์‚ฌ์šฉ๋˜๋Š” ๊ฒƒ์„ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š์Œ. ์ฝ”๋“œ์—์„œ ์„ ์–ธ ์ „์— ์‚ฌ์šฉ๋œ ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ํ•˜์ง€ ์•Š์Œ.
61+
62+
"@typescript-eslint/no-empty-interface": 0, // ๋น„์–ด์žˆ๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”. TypeScript์—์„œ ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ๋น„์–ด์žˆ์–ด๋„ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š์Œ.
63+
64+
"@typescript-eslint/no-explicit-any": 0, // `any` ํƒ€์ž… ์‚ฌ์šฉ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”. TypeScript์—์„œ `any` ํƒ€์ž…์„ ์‚ฌ์šฉํ•  ๋•Œ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š์Œ.
65+
66+
"@typescript-eslint/no-var-requires": 0, // TypeScript์—์„œ `require()`๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”.
67+
68+
"no-shadow": "off", // ๋ณ€์ˆ˜ ์ด๋ฆ„์ด ๋‹ค๋ฅธ ์Šค์ฝ”ํ”„์—์„œ ์ด๋ฏธ ์„ ์–ธ๋œ ๋ณ€์ˆ˜๋ฅผ ๋ฎ์–ด์“ฐ๋Š” ๊ฒƒ์„ ๊ฒฝ๊ณ ํ•˜์ง€ ์•Š๋„๋ก ์„ค์ •.
69+
70+
"react/prop-types": 0, // `prop-types` ๊ฒ€์‚ฌ๋ฅผ ๋น„ํ™œ์„ฑํ™”. React ์ปดํฌ๋„ŒํŠธ์—์„œ prop์˜ ํƒ€์ž… ๊ฒ€์‚ฌ๋ฅผ ๊ฐ•์ œํ•˜์ง€ ์•Š์Œ.
71+
72+
"no-empty-pattern": 0, // ๋น„์–ด์žˆ๋Š” ํŒจํ„ด์„ ์‚ฌ์šฉํ•  ๋•Œ ๊ฒฝ๊ณ ๋ฅผ ํ‘œ์‹œํ•˜์ง€ ์•Š์Œ. ์˜ˆ: `const {}`์™€ ๊ฐ™์€ ๋นˆ ๊ฐ์ฒด ๊ตฌ์กฐ ๋ถ„ํ•ด ํ• ๋‹น์„ ํ—ˆ์šฉ.
73+
74+
"no-alert": 0, // `alert()` ์‚ฌ์šฉ์— ๋Œ€ํ•œ ๊ฒฝ๊ณ ๋ฅผ ๋น„ํ™œ์„ฑํ™”. `alert()`์„ ์‚ฌ์šฉํ•ด๋„ ๊ฒฝ๊ณ ๊ฐ€ ํ‘œ์‹œ๋˜์ง€ ์•Š์Œ.
75+
76+
"react-hooks/exhaustive-deps": 0, // React Hooks์˜ `useEffect` ํ›…์— ๋Œ€ํ•œ ์˜์กด์„ฑ ๋ฐฐ์—ด ๊ฒ€์‚ฌ๋ฅผ ๋น„ํ™œ์„ฑํ™”.
77+
78+
"prefer-arrow/prefer-arrow-functions": "error" // ํ•จ์ˆ˜ ์„ ์–ธ ๋Œ€์‹  ํ™”์‚ดํ‘œ ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๊ฐ•์ œ. ํ•จ์ˆ˜ ์„ ์–ธ์„ ํ™”์‚ดํ‘œ ํ•จ์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜๋ผ๋Š” ๊ฒฝ๊ณ .
79+
80+
// "react/function-component-definition": ["error", {
81+
// "named": "function-declaration",
82+
// "unnamed": "arrow-function"
83+
// }]
84+
//"prefer-arrow/prefer-arrow-functions"์œผ๋กœ ๋Œ€์ฒด
6085
},
6186
"settings": {
6287
"import/parsers": {

โ€Žfront/src/App.tsxโ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// import React from 'react';
2-
// import logo from './logo.svg';
3-
// import './App.css';
1+
import MyTest from './MyTest';
42

53
const App = () => {
64
return (
75
<div>
86
<span>test</span>
7+
<MyTest />
98
</div>
109
);
1110
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const myTest = () => {
1+
const MyTest = () => {
22
return (
33
<div>
44
<span>test</span>
55
</div>
66
);
77
};
88

9-
export default myTest();
9+
export default MyTest;

0 commit comments

Comments
ย (0)