basarat / typescript-book

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹
https://basarat.gitbook.io/typescript/
Other
20.87k stars 2.56k forks source link

Hi,I have a question about ts equal check. #683

Open AaronConlon opened 1 year ago

AaronConlon commented 1 year ago

image I use bunjs to exec a ts file:

console.log('1' == 1)

TypeScript will not throw error.So, is your description is right? thanks.

plbstl commented 1 year ago

Yes, the description is correct.

When executing a TS file, Bunjs doesn't check the file for typescript errors.

See: https://bun.sh/docs/runtime/typescript#running-ts-files

Note — Similar to other build tools, Bun does not typecheck the files. Use tsc (the official TypeScript CLI) if you're looking to catch static type errors.