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

Use type-only import for better verbatimModuleSyntax support #157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alebelcor
Copy link

Hi, I have this weird TypeScript issue where—even though I have excluded node_modules in my tsconfig.json—I get a type error from "htmr" when using tsc.

I'm using verbatimModuleSyntax (documentation) to simplify import elision. The setting comes down to ensuring you use the type modifier when importing types. So I did that in src/types.ts.

I don't think it'd have any negative impact since yarn typecheck ran successfully. But feel free to let me know otherwise.

Thanks for considering!

Copy link

@lakyadam lakyadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like typescript doesn't like this syntax.
This changing it to individual type imports like this:

import React, { type ReactHTML, type ReactSVG, type ReactNode, type ComponentType } from "react";

@alebelcor alebelcor requested a review from lakyadam December 11, 2024 22:53
Copy link

@lakyadam lakyadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good,. Can we get this merged?

@lakyadam
Copy link

Looks good,. Can we get this merged?

@dmfrancisco @greggb @Arcath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants