[ESLint] The react-srcipts package provided by Create React App requires a dependency :: ์˜์กด์„ฑ ๋ฌธ์ œ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 14:42

์˜์กด์„ฑ ์—๋Ÿฌ ํ•ด๊ฒฐ ์—๋Ÿฌ ๋ฐœ์ƒ ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋‹ค. CRA๊ฐ€ ์ œ๊ณตํ•˜๋Š” react-scripts ํŒจํ‚ค์ง€๊ฐ€ eslint 6.6.0 ๋ฒ„์ „์— ์˜์กดํ•˜๋Š”๋ฐ, 7.2.0 ๋ฒ„์ „์„ ์„ค์น˜ํ•ด์„œ ๊ทธ๋ ‡๋‹ค๊ณ  ํ•œ๋‹ค. ์ € ๋ฐ‘์— ๋‚˜์˜ค๋Š” ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”๋ฐ, ๋”ฐ๋ผํ•ด๋„ ํ•ด๊ฒฐ๋˜์ง€ ์•Š๋Š”๋‹ค ใ…Ž... ์ €๋ฒˆ์—๋„ ๊ฐ™์€ ๋ฌธ์ œ๋กœ ์†์ฉ์—ฌ์„œ ์ด๋ฒˆ์—” ์ œ๋Œ€๋กœ ๊ฐ์žก๊ณ  ํ•ด๊ฒฐํ•ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค. ์ด์œ  ๋ฐœ๊ฒฌ ์ด์œ ๋Š” ๊ตฌ๊ธ€๋งํ•˜๋‹ค๊ฐ€ ๋ฐœ๊ฒฌํ–ˆ๋Š”๋ฐ(https://github.com/wesbos/eslint-config-wesbos/issues/17) , react-scripts์˜ eslint ์˜์กด์„ฑ ๋ฒ„์ „๊ณผ airbnb linting์—์„œ์˜ eslint ์˜์กด์„ฑ ๋ฒ„์ „์ด ์ผ์น˜ํ•˜์ง€ ์•Š์•„์„œ ๋‚˜์˜ค๋Š” ๋ฌธ์ œ์˜€๋‹ค. ๋ป˜์ง“ ๊ทธ๋ž˜์„œ ์ผ๋‹จ react-scripts version์„ `npm view react-s..

[ESLint] createRequire is not a function Referenced from: ...
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 12:26

VScode์—์„œ eslint๊ฐ€ ์ ์šฉ์ด ์•ˆ๋˜๊ณ  ์ž๊พธ ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ๋œจ๊ธธ๋ž˜ ๊ฒ€์ƒ‰ํ•ด๋ดค๋‹ค. ๋ฒ„์ „์ด ์•ˆ ๋งž์•„์„œ ๊ทธ๋Ÿฐ ๊ฒƒ์ด๋‹ˆ VScode๋ฅผ ๋‹ค์‹œ ๊น”๋ฉด ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋˜๋ฉด์„œ eslint๊ฐ€ ์ž˜ ๋œ๋‹ค. ๋‹ค์šด๋กœ๋“œ : code.visualstudio.com/download ์ฐธ๊ณ  : https://github.com/typescript-eslint/typescript-eslint/issues/2020

[eslint] Error: Unexpected token 'export'
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 11. 21. 21:46

์ฐธ๊ณ  : https://hoilzz.github.io/webpack/11-eslint-prettier/ eslint์˜ parser๊ฐ€ ๊ณต์‹์ ์œผ๋กœ ES ํ‘œ์ค€๋งŒ์„ ์ง€์›ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ES6~7 ํŒŒ์‹ฑ ์‹œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธด๋‹ค. ๋”ฐ๋ผ์„œ, .eslintrc.js ํŒŒ์ผ์˜ export default๋ฅผ module.export๋กœ ๋ณ€๊ฒฝํ•˜๊ธฐ export๋Š” ES6 syntax์ด๊ณ , module export๋Š” commonJS syntax์ด๋‹ค. babel-eslint ์„ค์น˜ ํ›„ .eslintrc.js์— "parser": "babel-eslint",์ถ”๊ฐ€ํ•˜๊ธฐ ๋‘ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.