๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ป DEV/NextJS

[NextJS] EsLint Delete `โ` eslint (prettier/prettier) ์—๋Ÿฌ ํ•ด๊ฒฐํ•˜๊ธฐ

by Rising Oneโ˜… 2023. 3. 9.
728x90
๋ฐ˜์‘ํ˜•
SMALL

EsLint ๋Œ€ํ‘œ์ด๋ฏธ์ง€

 

ํ•„์š”์„ฑ 

Next JS, Nest JS๋ฅผ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด ๊ฐœ๋ฐœ๋‹จ๊ณ„ ์ดˆ๊ธฐ, EsLint๋ฅผ ์„ค์ •ํ•ด์คฌ์Šต๋‹ˆ๋‹ค.(์„ค์ •๋ฐฉ๋ฒ•์€ ๊ธ€ ํ•˜๋‹จ ๋งํฌ ์ฒจ๋ถ€)

ํ˜‘์—…์‹œ, ์ฝ”๋“œ์˜ ํ†ต์ผ์„ฑ๊ณผ ์œ ์ง€๋ณด์ˆ˜ ๋“ฑ์˜ ๋ฌธ์ œ๋ฅผ ์œ„ํ•ด EsLint๋ฅผ ์„ค์ •ํ•œ ๊ฒƒ์— ๊ทธ์น˜์ง€ ์•Š๊ณ  ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์— ๋Œ€ํ•ด์„œ ํ•ด๊ฒฐํ•ด๋ณด๋Š” ์‹œ๊ฐ„์„ ๊ฐ–๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค. Delete `โ` eslint (prettier/prettier) ์—๋Ÿฌ์— ๋Œ€ํ•ด ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.


์ ‘๊ทผ

 

  1. ๋ฐœ์ƒํ•œ ์—๋Ÿฌ ๋ชจ์Šต

 

  2. ์—๋Ÿฌ ํ•ด๊ฒฐ๋ฐฉ์•ˆ ์ œ์‹œ


๋ฐฉ๋ฒ•


  1. ๋ฐœ์ƒํ•œ ์—๋Ÿฌ ๋ชจ์Šต

 

EsLint ์—๋Ÿฌ ๋ฐœ์ƒ๋ชจ์Šต (์ฝ”๋“œ ๋ผ์ธ ๋๋งˆ๋‹ค ๋นจ๊ฐ„ ๋ฐ‘์ค„)

์ฝ”๋”ฉ์„ ํ•˜๋˜ ์ค‘, ๊ฐ ์ฝ”๋“œ๋ผ์ธ ๋์— ๋นจ๊ฐ„๋ฐ‘์ค„์ด ๋ฐœ์ƒํ•˜๋ฉด์„œ (๊ตฌ๋™์€ ๋˜์ง€๋งŒ) ๊ต‰์žฅํžˆ ๋ˆˆ์— ๊ฑฐ์Šฌ๋ฆฌ๋Š” ์ƒํ™ฉ์— ๋…ธ์ถœ๋์Šต๋‹ˆ๋‹ค.  

Delete `โ` eslint (prettier/prettier)

์ •ํ™•ํ•œ ์—๋Ÿฌ๋ช…์นญ์€ ์œ„์™€ ๊ฐ™์ด ์‹๋ณ„์ด ๋์Šต๋‹ˆ๋‹ค.

 

 

  2. ์—๋Ÿฌ ํ•ด๊ฒฐ๋ฐฉ์•ˆ ์ œ์‹œ

 

EsLint๋ฅผ ์ ์šฉํ•˜๊ฒŒ ๋˜๋ฉด, ์šฐ๋ฆฌ๋Š” EsLint์˜ ์„ค์ •ํŒŒ์ผ์ธ .eslintrc.js ํŒŒ์ผ์ด ์ƒ์„ฑ๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

.eslintrc.js ๋‚ด๋ถ€๋กœ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค. 

๋‚ด๋ถ€๋กœ ๋“ค์–ด๊ฐ€๊ฒŒ ๋˜๋ฉด ๋ณด์ด๋Š” ์ฝ”๋“œ๋Š” ์œ„์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋‹ค๋ฅธ ์ฝ”๋“œ๋Š” ๋ณผ ๊ฒƒ ์—†์ด ๋นจ๊ฐ„ ๋„ค๋ชจ ๋ฐ•์Šค(๊ทธ๋ฆผ) ์† rules ์ฝ”๋“œ๋ฅผ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

rules ๋‚ด๋ถ€์— ์ž‘์„ฑ๋˜๋Š” ๋‚ด์šฉ์€,

์šฐ๋ฆฌ๊ฐ€ Eslint๋ฅผ ํ†ตํ•ด ์–ด๋Š ๊ทœ์น™์„ ์ ์šฉ์‹œํ‚ฌ์ง€ "๊ทœ์น™์„ ์ •ํ•ด์ฃผ๋Š” ์—ญํ• ์„ ๋‹ด๋‹นํ•˜๋Š” ์˜์—ญ"์ด๋ผ๊ณ  ๋ณด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

์ด ์˜์—ญ์— ํŒŒ๋ž€ ๋„ค๋ชจ ๋ฐ•์Šค(๊ทธ๋ฆผ)๋กœ endofLine์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๋ฅผ 'auto'๋กœ ํ•ด์ฃผ๋ฉด ์ •์ƒ์ ์œผ๋กœ ์—๋Ÿฌ๊ฐ€ ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค.

 


https://everybodypyeon.tistory.com/entry/NextJS-EsLint-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

(EsLint ์„ค์ •,์ ์šฉํ•˜๊ธฐ)

 

[NextJS] EsLint ์„ค์ •ํ•˜๊ธฐ

ํ•„์š”์„ฑ ํ”„๋กœ์ ํŠธ์— ํ•จ๊ป˜ํ•˜๋Š” ํŒ€์›๋“ค์€ ์ €๋งˆ๋‹ค์˜ ์ฝ”๋”ฉ์Šคํƒ€์ผ์„ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋•Œ๋ฌธ์— ๊ฐ๊ฐ์˜ ์Šคํƒ€์ผ์„ ์šฉ์ธํ•œ ์ฑ„, ํ˜‘์—…์„ ํ•˜๊ฒŒ ๋˜๋ฉด ํ›—๋‚  ์ฝ”๋“œ๋ฅผ ๋ณ‘ํ•ฉํ•˜๋Š” ๊ณผ์ •์—์„œ ์ˆ˜๋งŽ์€ ๊ณจ์นซ๊ฑฐ๋ฆฌ๋ฅผ ์•ˆ์„ ์ˆ˜

everybodypyeon.tistory.com

 

 

 

์ด์ƒ์œผ๋กœ, EsLint ์† "Delete `โ` eslint (prettier/prettier)" ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐ๋ดค์Šต๋‹ˆ๋‹ค.

์ถ”๊ฐ€ ์งˆ๋ฌธ์„ ๋Œ“๊ธ€์„ ๋‹ฌ์•„์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค^^!

์˜ค๋Š˜๋„ ํŒŒ์ดํŒ…์ž…๋‹ˆ๋‹ค! 

728x90
๋ฐ˜์‘ํ˜•
LIST

๋Œ“๊ธ€