Skip to content

Commit

Permalink
fix: JSON modules disable named exports (#13031)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 21, 2022
1 parent fde0b49 commit b0201e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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" };

0 comments on commit b0201e0

Please sign in to comment.