microsoft/TypeScript

TypeScript CLI reporting far fewer errors than VS Code for the same project and TypeScript version

Closed this issue ยท 1 comments

๐Ÿ”Ž Search Terms

cli
fewer
errors
vscode
stops

๐Ÿ•— Version & Regression Information

This behavior seems to exist for all versions I tested, from 4.9.3

โฏ Playground Link

https://github.com/agyemanjp/tsc-possible-bug-repro

๐Ÿ’ป Code

This is the error line that seems to break tsc:
type AuthorizationCtx<M extends R extends StdRecord = StdRecord> = {...

๐Ÿ™ Actual behavior

  1. Clone the test repository and install its system dependencies
  2. Run pnpm run tscheck at the project root to type check the code. Note the error(s)
  3. Open a new VS Code window, and open the project root and all the source files in it.
  4. Verify that the VS Code window is using the same Typescript version as is installed for the project
  5. In the same VS Code window, click the menu item: View -> Problems. Note the type error(s)

There is a discrepancy in the error list between 2 and 5

๐Ÿ™‚ Expected behavior

The tsc comand and VS Code should produce the same error list for the same project config using the same Typescript version.

Additional information about the issue

It seems tsc stops reporting errors after encountering some errors that break it.

tsc intentionally stops on syntax errors, since it's relatively uncommon to go to commandline when you have a syntax error, and the type errors that would follow aren't likely to be useful (you almost certainly need to fix the syntax error first before any other analysis is good)

VS Code is showing errors from all open files regardless of other status, since it's not obvious which file you're currently "looking at"

Both behaviors make sense and nothing would be gained by making one situationally worse just to match the other's arity