-
-
Notifications
You must be signed in to change notification settings - Fork 640
feat(biome_js_analyze): implement noExcessiveLinesPerFunction #6166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(biome_js_analyze): implement noExcessiveLinesPerFunction #6166
Conversation
770bbac
to
01f0f5f
Compare
01f0f5f
to
67d5faa
Compare
CodSpeed Performance ReportMerging #6166 will degrade performances by 13.24%Comparing Summary
Benchmarks breakdown
|
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Show resolved
Hide resolved
bf3902f
to
a73c0ab
Compare
f629982
to
ce4997e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mehm8128 for this PR. There's some work to do yet, however I left some useful comments that should help you getting to the finish line.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
Thank you for your review! I'll check them and work for it! |
ce4997e
to
741eacf
Compare
@ematipico |
741eacf
to
ee2c510
Compare
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
e56d852
to
3bf0689
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
FYI, ematipico is on vacation this week. Once he's back this can move forward.
@dyc3 |
Since it doesn't match that rule exactly, yeah. The rule will be in nursery, so this is fine as a first iteration. We can always update it to more accurately match the source rule later. Or you can do that in this PR. Personally, I would prefer the rule to exactly match the source rule to make migrating easier. |
b19e4ab
to
89d728e
Compare
89d728e
to
75499d7
Compare
@ematipico @dyc3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mehm812! The PR is excellent, I left just a nit around the options. You don't need to look into the performance part. Usually, rules that inspect tokens such as this one are very difficult to optimise.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_function.rs
Outdated
Show resolved
Hide resolved
any update? + can you please support all eslint options? https://eslint.org/docs/latest/rules/max-lines-per-function#options
|
@stavalfi @ematipico |
@mehm8128 we're close to ship V2 stable so we're trying to avoid too many changes unless they are bug fixes. We'll merge the PR after v2 is out. |
OK, I'll wait for it. |
344e5fa
to
f20c4c7
Compare
🦋 Changeset detectedLatest commit: 0bdf096 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged for the next patch release, since nursery rules indeed don't need to wait for 2.1 (I removed the milestone). |
Summary
close #5740
I implemented this rule with some options which are included in eslint/max-lines-per-function, but I excluded
skipComments
option because it's implementation is expected to be complicated as the first PR for this rule. So if the option is needed for this rule, please split into another issue.Test Plan
See some test cases.