๋ฐ˜์‘ํ˜•

no-extra-boolean-cast error 1

[TypeScript] Error: Redundant double negation. no-extra-boolean-cast ์˜ค๋ฅ˜ ์›์ธ ๋ฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์‚ฌ์šฉ ์ค‘ ๋‹ค์Œ์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. Error: Redundant double negation. no-extra-boolean-cast {text} Why ์œ„ ์—๋Ÿฌ๋Š” ESLint์˜ no-extra-boolean-cast ๊ทœ์น™์œผ๋กœ, ๋ถˆํ•„์š”ํ•œ ๋ถˆ๋ฆฌ์–ธ ์บ์ŠคํŠธ(๋ถˆ๋ฆฐ ๊ฐ’์„ ๊ฐ•์ œ๋กœ ์บ์ŠคํŒ…ํ•˜๋Š” ๊ฒƒ)๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•œ ๊ทœ์น™์ž…๋‹ˆ๋‹ค. ํ˜„์žฌ !!visible์™€ ๊ฐ™์€ ํ˜•ํƒœ๋กœ ๋ถˆ๋ฆฐ ๊ฐ’์„ ๊ฐ•์ œ๋กœ ์บ์ŠคํŒ…ํ•˜๊ณ  ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฏธ ๋ถˆ๋ฆฌ์–ธ ๊ฐ’์ด ์กด์žฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ด์ค‘ ๋ถ€์ • ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ถˆ๋ฆฌ์–ธ ๊ฐ’์ด ๋  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. How to solve ๋”ฐ๋ผ์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์ด์ค‘ ๋ถ€์ • ์—ฐ์‚ฐ์ž๋ฅผ ์ œ๊ฑฐํ•˜๋ฉด ESLint ์—๋Ÿฌ๊ฐ€ ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค. visible ์ž์ฒด๋ฅผ ์‚ฌ์šฉํ•ด๋„ ๋™์ผํ•œ ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. {text}

๋ฐ˜์‘ํ˜•