Skip to content

Add noCheck API option#57934

Merged
weswigham merged 23 commits intomicrosoft:mainfrom
weswigham:nocheck
Apr 26, 2024
Merged

Add noCheck API option#57934
weswigham merged 23 commits intomicrosoft:mainfrom
weswigham:nocheck

Conversation

@weswigham
Copy link
Copy Markdown
Member

@weswigham weswigham commented Mar 25, 2024

This PR adds noCheck, a compiler option which instructs the compiler to skip the semantic diagnostics phase. This means the compiler skips right form program construction, parsing, and binding, to emit. Implementation-wise, the basically just considers every file the same way we do declaration files under skipLibCheck, or project reference redirects.

As-is, there are some limitations on this - declaration emit works wonderfully already - every test with declaration emit on also tests declaration emit with noCheck, while JS emit needs some functionality disentangled from the checker's full-tree-error-walk to consistently work with this. As such, noCheck requires emitDeclarationOnly for now. (This limitation could be lifted with some additional work to make a lazy version of the .referenced node links calculations in checker, and by making lazy versions of all the calculations implied by the getNodeCheckFlags calls in the JS transforms - which would be required to do #50699 and for this to fulfill #29651) Additionally, passing noCheck alongside noEmit is an error - there's nothing wrong with this combination of options, it just seems like it doesn't do anything.

noCheck is not currently exposed on the commandline or to tsconfig files, and is an internal API, as there was some concern at the design meeting that it might need to change a bit when we add support for JS emit to it.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants