mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
fix(es/typescript): Strip inline type declarations (#6600)
This commit is contained in:
parent
30d0d98405
commit
fe0c65195d
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
import { type BadgeProps } from './badge.js';
|
||||
export { BadgeProps };
|
Loading…
Reference in New Issue
Block a user