-
-
Notifications
You must be signed in to change notification settings - Fork 813
feat(biome_js_analyze): implement noExcessiveLinesPerFile #8639
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 noExcessiveLinesPerFile #8639
Conversation
🦋 Changeset detectedLatest commit: bb360a9 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 |
WalkthroughAdds a new nursery lint rule Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (9)
crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (12)
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧠 Learnings (44)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:27:13.161Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use naming convention `no<Concept>` when a rule forbids a single concept
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use helper functions like `map`, `filter`, and `and_then` to avoid deep indentation
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/*.rs : Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each rule option must have its own h3 header with description, default value, options block, and code example
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json.changeset/wet-squids-agree.md
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Run `just l` to lint analyzer rule code
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Changesets should be concise (1-3 sentences) and provide quick overview of changes without overwhelming details
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧬 Code graph analysis (4)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (2)
a(1-1)b(2-2)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (2)
a(1-1)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (2)
a(2-2)b(3-3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (2)
a(1-1)b(2-2)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (2)
a(1-1)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (3)
a(1-1)b(3-3)c(4-4)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (2)
a(2-2)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (3)
a(1-1)b(2-2)c(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (2)
a(2-2)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
🔇 Additional comments (15)
crates/biome_rule_options/src/no_excessive_lines_per_file.rs (1)
1-32: Excellent implementation of rule options!The struct follows all guidelines: proper derives (including
Merge,Deserializable), serde attributes (camelCase,deny_unknown_fields),Option<>wrapped fields withskip_serializing_if, and clean accessor methods with sensible defaults.Based on learnings, this matches the expected pattern for rule options in the
biome_rule_optionscrate.crates/biome_rule_options/src/lib.rs (1)
82-82: LGTM!Module declaration correctly positioned alphabetically and follows standard patterns.
.changeset/wet-squids-agree.md (1)
1-6: LGTM!Changeset is concise and properly formatted, marking the appropriate packages for patch updates.
Based on learnings, changesets should be concise (1-3 sentences) and provide a quick overview.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json (1)
1-15: LGTM!Test configuration correctly sets
maxLines: 4for testing with the corresponding fixture.crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (1)
1-5: LGTM!Test fixture appropriately structured to validate
skipBlankLinesoption behaviour (5 total lines with 2 blank lines).Based on learnings, test files prefixed with 'invalid' should trigger the rule.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (1)
1-3: LGTM!Valid test fixture correctly structured with 3 lines (under the 4-line limit from configuration).
Based on learnings, valid test files should not trigger diagnostics.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json (1)
1-16: LGTM!Test configuration correctly specifies both
maxLines: 4andskipBlankLines: truefor validating the blank line skipping behaviour.crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (1)
1-5: LGTM!Test fixture correctly demonstrates the
skipBlankLinesoption with 3 non-blank lines (under the 4-line limit when blank lines are excluded).crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json (1)
1-15: LGTM!The test configuration is properly structured and appropriate for validating the rule with a low line limit.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json (1)
1-16: LGTM!The configuration correctly tests the
skipBlankLinesoption with an appropriate line limit.crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (1)
1-4: LGTM!The test fixture is simple and appropriate for validating the rule behaviour.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (4)
1-8: LGTM!All necessary imports are present and correct.
109-135: LGTM!The line counting logic is correct:
- When
skipBlankLinesis false, it counts all newlines across token trivia.- When
skipBlankLinesis true, it cleverly counts lines containing tokens by detecting which tokens have leading newlines, effectively counting non-blank lines.The addition of 1 properly accounts for the first line.
137-153: LGTM!The diagnostic message clearly indicates the issue with both the actual count and maximum allowed, and the note provides helpful guidance.
156-158: LGTM!The state struct appropriately holds the computed line count for the diagnostic.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (1)
121-138: Consider minor optimisations for clarity and performance.The line-counting logic is correct, but two small improvements:
- Line 124: The
.collect::<Vec<_>>()insideflat_mapis unnecessary—iterators can be chained directly.- Line 128: Using
returnin a fold closure is unconventional; restructure the conditional for clearer flow.🔎 Proposed refactoring
let file_lines_count = node .syntax() .descendants() - .flat_map(|descendant| descendant.tokens().collect::<Vec<_>>()) + .flat_map(|descendant| descendant.tokens()) .filter(|token| token.kind() != JsSyntaxKind::EOF) .fold(0, |acc, token| { - if options.skip_blank_lines() { - return acc + token.has_leading_newline() as usize; - }; - - acc + token - .trim_trailing_trivia() - .leading_trivia() - .pieces() - .filter(|piece| piece.is_newline()) - .count() + if options.skip_blank_lines() { + acc + token.has_leading_newline() as usize + } else { + acc + token + .trim_trailing_trivia() + .leading_trivia() + .pieces() + .filter(|piece| piece.is_newline()) + .count() + } }) + 1; // Add 1 for the first line
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:27:13.161Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new nursery rules, send PRs to the maintenance branch `main`
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (2)
crates/biome_analyze/src/rule.rs (4)
recommended(619-622)sources(634-637)inspired(260-265)issue_number(654-657)crates/biome_rule_options/src/no_excessive_lines_per_file.rs (1)
max_lines(22-24)
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (3)
1-7: LGTM!Clean imports, all dependencies accounted for.
9-109: Excellent documentation and metadata!Both previous review issues have been addressed:
- The invalid example now properly includes the
expect_diagnosticmarker and options configuration- The
issue_numberfield has been addedDocumentation is thorough, follows all guidelines, and the rule metadata is correctly configured.
147-168: LGTM!Diagnostic message is clear and actionable, state struct is appropriately minimal.
This comment was marked as spam.
This comment was marked as spam.
dyc3
left a comment
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.
Could we add a suppression test for this as well? Since this rule is a bit unusual, it might be good to explain how to suppress it in the rule docs as well.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
Outdated
Show resolved
Hide resolved
This comment was marked as spam.
This comment was marked as spam.
CodSpeed Performance ReportMerging #8639 will not alter performanceComparing Summary
Footnotes
|
|
@ohnoah just curious, did you request the review from diffray-bot? |
dyc3
left a comment
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.
I do feel like there's perhaps a better way to do this, but I can't think of anything.
LGTM
ematipico
left a comment
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.
Sorry to interject the review, but this rule should follow the same naming convention of the other rule that was implemented. The information is in the discussion
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs (1)
139-156: Remove unnecessary.collect()to avoid intermediate allocations.This was flagged previously but appears unaddressed. The
.collect::<Vec<_>>()creates an unnecessary intermediateVecfor every descendant node before flattening.🔎 Proposed fix
let file_lines_count = node .syntax() .descendants() - .flat_map(|descendant| descendant.tokens().collect::<Vec<_>>()) + .flat_map(|descendant| descendant.tokens()) .filter(|token| token.kind() != JsSyntaxKind::EOF) .fold(0, |acc, token| {
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs (1)
184-186: Consider adding#[derive(Debug)]to the State struct.Helpful for debugging with
dbg!()during development. Based on coding guidelines,dbg!()macro is recommended for debugging output in Rust tests and code.🔎 Proposed fix
+#[derive(Debug)] pub struct State { file_lines_count: usize, }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (14)
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/use_max_lines_per_file.rs
✅ Files skipped from review due to trivial changes (2)
- crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.js
- crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.js
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_rule_options/src/lib.rs
- .changeset/wet-squids-agree.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
🧠 Learnings (45)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `file=<path>` property for multi-file rule documentation examples
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Run `just l` to lint analyzer rule code
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`
Applied to files:
crates/biome_rule_options/src/use_max_lines_per_file.rs
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Avoid string allocations by comparing against `&str` or using `TokenText`
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use helper functions like `map`, `filter`, and `and_then` to avoid deep indentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
🧬 Code graph analysis (2)
crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs (1)
crates/biome_rule_options/src/use_max_lines_per_file.rs (1)
max_lines(22-24)
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js (4)
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.js (3)
a(1-1)b(3-3)c(4-4)crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.js (3)
a(2-2)b(3-3)c(4-4)crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js (2)
a(2-2)b(3-3)crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
🔇 Additional comments (10)
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json (1)
1-15: Test configuration looks good.The configuration correctly sets up the invalid test case with
maxLines: 2, which will properly trigger the rule when tested against the 4-line fixture.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.json (1)
1-15: Test configuration looks good.The configuration appropriately sets
maxLines: 4for the valid test case, ensuring files within the limit don't trigger the rule.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json (1)
1-16: Test configuration looks good.Correctly exercises the
skipBlankLinesfeature with appropriate threshold to verify blank lines are excluded from the count in invalid scenarios.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json (1)
1-16: Test configuration looks good.Properly configures the valid case for
skipBlankLinestesting, ensuring files within the limit don't trigger false positives.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js (1)
1-4: Test fixture looks good.Clean, minimal test case with 4 lines to verify the rule triggers when the limit is exceeded. Perfectly suited for the invalid scenario.
crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js (1)
1-5: LGTM!Test file correctly validates that blank lines are excluded from the count when
skipBlankLines: true. WithmaxLines: 4configured, the 3 non-blank lines pass without triggering a diagnostic.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json (1)
1-15: LGTM!Configuration correctly sets up a low
maxLinesthreshold to test suppression behaviour.crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js (1)
1-3: LGTM!Clean, minimal test file for the valid case. Follows the
valid*naming convention.crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs (1)
9-127: Documentation looks solid.Proper structure with Examples (Invalid/Valid), Options descriptions, and Suppressions guidance. The
expect_diagnosticmarkers are now correctly placed with their corresponding options blocks. Nice work addressing the earlier feedback.crates/biome_rule_options/src/use_max_lines_per_file.rs (1)
1-32: LGTM!Options struct follows all the conventions:
Option<>wrapping,deny_unknown_fields,rename_all = "camelCase", proper derives includingMerge. The use ofNonZeroU16formax_linesis a nice touch—prevents zero from being a valid configuration.
@ematipico I think that discussion is outdated. The merged rule seems to follow my current naming convention. see: |
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (1)
142-142: Remove unnecessarycollect()in flat_map.The
.collect::<Vec<_>>()creates an intermediate allocation for every descendant node. Sinceflat_mapcan iterate the tokens directly, this is wasteful.🔎 Proposed fix
- .flat_map(|descendant| descendant.tokens().collect::<Vec<_>>()) + .flat_map(|descendant| descendant.tokens())
🧹 Nitpick comments (2)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js (1)
1-1: Consider a more accurate suppression rationale.The comment suggests this is a "generated file", but it's actually a test fixture. A clearer rationale like "test suppression" would be more accurate, though this is purely cosmetic for test code.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (1)
139-156: Consider extracting line counting logic.The chained line-counting logic is complex and would benefit from extraction into a helper function for improved readability and testability. This is optional but would make the code more maintainable.
💡 Example extraction
fn count_file_lines(node: &AnyJsRoot, skip_blank_lines: bool) -> usize { node.syntax() .descendants() .flat_map(|descendant| descendant.tokens()) .filter(|token| token.kind() != JsSyntaxKind::EOF) .fold(0, |acc, token| { if skip_blank_lines { return acc + token.has_leading_newline() as usize; } acc + token .trim_trailing_trivia() .leading_trivia() .pieces() .filter(|piece| piece.is_newline()) .count() }) + 1 }Then use:
let file_lines_count = count_file_lines(node, options.skip_blank_lines());
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (14)
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
✅ Files skipped from review due to trivial changes (2)
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧠 Learnings (58)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Use past tense when describing actions in changesets (e.g., 'Added', 'Fixed'), and present tense for Biome behavior (e.g., 'Biome now supports')
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new nursery rules, send PRs to the maintenance branch `main`
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each rule option must have its own h3 header with description, default value, options block, and code example
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-10-25T07:02:26.457Z
Learnt from: ematipico
Repo: biomejs/biome PR: 7856
File: .changeset/yellow-crews-guess.md:1-5
Timestamp: 2025-10-25T07:02:26.457Z
Learning: The Biome documentation website uses kebab-case URL slugs for rule pages (e.g., `/linter/rules/no-continue/`), not camelCase.
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For rule changes in changesets, clearly demonstrate what is now invalid that wasn't before, or vice versa
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: In changesets, reference rules and assists with links to the website documentation
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Run `just l` to lint analyzer rule code
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use naming convention `no<Concept>` when a rule forbids a single concept
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use helper functions like `map`, `filter`, and `and_then` to avoid deep indentation
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/*.rs : Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Avoid string allocations by comparing against `&str` or using `TokenText`
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
🧬 Code graph analysis (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (4)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (3)
a(1-1)b(3-3)c(4-4)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js (3)
a(2-2)b(3-3)c(4-4)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (2)
a(2-2)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (2)
crates/biome_analyze/src/rule.rs (3)
recommended(619-622)sources(634-637)inspired(260-265)crates/biome_rule_options/src/no_excessive_lines_per_file.rs (1)
max_lines(22-24)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (4)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (2)
a(1-1)b(2-2)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (2)
a(1-1)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js (2)
a(2-2)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (2)
a(2-2)b(3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Validate PR title
🔇 Additional comments (16)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (1)
1-4: Test fixture looks good.Clear, minimal invalid case with four lines of code. Works well for testing the line limit enforcement.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json (1)
1-15: Configuration is correct.Proper JSON structure with appropriate maxLines setting for the suppressed test case.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json (1)
1-16: Configuration is correct.Proper JSON structure testing both maxLines and skipBlankLines options together.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json (1)
1-15: Configuration is correct.Proper JSON structure with maxLines: 4 for the valid test case (which has only 2 lines).
crates/biome_rule_options/src/lib.rs (1)
82-82: Module declaration is correct.Properly inserted in alphabetical order between adjacent modules.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json (1)
1-16: Test configuration looks correct.The options appropriately configure the rule to test skipBlankLines functionality.
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json (1)
1-15: Configuration correctly sets up the invalid test case.With maxLines set to 2, this will properly test files that exceed the limit.
.changeset/wet-squids-agree.md (1)
1-13: Changeset follows all conventions correctly.Past tense used, rule linked to documentation, and invalid example clearly demonstrates the rule's behaviour. Well done addressing the previous feedback!
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (1)
1-5: Test case correctly validates skipBlankLines behaviour.With 3 non-blank lines and the configuration setting maxLines to 4 with skipBlankLines enabled, this appropriately tests the valid scenario.
crates/biome_rule_options/src/no_excessive_lines_per_file.rs (2)
1-14: LGTM – Options struct follows all conventions.The struct correctly implements all required traits, uses
Option<>wrappers for proper merge behavior, and includes appropriate serde attributes.
16-32: LGTM – Accessor methods provide sensible defaults.The implementation correctly provides fallback values and the constant initialization is safe.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (5)
1-7: LGTM – Imports are appropriate.All necessary dependencies are included for the rule implementation.
9-127: LGTM – Rule declaration follows all guidelines.The documentation structure is well-organized with proper code block markers, and metadata correctly uses
inspired()for the ESLint source. The suppressions section is a nice addition.
165-181: LGTM – Clear and helpful diagnostic.The diagnostic message effectively communicates the violation and provides actionable guidance.
184-186: LGTM – State struct is appropriately minimal.Holds only the necessary information for diagnostic generation.
145-147: TheskipBlankLineslogic is working correctly and is already documented.The implementation counts tokens with leading newlines, which accurately reflects non-blank lines (including comment-only lines). Edge cases you mentioned are handled as intended: multiple statements on one line count as one line, comment-only lines are counted, and blank lines are excluded. The rustdoc comments already document this behaviour clearly with examples covering the main scenarios.
104e085 to
bbe9e7e
Compare
c3206df to
d2b4d25
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (1)
130-147: Remove unnecessary.collect()allocation.Line 133 uses
.flat_map(|descendant| descendant.tokens().collect::<Vec<_>>()), which creates intermediateVecallocations for every descendant node. Since.flat_map()already flattens iterators, the.collect()is redundant and impacts performance.🔎 Proposed fix
let file_lines_count = node .syntax() .descendants() - .flat_map(|descendant| descendant.tokens().collect::<Vec<_>>()) + .flat_map(|descendant| descendant.tokens()) .filter(|token| token.kind() != JsSyntaxKind::EOF) .fold(0, |acc, token| {
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (1)
130-147: Consider extracting line counting logic (optional).The line counting chain could be extracted into a helper function like
count_file_lines(node: &AnyJsRoot, skip_blank_lines: bool) -> usize. This would improve testability and readability, though the current implementation is acceptable.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (10)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (14)
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.jsoncrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
✅ Files skipped from review due to trivial changes (1)
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
🚧 Files skipped from review as they are similar to previous changes (7)
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
- crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
🧠 Learnings (65)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.jscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.mdcrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.mdcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.mdcrates/biome_rule_options/src/lib.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-31T15:35:32.899Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:32.899Z
Learning: In Rust lint rules under the nursery category, the issue_number field in declare_lint_rule! is optional and should not be added unless there is a compelling reason. In code reviews, verify that no unnecessary issue_number is included in nursery lint declarations. Only add issue_number if there is an explicit, justified reason (e.g., tracked issue for external observers). This guidance broadly applies to all nursery lint rule files, not just the single file.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new lint rules in changesets, show an example of invalid case in inline code or code block
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Examples` section with `### Invalid` and `### Valid` subsections
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-22T09:26:56.943Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: When defining lint rules (declare_lint_rule!), only specify fix_kind if the rule implements an action(...) function. Rules that only emit diagnostics without a code fix should omit fix_kind. This applies to all Rust lint rule definitions under crates/.../src/lint (e.g., crates/biome_js_analyze/src/lint/...).
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `deprecated` field to `declare_lint_rule!` macro when deprecating a rule
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: In changesets, start with a link to the issue when fixing a bug (e.g., 'Fixed [#4444](link): ...')
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For new nursery rules, send PRs to the maintenance branch `main`
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Avoid string allocations by comparing against `&str` or using `TokenText`
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use helper functions like `map`, `filter`, and `and_then` to avoid deep indentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each rule option must have its own h3 header with description, default value, options block, and code example
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options must be placed inside the `biome_rule_options` crate
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.mdcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Ensure the type implementing Diagnostic derives Debug
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Commit rule work with message format `feat(biome_<language>_analyze): <ruleName>`
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Use past tense when describing actions in changesets (e.g., 'Added', 'Fixed'), and present tense for Biome behavior (e.g., 'Biome now supports')
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-31T15:35:41.261Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8639
File: crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs:101-108
Timestamp: 2025-12-31T15:35:41.261Z
Learning: In crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs, the `issue_number` field in `declare_lint_rule!` macro is optional and the vast majority of nursery rules do not need it. Do not recommend adding `issue_number` unless there's a specific reason.
Applied to files:
.changeset/wet-squids-agree.mdcrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-10-25T07:02:26.457Z
Learnt from: ematipico
Repo: biomejs/biome PR: 7856
File: .changeset/yellow-crews-guess.md:1-5
Timestamp: 2025-10-25T07:02:26.457Z
Learning: The Biome documentation website uses kebab-case URL slugs for rule pages (e.g., `/linter/rules/no-continue/`), not camelCase.
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For rule changes in changesets, clearly demonstrate what is now invalid that wasn't before, or vice versa
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: In changesets, reference rules and assists with links to the website documentation
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Rules should tell the user what they should do to fix the error via code actions or notes
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Rules should explain to the user why the error is triggered
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Changesets should describe user-facing changes only; internal refactoring without behavior changes does not require a changeset
Applied to files:
.changeset/wet-squids-agree.md
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use naming convention `no<Concept>` when a rule forbids a single concept
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/*.rs : Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rs
📚 Learning: 2025-11-21T01:10:53.059Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8171
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:125-137
Timestamp: 2025-11-21T01:10:53.059Z
Learning: In the Biome codebase, each lint rule has its own options type declaration (e.g., `type Options = RuleNameOptions`) as part of the codegen process, even if the options struct is empty or unused. This is standard practice and should not be flagged as an issue.
Applied to files:
crates/biome_rule_options/src/no_excessive_lines_per_file.rscrates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
📚 Learning: 2025-12-19T12:53:30.413Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.413Z
Learning: Run `just l` to lint analyzer rule code
Applied to files:
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
🧬 Code graph analysis (2)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (3)
crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js (2)
a(1-1)b(2-2)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js (2)
a(1-1)b(3-3)crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js (2)
a(2-2)b(4-4)
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (2)
crates/biome_analyze/src/rule.rs (3)
recommended(619-622)sources(634-637)inspired(260-265)crates/biome_rule_options/src/no_excessive_lines_per_file.rs (1)
max_lines(22-24)
🔇 Additional comments (8)
crates/biome_rule_options/src/lib.rs (1)
82-82: LGTM!Module declaration is correctly placed in alphabetical order between
no_evolving_typesandno_excessive_lines_per_function.crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js (1)
1-3: LGTM!Valid test fixture is appropriate: 3 lines of code won't exceed the configured
maxLines: 4threshold.crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json (1)
1-15: LGTM!Test configuration correctly sets
maxLines: 4to validate the corresponding 3-line test fixture as a valid case..changeset/wet-squids-agree.md (1)
1-13: LGTM!Changeset properly documents the new rule: past tense used, rule link included, invalid example shown, and frontmatter correctly bumps only
@biomejs/biomeas requested in past feedback.crates/biome_rule_options/src/no_excessive_lines_per_file.rs (1)
1-32: LGTM! Exemplary options implementation.The struct follows all coding guidelines: fields wrapped in
Option<>for proper merge tracking, all required derives present, proper serde attributes (deny_unknown_fields,camelCaserenaming), accessor methods with sensible defaults (300 lines, skip blank lines disabled), and clear documentation.Based on learnings, this adheres to the established patterns for rule options in the biome_rule_options crate.
crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs (3)
1-8: Imports look good.All necessary dependencies are present and correctly organised.
9-118: Documentation and metadata are well-structured.The rule follows the contributing guidelines: single-line description, proper examples with markers, detailed options, and suppression guidance. Metadata correctly uses
.inspired()for the ESLint source and omitsfix_kindsince no code fix is provided.
156-172: Diagnostic message is clear and helpful.The diagnostic provides both the actual line count and the limit, with a practical note about splitting files.
|
I think it's fine to do it in another PR. If you can do it in a shared helper like you suggested, that sounds ideal. |
dyc3
left a comment
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.
Blocking just to prevent accidental merges.
|
@dyc3 @ematipico should be ready for review now |
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary
Implements
noExcessiveLinesPerFilelint rule, inspired by ESLint'smax-lines.Closes #8640
Related discussion: #5557
Options
maxLinesskipBlankLinesNote:
skipCommentsoption is not implemented in this initial version (similar to hownoExcessiveLinesPerFunctionwas initially implemented without it).Test plan
just test-lintrule noExcessiveLinesPerFilejust lAI Disclosure
This implementation was developed with assistance from OpenAI Codex.