๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

"ESLint" ํƒœ๊ทธ๋กœ ์—ฐ๊ฒฐ๋œ 1๊ฐœ ๊ฒŒ์‹œ๋ฌผ๊ฐœ์˜ ๊ฒŒ์‹œ๋ฌผ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋ชจ๋“  ํƒœ๊ทธ ๋ณด๊ธฐ

ยท ์•ฝ 2๋ถ„

ESLint#

  • ํฌ๋งทํŒ…

  • ์ฝ”๋“œ ํ’ˆ์งˆ

๊ทœ์น™#

rules ๋กœ ์ถ”๊ฐ€ ๊ฐ€๋Šฅ

  • ์ž๋™์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๊ทœ์น™๊ณผ ๊ทธ๋ ‡์ง€ ์•Š์€ ๊ทœ์น™์ด ์žˆ์Œ.

  • ๊ทœ์น™ ๋ชฉ๋ก ์ค‘ ๋ Œ์น˜ ๊ธฐํ˜ธ๊ฐ€ ๋ถ™์€ ๊ฒƒ์ด ์ž๋™์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๊ทœ์น™

  • --fix ์˜ต์…˜์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

List of available rules

Extends#

  • ์—ฌ๋Ÿฌ ๊ทœ์น™์„ ๋ชจ์•„๋†“์€ ๊ฒƒ๋“ค

  • eslint:recommended , eslint-config-airbnb-base , eslint-config-standard ๋“ฑ์ด ์žˆ๋‹ค.

init#

--init ์˜ต์…˜์œผ๋กœ ๋Œ€ํ™”์‹์œผ๋กœ ์„ค์ • ๊ฐ€๋Šฅ

npx eslint --init
? How would you like to use ESLint?? What type of modules does your project use?? Which framework does your project use?? Where does your code run?? How would you like to define a style for your project?? Which style guide do you want to follow?? What format do you want your config file to be in?

Prettier์™€์˜ ํ†ตํ•ฉ#

Integrating with Linters ยท Prettier

Create-React-App with TypeScript, ESLint, Prettier, and Github Actions