Repository: swc-project/swc (rust)

Issue:
export import equals not handled in `lint/duplicate_exports`
### Describe the bug

[TypeScript playground](https://www.typescriptlang.org/play?jsx=1&module=1&sourceMap=true#code/KYDwDg9gTgLgBASwLaVnA+nAvHKwCOArgngBQBEANhACYCGAzgBbkCUA3AFCcDGEAdg3jV6zbBi6dQqeAG84IxkziMMcAL5cgA)

### Input code

```typescript
export import _ = require("lodash");

const lodash = _;

export { lodash as _ };
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2022"
  },
  "module": {
    "type": "commonjs"
  },
  "isModule": true
}
```


### Playground link

[swc playground](https://play.swc.rs/?version=1.2.215&code=H4sIAAAAAAAAA0utKMgvKlHIzAVT8Qq2CkWphaWZRakaSjn5KYnFGUqa1lxcyfl5xSUKEAGgknigUCpEYzVMNLEYqLvWmgsAETNMllEAAAA%3D&config=H4sIAAAAAAAAAy2LSwrAIAwF75J1F8Wld%2BghRENR6ockQkW8ew1095iZNyGxBzuhOWIkXTyKuBcsyGjInmITWAeIoxtlY2RzGqMo19Af1I%2BmW%2Fmacy2JVUa%2Bfi3UcX0yZQvwaQAAAA%3D%3D)

### Expected behavior

emit duplicate exports error.

### Actual behavior

_No response_

### Version

1.2.215

### Additional context

_No response_

Pull request:
fix(es/lint): handle export import equals
<!-- 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 #5224 

Patch:
diff --git a/crates/swc_ecma_lints/src/rules/duplicate_exports.rs b/crates/swc_ecma_lints/src/rules/duplicate_exports.rs
index 58879cb1a1..8e0e70d2dc 100644
--- a/crates/swc_ecma_lints/src/rules/duplicate_exports.rs
+++ b/crates/swc_ecma_lints/src/rules/duplicate_exports.rs
@@ -136,6 +136,12 @@ impl Visit for DuplicateExports {
         };
     }
 
+    fn visit_ts_import_equals_decl(&mut self, n: &TsImportEqualsDecl) {
+        if n.is_export && !n.is_type_only && !n.declare {
+            self.add(&n.id)
+        }
+    }
+
     fn visit_ts_export_assignment(&mut self, n: &TsExportAssignment) {
         self.add_export_assign(n.span);
     }


Test patch:
diff --git a/crates/swc/tests/errors/lints/duplicate-exports/6/.swcrc b/crates/swc/tests/errors/lints/duplicate-exports/6/.swcrc
new file mode 100644
index 0000000000..de1387997d
--- /dev/null
+++ b/crates/swc/tests/errors/lints/duplicate-exports/6/.swcrc
@@ -0,0 +1,11 @@
+{
+    "$schema": "http://json.schemastore.org/swcrc",
+    "jsc": {
+        "parser": {
+            "syntax": "typescript"
+        }
+    },
+    "module": {
+        "type": "commonjs"
+    }
+}
\ No newline at end of file
diff --git a/crates/swc/tests/errors/lints/duplicate-exports/6/input.ts b/crates/swc/tests/errors/lints/duplicate-exports/6/input.ts
new file mode 100644
index 0000000000..324159ff7f
--- /dev/null
+++ b/crates/swc/tests/errors/lints/duplicate-exports/6/input.ts
@@ -0,0 +1,5 @@
+export import _ = require("lodash");
+
+const lodash = _;
+
+export { lodash as _ };
diff --git a/crates/swc/tests/errors/lints/duplicate-exports/6/output.swc-stderr b/crates/swc/tests/errors/lints/duplicate-exports/6/output.swc-stderr
new file mode 100644
index 0000000000..efb45e60a7
--- /dev/null
+++ b/crates/swc/tests/errors/lints/duplicate-exports/6/output.swc-stderr
@@ -0,0 +1,16 @@
+
+  x the name `_` is exported multiple times
+   ,-[1:1]
+ 1 | export import _ = require("lodash");
+   :               |
+   :               `-- previous exported here
+ 2 | 
+ 3 | const lodash = _;
+ 4 | 
+ 5 | export { lodash as _ };
+   :                    |
+   :                    `-- exported more than once
+   `----
+
+Error: 
+  > Exported identifiers must be unique