๋ฐ์ํ
๐ฟ ์๋ฌ์ํฉ
eslint prettier ์ค๋ฐ๊ฟ ์๋ฌ ์์ฐฝ………
ERROR in [eslint]
src\\App.tsx
Line 1:26: Delete `โ` prettier/prettier
Line 2:30: Delete `โ` prettier/prettier
Line 3:19: Delete `โ` prettier/prettier
Line 4:1: Delete `โ` prettier/prettier
Line 5:41: Delete `โ` prettier/prettier
Line 6:39: Delete `โ` prettier/prettier
Line 7:1: Delete `โ` prettier/prettier
Line 8:35: Delete `โ` prettier/prettier
Line 9:17: Delete `โ` prettier/prettier
Line 10:11: Delete `โ` prettier/prettier
Line 11:38: Delete `โ` prettier/prettier
Line 12:38: Delete `โ` prettier/prettier
Line 13:59: Delete `โ` prettier/prettier
Line 14:12: Delete `โ` prettier/prettier
Line 15:60: Delete `โ` prettier/prettier
Line 16:13: Delete `โ` prettier/prettier
Line 17:11: Delete `โ` prettier/prettier
Line 18:31: Delete `โ` prettier/prettier
Line 19:37: Delete `โ` prettier/prettier
Line 20:26: Delete `โ` prettier/prettier
Line 21:36: Delete `โ` prettier/prettier
Line 22:10: Delete `โ` prettier/prettier
Failed to compile.
๐ง ์๋ฌ ์์ธ
Git ์ค์ ๊ณผ VSCode ์ค์ ์ด ์๋ก ์ถฉ๋ํ๊ธฐ ๋๋ฌธ์ ์๋ฌ ๋ฐ์. "files.eol": "\n" ์ค์ ์ด ์ด๋ฏธ VSCode์ ์์์ง๋ง, Git์ด ์ค ๋ฐ๊ฟ ํ์์ ์๋์ผ๋ก ๋ณํํ๋ ์ค์ (core.autocrlf)์ด ํ์ฑํ๋ ์ํ์๊ธฐ ๋๋ฌธ์ ๋ฐ์ํ ๋ฌธ์
โจ ์๋ฌ ํด๊ฒฐ
โ Git ์ค์ ์ ๋ฐ์ดํธ
Windows์์ CRLF๊ฐ ๊ธฐ๋ณธ ์ค ๋ฐ๊ฟ์ด ๋์ง ์๋๋ก ๋ค์ ๋ช ๋ น์ด๋ก Git ์ค์ ์ ์ ๋ฐ์ดํธํฉ๋๋ค.
# ํ๋ก์ ํธ ๋ก์ปฌ์์ ์คํ
git config core.autocrlf false
# ๊ธ๋ก๋ฒ ์ค์ ์ ์
๋ฐ์ดํธํ๋ ๊ฒฝ์ฐ
git config --global core.autocrlf false
- ๋ชจ๋ ํ์ผ LF๋ก ๋ณํ
# Windows ํ๊ฒฝ์์ Git Bash ๋๋ WSL ์ฌ์ฉ ์
git ls-files -z | xargs -0 dos2unix
::์ฐธ๊ณ ::
Prettier ๋ฐ ESLint ๊ฐ์ ์ ์ฉ
npx prettier --write .
yarn eslint --fix .
VSCode์์ ์ค ๋ฐ๊ฟ ์ผ๊ด ๋ณ๊ฒฝ
- ๋ช ๋ น ํ๋ ํธ(Ctrl+Shift+P)์์ “Change All End Of Line Sequence”๋ฅผ ์ ํํ๊ณ , LF๋ก ๋ณ๊ฒฝ
๋ฐ์ํ
'๐ฉโ๐ป hello, world! > react' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
date-fns ๋ผ์ด๋ธ๋ฌ๋ฆฌ (1) | 2024.11.12 |
---|---|
JSON Server ์ฌ์ฉ (1) | 2024.11.05 |
[error] es lint error - Unknown options: extensions, resolvePluginsRelativeTo - 'extensions' has been removed. (0) | 2024.11.05 |
[error] Yarn Berry ํ๋ก์ ํธ ํ๊ฒฝ ์ค์ ์ค .yarn/cache ์์ฑ๋์ง ์๋ ๋ฌธ์ (0) | 2024.11.05 |
React + Yarn Berry(PnP) ํ๊ฒฝ์ค์ 2 (0) | 2024.11.04 |