Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ohnoah
Copy link
Contributor

@ohnoah ohnoah commented Dec 31, 2025

Summary

Implements noExcessiveLinesPerFile lint rule, inspired by ESLint's max-lines.

Closes #8640
Related discussion: #5557

Options

Option Default Description
maxLines 300 Maximum lines allowed per file
skipBlankLines false Don't count blank lines toward the limit

Note: skipComments option is not implemented in this initial version (similar to how noExcessiveLinesPerFunction was initially implemented without it).

Test plan

  • just test-lintrule noExcessiveLinesPerFile
  • just l

AI Disclosure

This implementation was developed with assistance from OpenAI Codex.

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: bb360a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Dec 31, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Walkthrough

Adds a new nursery lint rule noExcessiveLinesPerFile for the JavaScript analyser that counts file lines and reports when they exceed a configurable maxLines (default 300). Optionally skips blank lines via skipBlankLines. Introduces NoExcessiveLinesPerFileOptions (serde/merge/schema support), registers the rule and its diagnostic, exports the new options module, and adds test fixtures and option files covering valid, invalid, suppressed, whitespace-only and single-line cases.

Suggested reviewers

  • dyc3
  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: implementing a new noExcessiveLinesPerFile lint rule in biome_js_analyze.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, covering summary, options, test plan, and AI disclosure.
Linked Issues check ✅ Passed The PR implements the core requirements from issue #8640: detects files exceeding configurable line limits, provides maxLines and skipBlankLines options, integrates into Biome's lint framework, and includes comprehensive test cases.
Out of Scope Changes check ✅ Passed All changes are directly aligned with implementing the noExcessiveLinesPerFile rule; changeset entry, configuration, rule implementation, options struct, and test fixtures are all in scope.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eea3931 and bb360a9.

⛔ Files ignored due to path filters (4)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (1)
  • crates/biome_rule_options/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_rule_options/src/lib.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between b86842c and a25c3ab.

⛔ Files ignored due to path filters (9)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (12)
  • .changeset/wet-squids-agree.md
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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/invalidSkipBlankLines.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.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_rule_options/src/lib.rs
  • crates/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 the dbg!() 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.rs
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/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.rs
  • 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 : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • 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/**/*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.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/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.rs
  • 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/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • 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_rule_options/src/lib.rs
  • 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: 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.rs
  • 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/**/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.rs
  • 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/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • 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: 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.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • 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 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.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • 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/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.rs
  • 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_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
  • 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_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • 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_rule_options/src/lib.rs
  • 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: 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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • 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: 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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • 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/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • 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/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • 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: 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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • 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_rule_options/src/no_excessive_lines_per_file.rs
  • 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: 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.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js
  • crates/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 with skip_serializing_if, and clean accessor methods with sensible defaults.

Based on learnings, this matches the expected pattern for rule options in the biome_rule_options crate.

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: 4 for 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 skipBlankLines option 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: 4 and skipBlankLines: true for 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 skipBlankLines option 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 skipBlankLines option 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 skipBlankLines is false, it counts all newlines across token trivia.
  • When skipBlankLines is 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.

@github-actions github-actions bot added the A-CLI Area: CLI label Dec 31, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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:

  1. Line 124: The .collect::<Vec<_>>() inside flat_map is unnecessary—iterators can be chained directly.
  2. Line 128: Using return in 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

📥 Commits

Reviewing files that changed from the base of the PR and between 16ab556 and 419f7e8.

⛔ Files ignored due to path filters (2)
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snap is excluded by !**/*.snap and 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 the dbg!() 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_diagnostic marker and options configuration
  • The issue_number field has been added

Documentation 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.

@diffray-bot

This comment was marked as spam.

Copy link
Contributor

@dyc3 dyc3 left a 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.

@diffray-bot

This comment was marked as spam.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 31, 2025

CodSpeed Performance Report

Merging #8639 will not alter performance

Comparing ohnoah:feat/no-excessive-lines-per-file (eea3931) with main (f764007)1

Summary

✅ 58 untouched
⏩ 95 skipped2

Footnotes

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

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

@dyc3
Copy link
Contributor

dyc3 commented Dec 31, 2025

@ohnoah just curious, did you request the review from diffray-bot?

@ohnoah
Copy link
Contributor Author

ohnoah commented Dec 31, 2025

@ohnoah just curious, did you request the review from diffray-bot?

@dyc3 no, auto-reviewed somehow after a few commits

@ohnoah ohnoah requested a review from dyc3 December 31, 2025 17:40
Copy link
Contributor

@dyc3 dyc3 left a 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

Copy link
Member

@ematipico ematipico left a 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

@ohnoah ohnoah changed the title feat(biome_js_analyze): implement noExcessiveLinesPerFile feat(biome_js_analyze): implement useMaxLinesPerFile Jan 1, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 intermediate Vec for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d5cc5a and 8d82107.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (14)
  • .changeset/wet-squids-agree.md
  • crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/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 the dbg!() 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.rs
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_rule_options/src/use_max_lines_per_file.rs
  • crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_rule_options/src/use_max_lines_per_file.rs
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • 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 : 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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_rule_options/src/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/invalid.options.json
  • crates/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.json
  • crates/biome_js_analyze/src/lint/nursery/use_max_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/validSkipBlankLines.options.json
  • crates/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.rs
  • 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/**/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.rs
  • 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/**/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.rs
  • crates/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.rs
  • crates/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.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/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.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/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.rs
  • crates/biome_js_analyze/tests/specs/nursery/useMaxLinesPerFile/valid.js
  • crates/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.js
  • crates/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: 4 for 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 skipBlankLines feature 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 skipBlankLines testing, 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. With maxLines: 4 configured, 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 maxLines threshold 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_diagnostic markers 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 including Merge. The use of NonZeroU16 for max_lines is a nice touch—prevents zero from being a valid configuration.

