-
-
Notifications
You must be signed in to change notification settings - Fork 726
feat: promote lint rules #7758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: promote lint rules #7758
Conversation
🦋 Changeset detectedLatest commit: cdd38c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis changeset promotes multiple lint rules into stable groups (suspicious, style, correctness, security), removes the Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**📄 CodeRabbit inference engine (CLAUDE.md)
Files:
crates/biome_*/**📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-10-15T09:20:19.139Z
Applied to files:
📚 Learning: 2025-10-15T09:20:19.139Z
Applied to files:
🧬 Code graph analysis (1)crates/biome_js_analyze/src/lint/correctness/no_qwik_use_visible_task.rs (1)
⏰ 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). (23)
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (28)
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/correctness/noQwikUseVisibleTask/noQwikUseVisibleTask/invalid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/noQwikUseVisibleTask/noQwikUseVisibleTask/valid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-3.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-4.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/valid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useQwikClasslist/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useQwikClasslist/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useConsistentTypeDefinitions/invalidType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_high.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_low.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/valid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/valid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useReactFunctionComponents/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useReactFunctionComponents/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noNonNullAssertedOptionalChain/invalid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noNonNullAssertedOptionalChain/valid.ts.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (11)
.changeset/large-lands-brush.md
(1 hunks)crates/biome_analyze/src/rule.rs
(2 hunks)crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
(1 hunks)crates/biome_js_analyze/src/lint/correctness.rs
(2 hunks)crates/biome_js_analyze/src/lint/nursery/use_anchor_href.rs
(0 hunks)crates/biome_js_analyze/src/lint/security.rs
(1 hunks)crates/biome_js_analyze/src/lint/style.rs
(3 hunks)crates/biome_js_analyze/src/lint/suspicious.rs
(2 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx
(0 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx
(0 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx
(0 hunks)
💤 Files with no reviewable changes (4)
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx
- crates/biome_js_analyze/src/lint/nursery/use_anchor_href.rs
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md
: Create changesets using thejust new-changeset
command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets
Files:
.changeset/large-lands-brush.md
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/suspicious.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/suspicious.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/suspicious.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/suspici 8000 ous.rs
🧠 Learnings (3)
📚 Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : Place all new JavaScript lint rules in the nursery group under biome_js_analyze/lib/src/lint/nursery/<rule_name>.rs
Applied to files:
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/suspicious.rs
📚 Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: If porting a rule from another ecosystem, annotate sources in declare_lint_rule! (e.g., sources: &[RuleSource::Eslint("no-debugger").{same|inspired}()])
Applied to files:
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
📚 Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In declare_lint_rule! blocks, set version: "next" for all rules
Applied to files:
crates/biome_js_analyze/src/lint/suspicious.rs
🧬 Code graph analysis (5)
crates/biome_js_analyze/src/lint/correctness.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Correctness
(1381-1646)
crates/biome_js_analyze/src/lint/style.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Style
(1885-2174)
crates/biome_js_analyze/src/lint/security.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Security
(1860-1881)
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs (1)
crates/biome_analyze/src/rule.rs (2)
sources
(610-613)same
(246-251)
crates/biome_js_analyze/src/lint/suspicious.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Suspicious
(2178-2559)
🪛 LanguageTool
.changeset/large-lands-brush.md
[formatting] ~13-~13: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...p Removed the lint rule useAnchorHref
, because its use case is covered by `useValidAnc...
(COMMA_BEFORE_BECAUSE)
⏰ 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). (8)
- GitHub Check: autofix
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
🔇 Additional comments (6)
crates/biome_analyze/src/rule.rs (1)
150-150
: LGTM! Documentation updated to reflect correct GitHub organisation.crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs (1)
80-80
: LGTM! Additional rule source correctly added.The EslintQwik source broadens the rule coverage as intended by the PR.
Based on learnings
crates/biome_js_analyze/src/lint/suspicious.rs (1)
54-54
: LGTM! NoNonNullAssertedOptionalChain correctly promoted to suspicious group.The module and group registration follow the established pattern.
Also applies to: 88-88
crates/biome_js_analyze/src/lint/style.rs (1)
42-42
: LGTM! Both rules correctly promoted to style group.UseConsistentTypeDefinitions and UseReactFunctionComponents are properly added.
Also applies to: 63-63, 75-75
crates/biome_js_analyze/src/lint/security.rs (1)
10-10
: LGTM! NoSecrets correctly promoted to security group.The module and group registration follow the established pattern.
Also applies to: 11-11
crates/biome_js_analyze/src/lint/correctness.rs (1)
25-25
: LGTM! Three rules correctly promoted to correctness group.NoQwikUseVisibleTask, UseImageSize, and UseQwikClasslist are properly added.
Also applies to: 49-49, 55-55, 61-61
crates/biome_analyze/src/rule.rs
Outdated
Self::EslintN(rule_name) => format!("https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/{rule_name}.md"), | ||
Self::EslintNext(rule_name) => format!("https://nextjs.org/docs/messages/{rule_name}"), | ||
Self::EslintQwik(rule_name) => format!("https://github.com/BuilderIO/eslint-plugin-qwik/blob/main/docs/rules/{rule_name}.md"), | ||
Self::EslintQwik(rule_name) => format!("https://github.com/QwikDev/qwik/tree/main/packages/eslint-plugin-qwik/blob/main/docs/rules/{rule_name}.md"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the malformed GitHub URL pattern.
The URL contains both /tree/main/
and /blob/main/
, which will result in a 404 error. GitHub URLs use either one or the other, not both.
Apply this diff to fix the URL pattern:
- Self::EslintQwik(rule_name) => format!("https://github.com/QwikDev/qwik/tree/main/packages/eslint-plugin-qwik/blob/main/docs/rules/{rule_name}.md"),
+ Self::EslintQwik(rule_name) => format!("https://github.com/QwikDev/qwik/blob/main/packages/eslint-plugin-qwik/docs/rules/{rule_name}.md"),
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Self::EslintQwik(rule_name) => format!("https://github.com/QwikDev/qwik/tree/main/packages/eslint-plugin-qwik/blob/main/docs/rules/{rule_name}.md"), | |
Self::EslintQwik(rule_name) => format!("https://github.com/QwikDev/qwik/blob/main/packages/eslint-plugin-qwik/docs/rules/{rule_name}.md"), |
🤖 Prompt for AI Agents
In crates/biome_analyze/src/rule.rs around line 373, the GitHub URL incorrectly
includes both /tree/main/ and /blob/main/, causing a 404; change the URL to use
only /blob/main/ (remove the /tree/main part) so it becomes
"https://github.com/QwikDev/qwik/bl
8000
ob/main/packages/eslint-plugin-qwik/docs/rules/{rule_name}.md".
CodSpeed Performance ReportMerging #7758 will not alter performanceComparing Summary
Footnotes
|
I've noticed you didn't update the severity level of the rules moved to correctness and security. Is this expected? Do you think some rules could be set to |
I simply forgot about it :) thank you for catching it |
There's a problem, we have a bunch of rules that don't have the correct severity 😅
|
It makes me question why some rules are under the |
We discussed it on Discord before the 2.0 release. We agreed that making it consistent could require too many chnages. Thus, I tried to make the most important changes to ensure some consistency. Here some decisions I/we made:
I think I documented it somewhere. Perhaps on the website as an informal rule of thumbs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
crates/biome_cli/tests/snapshots/main_commands_format/html_disabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_enabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-3.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-4.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useQwikClasslist/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (5)
crates/biome_analyze/src/rule.rs
(2 hunks)crates/biome_cli/tests/commands/format.rs
(2 hunks)crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
(2 hunks)crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
(1 hunks)crates/biome_js_analyze/tests/spec_tests.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
crates/biome_cli/tests/commands/format.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs
: Format Rust files before committing (e.g., viajust f
which formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
crates/biome_cli/tests/commands/format.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_cli/tests/commands/format.rs
🧠 Learnings (11)
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
crates/biome_analyze/src/rule.rs
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
<
8000
/code>
Applied to files:
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
crates/biome_analyze/src/rule.rs
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : If a lint rule is ported or inspired by another linter, add sources metadata in declare_lint_rule! with RuleSource (use .same() or .inspired())
Applied to files:
crates/biome_analyze/src/rule.rs
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/tests/quick_test.rs : Use the quick test at biome_js_analyze/tests/quick_test.rs by un-ignoring and adjusting SOURCE and RuleFilter for ad-hoc checks
Applied to files:
crates/biome_analyze/src/rule.rs
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
crates/biome_analyze/src/rule.rs
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use declare_lint_rule! with version set to "next" for every rule definition
Applied to files:
crates/biome_analyze/src/rule.rs
📚 Learning: 2025-10-15T09:22:15.838Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.838Z
Learning: Applies to crates/biome_formatter/tests/spec_test.rs : Implement a `run` function in tests/spec_test.rs that wires SpecSnapshot and includes!("language.rs") as shown
Applied to files:
crates/biome_js_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.838Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.838Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-10-15T09:22:15.838Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.838Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : In tests/spec_tests.rs, generate tests with `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}`
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-10-15T09:22:15.838Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.838Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Place HTML test cases under tests/specs/html as .html files discovered by the test macro
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_cli/tests/commands/format.rs
🧬 Code graph analysis (4)
crates/biome_js_analyze/src/lint/correctness/use_image_size.rs (1)
crates/biome_analyze/src/rule.rs (2)
severity
(620-623)severity
(1286-1288)
crates/biome_js_analyze/tests/spec_tests.rs (1)
crates/biome_formatter_test/src/spec.rs (1)
input_code
(95-97)
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs (1)
crates/biome_analyze/src/rule.rs (2)
severity
(620-623)severity
(1286-1288)
crates/biome_cli/tests/commands/format.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
⏰ 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). (11)
- GitHub Check: autofix
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
🔇 Additional comments (6)
crates/biome_cli/tests/commands/format.rs (1)
3419-3441
: Test correctly reflects HTML formatter now disabled by default.The changes are internally consistent and technically sound. However, this HTML formatter behaviour change appears unrelated to the PR's objective of promoting lint rules. Was this intentional for this PR?
crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs (1)
34-34
: LGTM! Severity correctly set for correctness group.The severity change to
Error
aligns with the project's guideline that correctness rules must have Error severity.crates/biome_js_analyze/tests/spec_tests.rs (1)
136-136
: LGTM! Type correction.Removes the unnecessary double reference since
input_code
is already shadowed to&str
on line 128.crates/biome_js_analyze/src/lint/correctness/use_image_size.rs (2)
11-14
: LGTM! Documentation improvement.The added explanation about layout shifts and user experience clearly justifies the rule's importance.
51-51
: LGTM! Severity correctly set for correctness group.The severity change to
Error
aligns with the project's guideline that correctness rules must have Error severity.crates/biome_analyze/src/rule.rs (1)
150-150
: LGTM!Documentation correctly updated to reference the current QwikDev repository.
Can you please look for this information and make it more formal?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
crates/biome_cli/tests/snapshots/main_commands_lint/linter_shows_the_default_severity_of_rule_on.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid.cjs.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalidClass.cjs.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalidFunction.cjs.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalidFunction.js.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (6)
.changeset/public-experts-change.md
(1 hunks)crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs
(2 hunks)crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
(1 hunks)crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js
(1 hunks)crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
- .changeset/public-experts-change.md
- crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js
crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js
crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs
: Format Rust files before committing (e.g., viajust f
which formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs (1)
crates/biome_js_factory/src/generated/node_factory.rs (1)
js_directive
(849-854)
🔇 Additional comments (4)
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx (2)
1-19
: Test structure looks appropriate.The fixture correctly covers elements with implicit
generic
role per HTML AAM, suitable for testing redundant role assignments.
9-11
: No change needed for<div open>
This mirrors the WPT source (roles-generic.html includes<div open>
), so the edge-case test is intentional.crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js (1)
1-7
: LGTM!The test fixture appropriately exercises the trivia-preservation behaviour with a reference directive, multiple leading comments, a trailing comment, and subsequent code.
crates/biome_js_analyze/src/lint/suspicious/no_redundant_use_strict.rs (1)
5-5
: LGTM!The new imports support the updated trivia-preservation implementation in the action method.
Also applies to: 8-8
FYI, I removed the lint rule |
Does Biome just skip that file entirely then? If not, the rule basically tries to make the file comply with the spec. And what about embedded into a markdown? Also, the next branch supports HTML-ish languages. Should the rule perhaps also exist for html? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs (2)
129-129
: Preferis_empty()
overlen() > 0
.For readability, consider using the idiomatic
!is_empty()
check:-AnyJsStatement::JsBlockStatement(block) => block.statements().len() > 0, +AnyJsStatement::JsBlockStatement(block) => !block.statements().is_empty(),
136-139
: Consider replacing?
with.ok().is_some_and()
for an explicit EOF checkThe
?
-based early return oneof_token().ok()?
is used in JS, CSS and GraphQL to treat missing EOF as “no diagnostic.” Switching tonode.eof_token().ok().is_some_and(|t| t.has_leading_comments())
is purely stylistic and optional.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap
is excluded by!**/*.snap
and included by**
crates/biome_json_analyze/src/lint/nursery.rs
is excluded by!**/nursery.rs
and included by**
crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/empty.json.snap
is excluded by!**/*.snap
and included by**
crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (8)
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
(3 hunks)crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql
(1 hunks)crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json
(1 hunks)crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
(0 hunks)crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/comment.jsonc
(0 hunks)crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json
(0 hunks)
💤 Files with no reviewable changes (3)
- crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json
- crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/comment.jsonc
- crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
✅ Files skipped from review due to trivial changes (2)
- crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql
- crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs
: Format Rust files before committing (e.g., viajust f
which formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
🧠 Learnings (1)
📚 Learning: 2025-10-15T09:20:19.126Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.126Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
⏰ 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). (19)
- GitHub Check: autofix
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_analyze)
🔇 Additional comments (1)
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs (1)
85-88
: Good catch on EOF trivia.This neatly covers the comment-only-on-EOF case and keeps the rule honest. Cheers.
/// ```graphql,ignore | ||
/// # Invalid comment | ||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore exercised doc examples.
Swapping these snippets to ignore
(and dropping use_options
) means the docs no longer prove the behaviour: the “Invalid” example stops asserting a diagnostic, and the “Valid” one no longer enables allowComments
. Let’s keep the guide authoritative by running the snippets again with the right modifiers.
Apply this diff:
-/// ```graphql,ignore
-/// # Invalid comment
+/// ```graphql,expect_diagnostic
+/// # Invalid comment
@@
-/// ```graphql,ignore
-/// # Valid comment
+/// ```graphql,use_options
+/// # Valid comment
Also applies to: 62-64
🤖 Prompt for AI Agents
In crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs around lines
22-24 (and similarly 62-64), the doc examples were changed to use `ignore` and
dropped `use_options`, which stops the examples from exercising diagnostics and
options; restore the executable modifiers: change the first snippet to use
`graphql,expect_diagnostic` so the invalid example asserts a diagnostic, and
change the second to `graphql,use_options` so the valid example runs with
allowComments enabled; update only the snippet modifiers accordingly so the
examples are executed and continue to document the behavior.
No, it emits a parsing error for an empty file.
Which spec though? Different languages have different specs :)
If you mean the code inside code blocks of rule docs, I'm not sure what you're asking. What about what?
It could, yes! |
Trying to make the file comply with the official spec, requiring at least something in the json file. Instead of throwing a parsing error
I mean embedded json into markdown code blocks. Not specially the rules docs, any markdown (once markdown is implemented) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json (1)
5-5
: Align level with style guidance or confirm"on"
supportFor style rules, prefer
info
(orwarn
). If object form does not accept"on"
, switch to:- "level": "on", + "level": "info",Otherwise, please confirm the schema permits
"level": "on"
.Use the same script shared in the sibling comment to verify repo-wide usage and schema expectations.
Also applies to: 7-7
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_high.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_low.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noRedundantUseStrict/invalid-with-trivia.js.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (2)
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
(1 hunks)crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
🧠 Learnings (1)
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#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/style/useConsistentTypeDefinitions/validType.options.json
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
⏰ 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). (19)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: autofix
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (3)
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json (2)
2-2
: Schema path looks reasonableRelative hop count matches directory depth. No concerns here.
5-5
: No change needed: “on” is a valid level
The schema, tests and CHANGELOG consistently use"on"
to enable rules with default severity—no replacement required.Likely an incorrect or invalid review comment.
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json (1)
2-2
: Schema reference OKMatches the generated configuration schema location; no action needed. Based on learnings
Ah ok. In this case, the lint rule isn't needed then, because the parser does that already.
Tomorrow's problem! 😆 |
13d8699
to
20cd1e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (2)
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs (1)
22-24
: Restore executable doc examples.Changing these snippets to
ignore
removes the assertions—the "Invalid" example no longer proves a diagnostic is emitted, and the "Valid" example doesn't exerciseallowComments
. Restoreexpect_diagnostic
on line 22 anduse_options
on line 62 to keep the docs executable and authoritative.Also applies to: 62-64
.changeset/large-lands-brush.md (1)
13-13
: Remove the comma before “because”.Tiny grammar tweak for flow.
As per coding guidelines.
-Removed the lint rule `useAnchorHref`, because its use case is covered by `useValidAnchor`. +Removed the lint rule `useAnchorHref` because its use case is covered by `useValidAnchor`.
🧹 Nitpick comments (2)
.changeset/large-lands-brush.md (2)
5-12
: End each sentence with a period.Tighten up the changeset style.
As per coding guidelines.
- Promoted `noNonNullAssertedOptionalChain` to the suspicious group - Promoted `useReactFunctionComponents` to the `style` group - Promoted `useImageSize` to the `correctness` group - Promoted `useConsistentTypeDefinitions` to the `style` group - Promoted `useQwikClasslist` to the `correctness` group - Promoted `noSecrets` to the `security` group -Removed the lint rule `useAnchorHref`, because its use case is covered by `useValidAnchor`. + - Promoted `noNonNullAssertedOptionalChain` to the suspicious group. + - Promoted `useReactFunctionComponents` to the `style` group. + - Promoted `useImageSize` to the `correctness` group. + - Promoted `useConsistentTypeDefinitions` to the `style` group. + - Promoted `useQwikClasslist` to the `correctness` group. + - Promoted `noSecrets` to the `security` group. +Removed the lint rule `useAnchorHref` because its use case is covered by `useValidAnchor`.Also applies to: 13-13
5-12
: Add links to each rule page.Readers love receipts; link each mentioned rule to its docs.
As per coding guidelines.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (41)
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_cli/tests/snapshots/main_cases_linter_domains/should_enable_domain_via_cli.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_disabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_enabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_lint/linter_shows_the_default_severity_of_rule_on.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_configuration/incorrect_rule_name.snap
is excluded by!**/*.snap
and included by**
crates/biome_configuration/src/analyzer/linter/rules.rs
is excluded by!**/rules.rs
and included by**
crates/biome_configuration/src/generated/domain_selector.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_diagnostics_categories/src/categories.rs
is excluded by!**/categories.rs
and included by**
crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql.snap
is excluded by!**/*.snap
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/correctness/noQwikUseVisibleTask/noQwikUseVisibleTask/invalid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/noQwikUseVisibleTask/noQwikUseVisibleTask/valid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-3.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid-4.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/valid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useImageSize/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useQwikClasslist/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/correctness/useQwikClasslist/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_high.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/invalid_entropy_low.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/security/noSecrets/valid.js.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/valid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useReactFunctionComponents/invalid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/style/useReactFunctionComponents/valid.jsx.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noNonNullAssertedOptionalChain/invalid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_analyze/tests/specs/suspicious/noNonNullAssertedOptionalChain/valid.ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_json_analyze/src/lint/nursery.rs
is excluded by!**/nursery.rs
and included by**
crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/empty.json.snap
is excluded by!**/*.snap
and included by**
crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json.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 (26)
.changeset/large-lands-brush.md
(1 hunks)crates/biome_analyze/src/rule.rs
(2 hunks)crates/biome_cli/tests/commands/format.rs
(2 hunks)crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
(3 hunks)crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql
(1 hunks)crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json
(1 hunks)crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
(1 hunks)crates/biome_js_analyze/src/lint/correctness.rs
(2 hunks)crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
(2 hunks)crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
(1 hunks)crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
(1 hunks)crates/biome_js_analyze/src/lint/nursery/use_anchor_href.rs
(0 hunks)crates/biome_js_analyze/src/lint/security.rs
(1 hunks)crates/biome_js_analyze/src/lint/style.rs
(3 hunks)crates/biome_js_analyze/src/lint/suspicious.rs
(2 hunks)crates/biome_js_analyze/tests/spec_tests.rs
(1 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx
(0 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx
(0 hunks)crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx
(0 hunks)crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
(1 hunks)crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
(1 hunks)crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
(0 hunks)crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/comment.jsonc
(0 hunks)crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json
(0 hunks)crates/biome_rule_options/src/lib.rs
(0 hunks)
💤 Files with no reviewable changes (8)
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/invalid.jsx
- crates/biome_json_analyze/tests/specs/nursery/noEmptySource/valid/object.json
- crates/biome_rule_options/src/lib.rs
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid.jsx
- crates/biome_js_analyze/tests/specs/nursery/useAnchorHref/valid-2.jsx
- crates/biome_js_analyze/src/lint/nursery/use_anchor_href.rs
- crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
- crates/biome_json_analyze/tests/specs/nursery/noEmptySource/invalid/comment.jsonc
🚧 Files skipped from review as they are similar to previous changes (9)
- crates/biome_js_analyze/tests/spec_tests.rs
- crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.options.json
- crates/biome_js_analyze/src/lint/correctness/use_image_size.rs
- crates/biome_js_analyze/src/lint/suspicious.rs
- crates/biome_js_analyze/src/lint/correctness/use_qwik_classlist.rs
- crates/biome_graphql_analyze/tests/specs/nursery/noEmptySource/valid/allowComments.graphql
- crates/biome_cli/tests/commands/format.rs
- crates/biome_analyze/src/rule.rs
- crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/validType.options.json
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/correctness.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/correctness.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period
Files:
.changeset/large-lands-brush.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs
: Format Rust files before committing (e.g., viajust f
which formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/style.rs
crates/biome_js_analyze/src/lint/security.rs
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_js_analyze/src/lint/correctness.rs
🧠 Learnings (6)
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#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/style/useConsistentTypeDefinitions/invalidType.options.json
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use declare_lint_rule! with version set to "next" for every rule definition
Applied to files:
crates/biome_js_analyze/src/lint/style.rs
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : If a lint rule is ported or inspired by another linter, add sources metadata in declare_lint_rule! with RuleSource (use .same() or .inspired())
Applied to files:
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead
Applied to files:
crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Mark code blocks in documentation with a language and required properties (e.g., expect_diagnostic for invalid snippets; options/full_options/use_options as needed). Each invalid snippet must emit exactly one diagnostic
Applied to files:
crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
🧬 Code graph analysis (3)
crates/biome_js_analyze/src/lint/security.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Security
(1840-1865)
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs (1)
crates/biome_analyze/src/rule.rs (2)
sources
(610-613)same
(246-251)
crates/biome_js_analyze/src/lint/correctness.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
Correctness
(1381-1658)
🪛 LanguageTool
.changeset/large-lands-brush.md
[formatting] ~13-~13: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...p Removed the lint rule useAnchorHref
, because its use case is covered by `useValidAnc...
(COMMA_BEFORE_BECAUSE)
⏰ 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). (21)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_configuration)
- GitHub Check: autofix
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: lint
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
🔇 Additional comments (6)
crates/biome_js_analyze/src/lint/a11y/use_valid_anchor.rs (1)
80-80
: LGTM! Sources attribution correctly updated.The addition of
RuleSource::EslintQwik("jsx-a").same()
properly consolidates the functionality from the removeduseAnchorHref
rule. Using.same()
correctly indicates identical logic, as per coding guidelines.Based on learnings.
crates/biome_css_analyze/src/lint/nursery/no_empty_source.rs (1)
85-88
: Trailing comment detection now works correctly.The added check for
eof_token().ok()?.has_leading_comments()
ensures that comments attached to the EOF token are recognised whenallowComments
is enabled. This fixes a gap where trailing comments weren't being detected.crates/biome_js_analyze/src/lint/nursery/no_empty_source.rs (1)
136-139
: LGTM—trailing comment detection enhanced.Consistent with the CSS and GraphQL implementations, this now properly recognises comments attached to the EOF token when
allowComments
is enabled.crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs (1)
87-90
: LGTM—trailing comment detection enhanced.Matches the CSS and JS implementations, correctly handling comments attached to the EOF token when
allowComments
is enabled.crates/biome_js_analyze/tests/specs/style/useConsistentTypeDefinitions/invalidType.options.json (1)
2-13
: All checks passed—fixtures and schema are consistent. ✓Both
validType.options.json
andinvalidType.options.json
use the newstyle.useConsistentTypeDefinitions
layout with"level": "on"
, and the schema path resolves correctly. Nothing to worry about here.crates/biome_js_analyze/src/lint/security.rs (1)
10-11
: Module wiring and schema exposure verified—severity confirmation needed.The
NoSecrets
rule is correctly exported, grouped, and exposed in the workspace schema. However, I couldn't locate an explicit severity configuration in the rule file itself. Severity may be set through macro defaults or a separate configuration layer. Please manually confirm that the default severity is Error as intended by checking the rule's macro implementation or configuration documentation.
Summary
useAnchorHref
because we already haveuseValidAnchor
(updated the sources of the rule)noNonNullAssertedOptionalChain
to the suspicious groupuseReactFunctionComponents
to thestyle
groupuseImageSize
tocorrectness
groupuseConsistentTypeDefinitions
tostyle
groupuseQwikClasslist
tocorrectness
groupnoSecrets
tosecurity
groupTest Plan
Updated the snapshots
Docs
N/A