Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip type checking for modules outside of user's control #9704

Closed
KSXGitHub opened this issue Mar 6, 2021 · 4 comments
Closed

Skip type checking for modules outside of user's control #9704

KSXGitHub opened this issue Mar 6, 2021 · 4 comments
Labels
declined thank you, but respectfully declined

Comments

@KSXGitHub
Copy link
Contributor

KSXGitHub commented Mar 6, 2021

Yesterday, someone reported that deno.land/x/[email protected] stopped working on Deno 1.8.0. The cause for this bug is that the TypeScript version that Deno uses no longer infer generic argument correctly (in the past, new Set() would give Set<T>, but the new TypeScript gives Set<unknown>).

I know that this problem is outside of Deno's control. However, surprise breaking change is not a desirable behaviour. As such, Deno must minimize unintentional breaking change that may cause by upgrading TypeScript. One way to do it is to stop checking for type correctness of the implementation part of third-party modules.

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Mar 6, 2021

Can you get type information without type checking, for an arbitrary segment of the module graph?

Ref #5460.

@KSXGitHub
Copy link
Contributor Author

KSXGitHub commented Mar 6, 2021

@nayeemrmn Can swc parse and reassemble TypeScript AST? If it can, it is possible to separate declarations from implementation.

@kitsonk kitsonk added the declined thank you, but respectfully declined label Mar 9, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Mar 9, 2021

We can't/won't stop type checking the whole "program". We could consider making the diagnostics non-fatal. I thought we had an issue for it, but we don't, so I created #9737. I think that is the only viable solution.

So this suggestion is respectfully declined.

@kitsonk kitsonk closed this as completed Mar 9, 2021
@cowboyd
Copy link

cowboyd commented Sep 7, 2022

Ran in to this just now, and the current DX feels like a pretty blunt tool: abandon type checking in your project altogether because of a problem in type compatibility with a dependency.

Of the top of my head, it would be nice to be able to

  1. skip type checking on a per module basis.
  2. override type declarations per module.

Is anything like this possible today?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
declined thank you, but respectfully declined
Projects
None yet
Development

No branches or pull requests

4 participants