-
Notifications
You must be signed in to change notification settings - Fork 984
Closed
Description
acorn-loose seems to not take into account trailing semicolon on export all module declaration. Hence, it wrongly adds an empty statement.
const options = {
ecmaVersion: 2020,
sourceType: "module",
};
const code = `export * from "source";`;
// Good //
{
const node = require("acorn").parse(code, options);
console.assert(node.body.length === 1);
console.assert(node.body[0].type === "ExportAllDeclaration");
}
// Bad //
{
const node = require("acorn-loose").parse(code, options);
console.assert(node.body.length === 2);
console.assert(node.body[0].type === "ExportAllDeclaration");
console.assert(node.body[1].type === "EmptyStatement");
}Metadata
Metadata
Assignees
Labels
No labels