Skip to content

Conversation

@lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Oct 15, 2025

  • Closes linter: jest/no-export doesn't do what it says it does #14592
  • The diagnostic was reported for typescript-make-units-from-test.ts because jest/no_export checks if the file name ends with test.ts, not if it ends with .test.ts.
  • A quick fix would be to change the file name criteria, but checking for a test brings the rule closer to eslint-plugin-jest behavior.
  • Direct edits from maintainers welcome.

Before

image

After

image

The oxlint-disable-next directive was removed for these screenshots.

Copilot AI review requested due to automatic review settings October 15, 2025 08:41
@lilnasy lilnasy requested a review from camc314 as a code owner October 15, 2025 08:41
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 15, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Oct 15, 2025
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 improves the jest/no_export linter rule by adding a heuristic to only flag exports when the file contains actual test function calls (it, test, etc.), rather than flagging all exports in any file with a test-like filename.

  • Enhanced export detection logic to check for presence of test functions before flagging exports
  • Added utility imports for Jest function parsing and AST traversal
  • Updated test cases to reflect the improved heuristic behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2025

CodSpeed Performance Report

Merging #14620 will not alter performance

Comparing lilnasy:fix/14592 (26f0466) with main (544c092)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (f5b3445) during the generation of this report, so 544c092 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 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.

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! i pushed one commit changing collect_possible_jest_call_node to avoid the iter -> vec -> iter chain

@camc314 camc314 merged commit 6bb9902 into oxc-project:main Oct 15, 2025
20 checks passed
@lilnasy lilnasy deleted the fix/14592 branch October 21, 2025 09:26
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: jest/no-export doesn't do what it says it does

2 participants