๋ฐ˜์‘ํ˜•

๐Ÿ‘ฟ ์—๋Ÿฌ์ƒํ™ฉ

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๋กœ ๋ณ€๊ฒฝ
๋ฐ˜์‘ํ˜•

+ Recent posts