Skip to content

Conversation

adventure-yunfei
Copy link
Contributor

Summary

Fixes #2804

Details

For case:

export declare interface Type1 {
    prop: import('foo').default;
}

Generating dts rollup result:

import { default as default_2 } from 'foo';

export declare interface Type1 {
    prop: default_2;
}

export { }

Ideally should generate import default_2 from 'foo';, but it needs to fix every AstImport type that may contain "default" import. Too complicated.

How it was tested

Tested cases in #2804.

@iclanton
Copy link
Member

Can you run rush change to describe your fix?

@iclanton
Copy link
Member

Looks like your build has a warning:

Warning: src/namedDefaultImport/index.ts:4:1 - (ae-missing-release-tag) "DefaultImportTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)

@adventure-yunfei adventure-yunfei force-pushed the fix/avoid-name-default branch from 91eb7a3 to 9da824a Compare July 13, 2021 01:58
@octogonz octogonz enabled auto-merge July 14, 2021 05:14
@octogonz octogonz merged commit 59dba4b into microsoft:master Jul 14, 2021
Qjuh pushed a commit to discordjs/rushstack that referenced this pull request Nov 7, 2023
…e-default

[api-extractor] fix: avoid using "default" keyword as var name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[api-extractor] dts rollup generates invalid "default" var name
4 participants