Skip to content

fix(linter/no-duplicate-imports): only check aggregated exports#20178

Merged
camc314 merged 1 commit intooxc-project:mainfrom
kennytm:fix-20176
Mar 11, 2026
Merged

fix(linter/no-duplicate-imports): only check aggregated exports#20178
camc314 merged 1 commit intooxc-project:mainfrom
kennytm:fix-20176

Conversation

@kennytm
Copy link
Contributor

@kennytm kennytm commented Mar 10, 2026

skip checking export { ... }; in eslint/no-duplicate-imports when includeExports is enabled, matching ESLint behavior.

close #20176.

@kennytm kennytm requested a review from camc314 as a code owner March 10, 2026 07:37
Copilot AI review requested due to automatic review settings March 10, 2026 07:37
@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the eslint/no-duplicate-imports rule to match ESLint’s behavior when includeExports is enabled by avoiding false positives for export lists without a from clause (e.g., export { M, MC };) that re-export previously imported bindings.

Changes:

  • Skip duplicate-export checks for export { ... }; / export type { ... }; statements that do not have a from clause.
  • Add regression tests ensuring re-exporting imported bindings via export lists does not trigger no-duplicate-imports when includeExports: true.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@camc314 camc314 changed the title fix(linter): only check aggregated exports in eslint/no-duplicate-imports fix(linter/no-duplicate-imports): only check aggregated exports Mar 11, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 11, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing kennytm:fix-20176 (981aa98) with main (542a04a)

Open in CodSpeed

Footnotes

  1. 52 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 merged commit 89b7ca9 into oxc-project:main Mar 11, 2026
25 of 26 checks passed
@kennytm kennytm deleted the fix-20176 branch March 11, 2026 12:54
leaysgur added a commit that referenced this pull request Mar 12, 2026
# Oxlint
### 🐛 Bug Fixes

- 4ea67de oxlint,oxfmt: Skip `vite.config.ts` exports `defineConfig(fn)`
(#20260) (leaysgur)
- cc89dbf oxlint: Skip `vite.config.ts` w/o `.lint` field in
auto-discovery (#20255) (leaysgur)
- 89b7ca9 linter/no-duplicate-imports: Only check aggregated exports
(#20178) (kennytm)
- 691f556 linter/explicit-module-boundary-types: Ignore constructor
callbacks (#20221) (camc314)

### ⚡ Performance

- d160dca linter/plugins: Reduce array lookups in visitor compilation
(#20249) (overlookmotel)

### 📚 Documentation

- 0c7da4f linter: Fix extra closing brace in example config. (#20253)
(connorshea)
- 13606c3 linter/plugins: Update conformance README (#20234)
(overlookmotel)
# Oxfmt
### 🐛 Bug Fixes

- 4ea67de oxlint,oxfmt: Skip `vite.config.ts` exports `defineConfig(fn)`
(#20260) (leaysgur)
- 11a2b45 oxfmt: Skip `vite.config.ts` w/o `.fmt` field in
auto-discovery (#20254) (leaysgur)

Co-authored-by: leaysgur <6259812+leaysgur@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: false positive in eslint/no-duplicate-imports with includeExports when reexporting

3 participants