TypeScript: TypeScript Language Server False Positive Error Reporting
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.87.0
- OS Version: Ubuntu 22.04
Steps to Reproduce:
- Clone the project
git clone https://github.com/DScheglov/res-test.git
- Open the VS Code:
code res-test
- Install dependencies (in terminal):
npm i
- Open file
./src/index.ts
The following errors are shown:
These errors are false positive:
- project is configured to use the same typescript compiler as a project. See
.vscode/settings.json
- project is compiled successfully via terminal:
npx tsc
(no errors) - errors are gone after TS Language Server is restared (
Ctrl + Shift + P
, TypeScript: Restart TS Server) - errors go back after any touch of the file (just add a space).
There is not such problem in WebStorm
(Sorry, I have to check)
Errors are not displayed in the TS Playground as well: Playground
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Reactions: 5
- Comments: 25 (13 by maintainers)
Tracking as https://github.com/Effect-TS/effect is also hit by this
I working on a fix for this, I’ll put something up later this afternoon.
Unfortunately it seems like it doesn’t fix the issue, rather it does but it makes it appear in a different place, the return of the generator
It does appear to be the case only if there is no specified return, adding a
return
keyword makes the issue disappearhttps://github.com/microsoft/TypeScript/issues/57903 doesn’t affect Effect as we don’t use async generators (provided I’ve understood the issue correctly)
Additional repro noted at https://github.com/microsoft/TypeScript/issues/57429#issuecomment-1981202521
I’m not sure how their rule works. If it depends on type information (looks like it does) then that error should go away after we fix this one.
Minimized repro