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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 11 additions & 11 deletions tests/format/js/import-assertions/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -177,27 +177,27 @@ assert({ type: "json" });
`;

exports[`re-export.js [acorn] format 1`] = `
"Unexpected token (1:33)
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
"Unexpected token (1:44)
> 1 | export { default as foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
`;

exports[`re-export.js [espree] format 1`] = `
"Unexpected token assert (1:33)
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
"Unexpected token assert (1:44)
> 1 | export { default as foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
`;

exports[`re-export.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:38)
> 1 | export { foo2 } from "foo.json" assert { type: "json" };
| ^
"Unexpected token: 'identifier' (1:49)
> 1 | export { default as foo2 } from "foo.json" assert { type: "json" };
| ^
2 | export * from "foo.json" assert { type: "json" };
3 | export * as foo3 from "foo.json" assert { type: "json" };
4 |"
Expand All @@ -209,12 +209,12 @@ parsers: ["babel", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
export { foo2 } from "foo.json" assert { type: "json" };
export { default as foo2 } from "foo.json" assert { type: "json" };
export * from "foo.json" assert { type: "json" };
export * as foo3 from "foo.json" assert { type: "json" };

=====================================output=====================================
export { foo2 } from "foo.json" assert { type: "json" };
export { default as foo2 } from "foo.json" assert { type: "json" };
export * from "foo.json" assert { type: "json" };
export * as foo3 from "foo.json" assert { type: "json" };

Expand Down
2 changes: 1 addition & 1 deletion tests/format/js/import-assertions/re-export.js
@@ -1,3 +1,3 @@
export { foo2 } from "foo.json" assert { type: "json" };
export { default as foo2 } from "foo.json" assert { type: "json" };
export * from "foo.json" assert { type: "json" };
export * as foo3 from "foo.json" assert { type: "json" };