Skip to content

Fix errors with verbatimModuleSyntax #503

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ozanmakes
Copy link
Contributor

@ozanmakes ozanmakes commented Nov 11, 2023

This pull request fixes errors that occur when verbatimModuleSyntax is enabled in tsconfig.json. The affected types now use type-only import syntax.

Screenshot 2023-11-11 at 13 36 55

I get similar errors in my app code because my VSCode is set to display all workspace errors with typescript.tsserver.experimental.enableProjectDiagnostics

With verbatimModuleSyntax set to true in tsconfig.json, library users
get errors like this:

> 'Fetch' is a type and must be imported using a type-only import when
> 'verbatimModuleSyntax' is enabled.

This commit fixes the errors by using type-only import syntax for the
affected types.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant