Skip to content

Commit

Permalink
Fix: Add type keyword when default export statement is pure type.
Browse files Browse the repository at this point in the history
- [fix] Fixed missing `type` keyword when `default export` statement is a pure type
  • Loading branch information
imjuni committed Nov 14, 2023
1 parent fb601e2 commit 868cbf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const defaultAliasNamedDestructiveDefaultTemplate = `
<%- if (it.statement.default != null && it.statement.named.length > 0) { -%>
export { default as <%= it.statement.default.identifier.alias %>, <%= it.statement.named.map((named) => (named.isPureType ? 'type ' + named.identifier.name : named.identifier.name)).join(', ') %> } from
export { <%= it.statement.default.isPureType ? 'type ' : '' %>default as <%= it.statement.default.identifier.alias %>, <%= it.statement.named.map((named) => (named.isPureType ? 'type ' + named.identifier.name : named.identifier.name)).join(', ') %> } from
<%-= it.options.quote %><%= it.statement.importPath %><%= it.statement.extname.render %><%= it.options.quote -%>
<%- if (it.options.useSemicolon) { -%><%-= ";" -%><%- } -%>
<%- } else if (it.statement.default != null) { -%>
export { default as <%= it.statement.default.identifier.alias %> } from
export { <%= it.statement.default.isPureType ? 'type ' : '' %>default as <%= it.statement.default.identifier.alias %> } from
<%-= it.options.quote %><%= it.statement.importPath %><%= it.statement.extname.render %><%= it.options.quote %>
<%- if (it.options.useSemicolon) { -%><%-= ";" -%><%- } -%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export const defaultAliasNamedStarDefaultTemplate = `
<%- if (it.statement.default != null && it.statement.named.length > 0) { -%>
export { default as <%= it.statement.default.identifier.alias %> } from
export { <%= it.statement.default.isPureType ? 'type ' : '' %>default as <%= it.statement.default.identifier.alias %> } from
<%-= it.options.quote %><%= it.statement.importPath %><%= it.statement.extname.render %><%= it.options.quote %>
<%- if (it.options.useSemicolon) { -%><%-= ";" -%><%- } -%>
export * from <%= it.options.quote %><%= it.statement.importPath %><%= it.statement.extname.render %><%= it.options.quote %>
<%- if (it.options.useSemicolon) { -%><%-= ";" -%><%- } -%>
<%- } else if (it.statement.default != null) { -%>
export { default as <%= it.statement.default.identifier.alias %> } from
export { <%= it.statement.default.isPureType ? 'type ' : '' %>default as <%= it.statement.default.identifier.alias %> } from
<%-= it.options.quote %><%= it.statement.importPath %><%= it.statement.extname.render %><%= it.options.quote %>
<%- if (it.options.useSemicolon) { -%><%-= ";" -%><%- } -%>
Expand Down

0 comments on commit 868cbf1

Please sign in to comment.