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

fix: Update types.ts to comply with TS isolatedModules #78

Merged
merged 2 commits into from
Aug 30, 2023
Merged

fix: Update types.ts to comply with TS isolatedModules #78

merged 2 commits into from
Aug 30, 2023

Conversation

asbermudez
Copy link
Contributor

With the current export the module can produce a runtime error as we're trying to export types as if they were actual runtime elements. For this reason Typescript warns about it if the isolatedModules property is set.

https://www.typescriptlang.org/tsconfig#isolatedModules

Here an example of the current error using latest version of Nuxt (3.7.0)
image

@ijkml
Copy link
Owner

ijkml commented Aug 30, 2023

Hello @asbermudez, thank you for this!

Copy link
Owner

@ijkml ijkml left a comment

Choose a reason for hiding this comment

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

Thanks again for this. I see that you have changed the exports to per-line exports. End-of-file exports seem easier to scan and maintain.

If you are open to it, can we revert to

export type {
// ...
}

@asbermudez
Copy link
Contributor Author

@ijkml changed ;)

@ijkml
Copy link
Owner

ijkml commented Aug 30, 2023

Thank you!

@ijkml ijkml merged commit e337822 into ijkml:main Aug 30, 2023
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