@ohnoah ohnoah changed the title feat(biome_js_analyze): implement useMaxLinesPerFile feat(biome_js_analyze): implement noExcessiveLinesPerFile Jan 1, 2026
@ohnoah
Copy link
Contributor Author

ohnoah commented Jan 1, 2026

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

@ematipico I think that discussion is outdated. The merged rule seems to follow my current naming convention. see:
https://biomejs.dev/linter/rules/no-excessive-lines-per-function/ . Would you like to diverge from that here?

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 unnecessary collect() in flat_map.

The .collect::<Vec<_>>() creates an intermediate allocation for every descendant node. Since flat_map can 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8d82107 and fc9fcf9.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (14)
  • .changeset/wet-squids-agree.md
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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/invalidSkipBlankLines.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.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_rule_options/src/lib.rs
  • crates/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 the dbg!() 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.rs
  • crates/biome_rule_options/src/lib.rs
  • crates/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.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • crates/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.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • crates/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.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • crates/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.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_rule_options/src/lib.rs
  • crates/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.md
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.md
  • 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 rule option must have its own h3 header with description, default value, options block, and code example

Applied to files:

  • .changeset/wet-squids-agree.md
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_rule_options/src/lib.rs
  • 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/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • crates/biome_rule_options/src/lib.rs
  • 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: Run `just l` to lint analyzer rule code

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/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.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.options.json
  • 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/**/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.rs
  • 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 `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • 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
  • 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/no_excessive_lines_per_file.rs
  • 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 : Rule options must be placed inside the `biome_rule_options` crate

Applied to files:

  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • 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 `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
  • 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/**/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.rs
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js
  • crates/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.rs
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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: 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.rs
  • 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_rule_options/src/lib.rs
  • 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_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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: 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
  • 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: 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: The skipBlankLines logic 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.

@ohnoah ohnoah requested a review from ematipico January 1, 2026 11:58
@ohnoah ohnoah force-pushed the feat/no-excessive-lines-per-file branch from 104e085 to bbe9e7e Compare January 2, 2026 13:00
@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools labels Jan 2, 2026
@ohnoah ohnoah force-pushed the feat/no-excessive-lines-per-file branch from c3206df to d2b4d25 Compare January 2, 2026 14:47
@github-actions github-actions bot removed the A-Project Area: project label Jan 2, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 intermediate Vec allocations 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

📥 Commits

Reviewing files that changed from the base of the PR and between c3206df and d2b4d25.

⛔ Files ignored due to path filters (10)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/suppressed.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/validSkipBlankLines.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (14)
  • .changeset/wet-squids-agree.md
  • crates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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/invalidSkipBlankLines.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.json
  • 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/valid.js
  • crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.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_rule_options/src/lib.rs
  • crates/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 the dbg!() 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
  • crates/biome_rule_options/src/lib.rs
  • crates/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.js
  • 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: 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.js
  • crates/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.js
  • 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: 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.md
  • crates/biome_rule_options/src/lib.rs
  • 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: 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.md
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • 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: 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.md
  • crates/biome_rule_options/src/lib.rs
  • 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: 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.rs
  • crates/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.rs
  • 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: 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.rs
  • 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 : 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
  • 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 `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
  • 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/**/*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
  • crates/biome_rule_options/src/lib.rs
  • crates/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.rs
  • 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_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
  • 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 `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.rs
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • 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: 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.rs
  • 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 : 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
  • crates/biome_rule_options/src/lib.rs
  • 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/**/*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.md
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/no_excessive_lines_per_file.rs
  • crates/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.md
  • 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: 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.rs
  • crates/biome_rule_options/src/lib.rs
  • crates/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.md
  • crates/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.md
  • crates/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.rs
  • 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 : 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.rs
  • crates/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_types and no_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: 4 threshold.

crates/biome_js_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.json (1)

1-15: LGTM!

Test configuration correctly sets maxLines: 4 to 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/biome as 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, camelCase renaming), 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 omits fix_kind since 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.

@github-actions github-actions bot added the A-Project Area: project label Jan 3, 2026
@dyc3
Copy link
Contributor

dyc3 commented Jan 3, 2026

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
dyc3 previously requested changes Jan 3, 2026
Copy link
Contributor

@dyc3 dyc3 left a 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.

@ohnoah ohnoah requested a review from dyc3 January 4, 2026 11:33
@ohnoah
Copy link
Contributor Author

ohnoah commented Jan 4, 2026

@dyc3 @ematipico should be ready for review now

@ematipico
Copy link
Member

Thank you @ohnoah

I opened #8673 to track the rest of the languages

@ematipico ematipico dismissed dyc3’s stale review January 4, 2026 12:11

Feedback addressed

@ematipico ematipico merged commit 6577e32 into biomejs:main Jan 4, 2026
3 checks passed
@github-actions github-actions bot mentioned this pull request Jan 4, 2026
BaeSeokJae pushed a commit to BaeSeokJae/biome that referenced this pull request Jan 6, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📎 Implement lint/noExcessiveLinesPerFile - eslint/max-lines

4 participants