Tslint: Strict๋ฅผ ํ™œ์„ฑํ™”ํ•˜์—ฌ "--strictNullChecks ์—†์ด๋Š” strict-type-predicates๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์Œ" ๊ฐ€์ ธ์˜ค๊ธฐ

์— ๋งŒ๋“  2017๋…„ 10์›” 19์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: palantir/tslint

๋ฒ„๊ทธ ์‹ ๊ณ 

  • __TSLint ๋ฒ„์ „__: 5.7.0
  • __TypeScript ๋ฒ„์ „__: 2.5.3
  • ____๋ฅผ ํ†ตํ•ด TSLint ์‹คํ–‰ํ•˜๊ธฐ: CLI

๋‚ด๊ฐ€ ๋„๋ง tslint -p . w ์ผ์„ธ /์— tsconfig.json ๊ฐ€์žˆ๋‹ค "strict": true ,ํ•˜์ง€๋งŒ์ด ๋ฌด์—‡์ž…๋‹ˆ๊นŒ :

strict-type-predicates does not work without --strictNullChecks

#2786์—์„œ ์ด๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‚ด๊ฐ€ ๋ญ”๊ฐ€๋ฅผ ๋†“์น˜๊ณ  ์žˆ์Šต๋‹ˆ๊นŒ?

Not A Bug

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

strict ์€ compilerOption ์ด๋ฉฐ tsconfig.json์˜ ์ตœ์ƒ์œ„ ์ˆ˜์ค€์—์„œ ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

{
    "compilerOptions": {
        "strict": true
    }
}

๋ชจ๋“  3 ๋Œ“๊ธ€

์˜ˆ๋ฅผ ๋“ค์–ด https://github.com/cretz/awss/tree/05eb0c7adb22fb4feab92c1f190a752f8cfec921 , cd ๋ฅผ proj ๋ณต์ œํ•˜๊ณ  npm run lint

strict ์€ compilerOption ์ด๋ฉฐ tsconfig.json์˜ ์ตœ์ƒ์œ„ ์ˆ˜์ค€์—์„œ ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

{
    "compilerOptions": {
        "strict": true
    }
}

๋‚ด ์‹ค์ˆ˜, ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