Skip to content

feat(linter): implement eslint/max-statements#15804

Merged
camc314 merged 6 commits intooxc-project:mainfrom
pchorus:feature/max-statements
Dec 21, 2025
Merged

feat(linter): implement eslint/max-statements#15804
camc314 merged 6 commits intooxc-project:mainfrom
pchorus:feature/max-statements

Conversation

@pchorus
Copy link
Contributor

@pchorus pchorus commented Nov 17, 2025

Add ESLint rule max-statements.

@pchorus pchorus requested a review from camc314 as a code owner November 17, 2025 19:38
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 17, 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-enhancement Category - New feature or request labels Nov 17, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 17, 2025

CodSpeed Performance Report

Merging #15804 will not alter performance

Comparing pchorus:feature/max-statements (a574cfd) with main (e14db66)1

Summary

✅ 4 untouched
⏩ 41 skipped2

Footnotes

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

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

@pchorus pchorus force-pushed the feature/max-statements branch from 961e317 to 3efd152 Compare November 17, 2025 19:57
@pchorus
Copy link
Contributor Author

pchorus commented Nov 17, 2025

CI / Test Linux fails with error

thread 'size_asserts' (6658) panicked at crates/oxc_linter/src/lib.rs:94:5:
assertion `left == right` failed
  left: 24
 right: 16

@camc314 Unfortunately, I don't know how to fix this one.

@pchorus pchorus requested a review from camc314 November 18, 2025 12:09
@camc314 camc314 force-pushed the feature/max-statements branch from 964b2d8 to 98a8f08 Compare December 13, 2025 18:16
@camc314 camc314 self-assigned this Dec 13, 2025
@camc314 camc314 force-pushed the feature/max-statements branch from 98a8f08 to e5fb257 Compare December 21, 2025 16:32
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 feat(linter): implement rule max-statements feat(linter): implement eslint/max-statements Dec 21, 2025
@camc314 camc314 merged commit 9348f10 into oxc-project:main Dec 21, 2025
20 checks passed
@pchorus pchorus deleted the feature/max-statements branch December 21, 2025 19:24
@sebastienbarre
Copy link

sebastienbarre commented Dec 22, 2025

I'm getting an ocean of errors with this new one. Is there some documentation describing how it is counting statements? This doesn't seem right to me.

@camc314
Copy link
Contributor

camc314 commented Dec 22, 2025

I'm getting an ocean of errors with this new one. Is there some documentation describing how it is counting statements? This doesn't seem right to me.

it's a style rule so it might not be for everyone. did you have the eslint rule enabled previously? are the errors the same or different?

I'd suggest disabling this rule in your config (it's not on by default).

@camc314
Copy link
Contributor

camc314 commented Dec 22, 2025

I'm getting an ocean of errors with this new one. Is there some documentation describing how it is counting statements? This doesn't seem right to me.

we copied the eslint test cases, so we should have the same behaviours as eslint. Eslint docs:

https://eslint.org/docs/latest/rules/max-statements

@sebastienbarre
Copy link

I didn’t have this rule specifically enabled. I disabled it, thanks. I wasn’t using ESLint before. Some of your users might not be ESLint users but Vite fans who got interested in what Void Zero is doing. They might not be aware of these rules or have the foresight to automatically check ESLint for more explanations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants