You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to update TS in our project from v5.3.3 to v5.4.3. And I noticed several weird things:
When I was switching TS version in VS Code, it wasn't showing any errors. But tsc --noEmit was showing 2 errors. I thought that VS Code was just not ready to support v5.4.3 yet. But the new version comes with v5.4.3 and it still doesn't work correctly.
I run tsc --noEmit. It shows 2 errors. If I open a problematic file and put // @ts-expect-error, it shows only 1 error. But if I remove that line, it instantly shows 0 errors.
This changed between versions 5.4.0-dev.20240218 and 5.4.0-dev.20240219.
5.4.0-dev.20240219 is the first version where I see this problem. I checked @next version which is 5.5.0-dev.20240412 and the error is still there.
Unfortunately, I wasn't able to make a reproducible example due complexity of the code. But both errors are about unknown type where it should be detected just fine.
⏯ Playground Link
No response
💻 Code
No response
🙁 Actual behavior
It doesn't show errors in VS Code
It shows errors in a console. But after applying // @ts-expect-error and removing that line, it shows 0 errors.
🙂 Expected behavior
Errors in VS Code are detected
It shows errors in a console. After applying // @ts-expect-error and removing that line, it shows all previous errors.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
Ok, I was able to reproduce it. Here is a link to StackBlitz. There are 2 main cases:
If you'll open fail.tsx, you won't see any errors in the editor. But if you will run yarn tsc --noEmit in the terminal, you'll see src/fail/fail.tsx:18:22 - error TS2322: Type 'unknown[]' is not assignable to type 'FailedItem[]'.
Start tsc in watch mode: yarn tsc --noEmit --watch. Open fail.tsx and add // @ts-expect-error in any place of the code. Remove this comment. It will show 0 errors in the console.
Also you could notice that there is import '@total-typescript/ts-reset/is-array'; in reset.d.ts. The only thing it's doing is changing any to unknown for Array.isArray. Source code.
React version doesn't really matter. It works the same on v16 and v18.
🔎 Search Terms
"tsc inconsistent behavior", "tsc 0 errors", "ts 5.4 bug", "5.4.0-dev.20240219"
🕗 Version & Regression Information
I wanted to update TS in our project from
v5.3.3
tov5.4.3
. And I noticed several weird things:tsc --noEmit
was showing 2 errors. I thought that VS Code was just not ready to supportv5.4.3
yet. But the new version comes withv5.4.3
and it still doesn't work correctly.tsc --noEmit
. It shows2 errors
. If I open a problematic file and put// @ts-expect-error
, it shows only1 error
. But if I remove that line, it instantly shows0 errors
.This changed between versions
5.4.0-dev.20240218
and5.4.0-dev.20240219
.5.4.0-dev.20240219
is the first version where I see this problem. I checked@next
version which is5.5.0-dev.20240412
and the error is still there.Unfortunately, I wasn't able to make a reproducible example due complexity of the code. But both errors are about
unknown
type where it should be detected just fine.⏯ Playground Link
No response
💻 Code
No response
🙁 Actual behavior
// @ts-expect-error
and removing that line, it shows0 errors
.🙂 Expected behavior
// @ts-expect-error
and removing that line, it shows all previous errors.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: