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

Mismatch in types between @swc/types and @swc/core for jsc.experimental.keepImportAssertions #9687

Closed
Llois41 opened this issue Oct 29, 2024 · 1 comment · Fixed by #9691
Closed
Assignees
Labels
Milestone

Comments

@Llois41
Copy link

Llois41 commented Oct 29, 2024

Describe the bug

The @swc/types package provides different typings for the jsc.experimental config option.

The types package provide keepImportAttributes (https://github.com/swc-project/swc/blob/main/packages/types/index.ts#L642) while the docs state keepImportAssertions (https://swc.rs/docs/configuration/compilation#jscexperimentalkeepimportassertions).

Also if you search in the repo, both variants occur: https://github.com/search?q=repo%3Aswc-project%2Fswc%20keepimport&type=code

Using keepImportAssertions seems to work but fails the type-checking.

Input code

No response

Config

No response

Playground link (or link to the minimal reproduction)

SWC Info output

No response

Expected behavior

Would be nice to have docs, code and types using the same name for this option.

Actual behavior

No response

Version

1.7.36

Additional context

No response

@Llois41 Llois41 added the C-bug label Oct 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
@swc-project swc-project deleted a comment from github-actions bot Oct 29, 2024
@kdy1 kdy1 removed the invalid link label Oct 29, 2024
@swc-project swc-project unlocked this conversation Oct 29, 2024
@kdy1 kdy1 reopened this Oct 29, 2024
@kdy1 kdy1 added this to the Planned milestone Oct 30, 2024
@kdy1 kdy1 self-assigned this Oct 30, 2024
@kdy1 kdy1 closed this as completed in 4b4dcfa Oct 30, 2024
@kdy1 kdy1 modified the milestones: Planned, v1.7.41 Oct 31, 2024
@Llois41
Copy link
Author

Llois41 commented Nov 5, 2024

@kdy1 thanks for the fix. It seems, that the swc/types package still has to be updated since that is where the types are provided for the @swc/core package. This does not seem to have been triggered automatically so this fix still has no effect.

Could you please release a new swc/types package version? :)

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

Successfully merging a pull request may close this issue.

2 participants