|
2 | 2 | "env": {
|
3 | 3 | "browser": true,
|
4 | 4 | "es6": true,
|
| 5 | + |
5 | 6 | "node": true
|
6 | 7 | },
|
7 | 8 | "parser": "@typescript-eslint/parser",
|
|
27 | 28 | "rules": {
|
28 | 29 | "react/function-component-definition": "off",
|
29 | 30 | // ์ด ํจ์ํ ์ปดํฌ๋ํธ๋ฅผ ์ด๋ค ํจ์ ์ ํ์ผ๋ก ์ฌ์ฉํ ์ง ๋ฏธ๋ฆฌ ์ ํ๊ณ 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"์ผ๋ก ๋์ฒด |
60 | 85 | },
|
61 | 86 | "settings": {
|
62 | 87 | "import/parsers": {
|
|
0 commit comments