PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.16k stars 351 forks source link

[BUG] Unexpected typescript behaviour #822

Closed Aniket-IN closed 6 months ago

Aniket-IN commented 10 months ago

What happened?

Hi 👋, I noticed a a weird behaviour while using typescript. Basically with the below code:

const foo: string | null = null

I was expecting that vscode would treat foo as string or null But, it just treats as string

image

Not sure, why this is happening. Initially I thought something wrong with my config. Then, I did a fresh install of the with-nextjs example. Same with that as well.

Version

Latest

What OS are you seeing the problem on?

Windows

What browsers are you seeing the problem on?

No response

Relevant log output

No response

(OPTIONAL) Contribution

Code of Conduct

mathieudutour commented 10 months ago

You need to add "strictNullChecks": true, in your tsconfig.json