@@ -278,6 +278,16 @@ impl Rule for NoDuplicateImports {
278278 }
279279
280280 for entry in & module_record. indirect_export_entries {
281+ // Skip checking `export { ... };` without `from` clause, matching ESLint behavior.
282+ //
283+ // In an export list, `entry.statement_span` points to the **import** statement,
284+ // while `entry.span` points to the exported item, so they won't overlap.
285+ // This is unlike in aggregated export (`export { ... } from '...'`) in which
286+ // `entry.statement_span` points to the **export** statement.
287+ if !entry. statement_span . contains_inclusive ( entry. span ) {
288+ continue ;
289+ }
290+
281291 let Some ( module_request) = & entry. module_request else {
282292 continue ;
283293 } ;
@@ -678,6 +688,16 @@ fn test() {
678688 export type { Something } from "os";"# ,
679689 Some ( serde_json:: json!( [ { "includeExports" : true } ] ) ) ,
680690 ) ,
691+ (
692+ r#"import { M, MC } from "./types.ts";
693+ export { M, MC };"# ,
694+ Some ( serde_json:: json!( [ { "includeExports" : true } ] ) ) ,
695+ ) ,
696+ (
697+ r#"import type { M, MC } from "./types.ts";
698+ export type { M, MC };"# ,
699+ Some ( serde_json:: json!( [ { "includeExports" : true } ] ) ) ,
700+ ) ,
681701 (
682702 r#"export type { Something } from "os";
683703 export * from "os";"# ,
0 commit comments