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: JSON modules disable named exports #13031

Merged
merged 1 commit into from Jun 21, 2022

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jun 20, 2022

Description

Updated the import-assertions js formatter test, as the JSON modules spec disallows named exports. For example, export { foo2 } from "./foo.json" assert { type: "json" } is invalid.

Currently blocking babel/babel#14668. Babel plans to throw named JSON module imports/exports in the future, hence I update the test so the Babel update won't break our tests.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker
Copy link
Sponsor Member

fisker commented Jun 20, 2022

Will it unblock babel PR if we test those in https://github.com/prettier/prettier/tree/main/tests/format/misc/errors?

@JLHwung
Copy link
Contributor Author

JLHwung commented Jun 21, 2022

@fisker Yes that could work, though eventually we have to revise the affected test cases. If you insist I can simply rename the test cases.

@fisker fisker merged commit b0201e0 into prettier:main Jun 21, 2022
@fisker
Copy link
Sponsor Member

fisker commented Jun 21, 2022

Not important.

medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Jan 4, 2024
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.

None yet

2 participants