Skip to content

Commit

Permalink
Fix bug in import deduplication in template-tag-codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Feb 11, 2025
1 parent 81dbfba commit f2c28ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/template-tag-codemod/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ function renderScopeImports(scope: MetaResult['scope']) {
sections.push(def[0]);
}

let named = entries.filter(e => e[1] !== 'default');
// it's possible to have more than one local name for the default export,
// so this filter must only ignore the entry that we handled above, not
// any others that happen to use `default` as their imported name.
let named = entries.filter(e => e !== def);
if (named.length > 0) {
sections.push(
'{' +
Expand Down

0 comments on commit f2c28ea

Please sign in to comment.