Skip to content

Commit

Permalink
feature: goldstein: keyword-export-no-const: no declaration.id
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Dec 19, 2024
1 parent ba5b0ce commit 190beca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/goldstein/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,14 @@ test('goldstein: compile: export-no-const', (t) => {
test('goldstein: wrong brace', (t) => {
const result = compile(montag`
import a from 'a');
export const minify = (source, options = {}) => {};
`);

const expected = montag`
import a from 'a';
export const minify = (source, options = {}) => {};
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/keyword-export-no-const/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function keywordExportNoConst(Parser) {
node.declaration = VariableDeclaration('const', [
VariableDeclarator(node.declaration.expression.left, node.declaration.expression.right),
]);
else
else if (node.declaration.id)
this.checkExport(exports, node.declaration.id, node.declaration.id.start);

node.specifiers = [];
Expand Down

0 comments on commit 190beca

Please sign in to comment.