Repository: swc-project/swc (rust)

Issue:
import inline type declaration is parsed/striped incorrectly
### Describe the bug

As a result, webpack cannot handle export

```log
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export { BadgeProps };
```

### Input code

```typescript
import { type BadgeProps } from './badge.js';
export { BadgeProps };
```


### Config

```json
default
```


### Playground link

https://play.swc.rs/?version=1.3.21&code=H4sIAAAAAAAAA8vMLcgvKlGoViipLEhVcEpMSU8NKMovKFaoVUgrys9VUNfTTwIJ6mUVq1tzpVZAVSMrtAYAImMvnkQAAAA%3D&config=H4sIAAAAAAAAA0WNSwrDMAxE76J1ts0id%2BghjKsEF%2F%2FQKBBjfPfawSU7aebpqdIXlrZK2QhYxoQS1Vy0kZbMsOKy0kKKHu3Gg1tfjBysHWG8eudTAs92oeCi28sw2RSyMPBUJh7%2BT7YuCulzjqDez27hSu1xzDuH9wRVTm4%2FOkwQUrUAAAA%3D

### Expected behavior

```ts
export { };
```

### Actual behavior

```ts
export { BadgeProps };
```

### Version

1.3.21

### Additional context

_No response_

Pull request description:
fix(es/transform_typescript): import inline type declaration is striped incorrectly


<!-- Note: CI script will automatically rebase your PR so please do not rebase unless required -->

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**Description:**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**BREAKING CHANGE:**

<!--
If this PR introduces a breaking change, it must contain a notice for it to be included in the CHANGELOG. Add description or remove entirely if not breaking.

You may need to update `MIGRATION.md` for the breaking changes.
-->

**Related issue (if exists):**
Fix #6598 


Patch:
diff --git a/crates/swc_ecma_transforms_typescript/src/strip.rs b/crates/swc_ecma_transforms_typescript/src/strip.rs
index 322d6920ca..79a97c52dc 100644
--- a/crates/swc_ecma_transforms_typescript/src/strip.rs
+++ b/crates/swc_ecma_transforms_typescript/src/strip.rs
@@ -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();
                     }
                 }


Test patch:
diff --git a/crates/swc_ecma_transforms_typescript/tests/fixture/issue-6598/input.ts b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-6598/input.ts
new file mode 100644
index 0000000000..f56f628fb6
--- /dev/null
+++ b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-6598/input.ts
@@ -0,0 +1,2 @@
+import { type BadgeProps } from './badge.js';
+export { BadgeProps };
\ No newline at end of file