Skip to content

fix: JSON modules disable named exports#13031

Merged
fisker merged 1 commit intoprettier:mainfrom
JLHwung:fix-import-assertions-re-export
Jun 21, 2022
Merged

fix: JSON modules disable named exports#13031
fisker merged 1 commit intoprettier:mainfrom
JLHwung:fix-import-assertions-re-export

Conversation

@JLHwung
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants