fix(es/typescript): Strip inline type declarations (#6600)

This commit is contained in:
HeYunfei 2022-12-08 13:11:45 +08:00 committed by GitHub
parent 30d0d98405
commit fe0c65195d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -1596,11 +1596,19 @@ where
ImportSpecifier::Default(ImportDefaultSpecifier { local, .. })
| ImportSpecifier::Named(ImportNamedSpecifier { local, .. })
| ImportSpecifier::Namespace(ImportStarAsSpecifier { local, .. }) => {
let type_only = n.type_only
|| matches!(
s,
ImportSpecifier::Named(ImportNamedSpecifier {
is_type_only: true,
..
})
);
self.scope
.referenced_idents
.entry((local.sym.clone(), local.span.ctxt()))
.or_default();
if n.type_only {
if type_only {
self.scope.decls.entry(local.to_id()).or_default();
}
}

View File

@ -0,0 +1,2 @@
import { type BadgeProps } from './badge.js';
export { BadgeProps };