Flow version: 0.295.0
Expected behavior
According to MDN:
export from supports all features that import supports — for example, import attributes.
So the following should be valid:
/** @file export.js */
export { default } from "./htmlhint.json" with { type: "json" };
/** @file index.js */
import ruleset from "./export.js";
console.log(ruleset);
Running:
should output the contents of htmlhint.json as an object:
{ "tagname-lowercase": true }
And processing with Flow should succeed:
npx flow-remove-types --out-file ./export.out.js ./export.js --all
Expected result:
./export.js
↳ ./export.out.js
Actual behavior
Flow fails to parse the with { type: "json" } attribute on export from:
./export.js
↳ Syntax Error: ';' expected (2:42)
export { default } from "./htmlhint.json" with { type: "json" };
^
1: export { default } from "./htmlhint.json" with { type: "json" };
Flow version: 0.295.0
Expected behavior
According to MDN:
So the following should be valid:
Running:
should output the contents of
htmlhint.jsonas an object:{ "tagname-lowercase": true }And processing with Flow should succeed:
Expected result:
Actual behavior
Flow fails to parse the
with { type: "json" }attribute onexport from:https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfCEoAGsoCAB3KHw4KrBMsAALfAA3KjgsXGxxZC4eAw1m-GhcWn9aY3wWZlc+-g1mbDqJbDYAWglxxJ63AxJi7AlG2lXhXFwZ9z2Do5PRHEoLgyKwTqp1zce8qChFrpIqY41VqmDA+T4gIo-MB-AGrCCMLLQbirRoYGrgor-GDYVYIA7LSgkVZkCQE7q9dxFfIrVbMdJwMjghSeBIhPwYEhkSgqeEmTIQB7bPoAX34kA0SWZAokAAJgDKNFodDLhTKYJR0jKADogKwAegaEhEuAaNRiACsSNAdTLynAJA05TKNsZkNqQJbrSAVQBuXIgZomEhwaBJZoABisACYAJwAVis4ZAwqAA