-
-
Notifications
You must be signed in to change notification settings - Fork 760
feat(html/analyze): add useVueValidVBind #8060
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
Conversation
🦋 Changeset detectedLatest commit: db1b096 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
04a0aed to
a8ab862
Compare
CodSpeed Performance ReportMerging #8060 will not alter performanceComparing Summary
Footnotes
|
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
WalkthroughAdds a new Vue nursery lint rule Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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: 1
🧹 Nitpick comments (2)
xtask/codegen/src/generate_new_analyzer_rule.rs (1)
423-423: Consider a more specific default Query type.Using
HtmlRootas the template's default Query type means every generated rule will match the entire document once. Most HTML lint rules target specific elements or attributes, not the document root. Consider using a more typical node type likeHtmlElementorHtmlAttributeas the template default to better guide rule authors.Compare with other templates: Js uses
JsIdentifierBinding, Css usesCssDeclarationOrRuleBlock, Json usesJsonMember.crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (1)
13-14: Clarify the documentation wording.Line 13 says "does not have that attribute value", which is a bit confusing. It should more clearly state "does not have an argument" or "is missing a binding value expression", since the example shows a directive without a value expression (e.g.,
<div v-bind:aaa></div>).Apply this diff to improve clarity:
- /// - The directive does not have that attribute value. E.g. <div v-bind:aaa></div> + /// - The directive is missing a binding value expression. E.g. <div v-bind:aaa></div>
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (11)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(3 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/no_vue_invalid_v_bind.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (30)
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/**/*.rs : Do not copy or clone data between module graph entries (including behind Arc). Each module must avoid holding duplicated data from another module to enable simple invalidation.
Applied to files:
crates/biome_rule_options/src/lib.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_rule_options/src/no_vue_invalid_v_bind.rscrates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
justfilextask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement and expose the Workspace trait in src/workspace.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/**/Cargo.toml : Add the specified dev-dependencies under [dev-dependencies] for the test infrastructure
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/server.rs : WorkspaceServer must maintain workspace state and is used in the daemon and CLI daemonless mode
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace_watcher.rs : WorkspaceWatcher should synchronize workspace state with the filesystem and be active only in daemon mode (not used by the CLI)
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rscrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register any new diagnostic category in `crates/biome_diagnostics_categories/src/categories.rs`
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/**/src/lexer/mod.rs : Create a lexer module at crates/<parser_crate>/src/lexer/mod.rs
Applied to files:
crates/biome_html_analyze/src/lint.rs
🧬 Code graph analysis (3)
crates/biome_html_analyze/tests/spec_tests.rs (1)
crates/biome_html_parser/src/lib.rs (1)
parse_html(37-40)
crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (3)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
RuleDomain(927-935)TextRange(9414-9414)crates/biome_analyze/src/rule.rs (4)
recommended(602-605)domains(632-635)sources(617-620)same(246-251)crates/biome_html_factory/src/generated/node_factory.rs (1)
vue_directive(584-591)
crates/biome_html_analyze/src/lint.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
A11y(1043-1196)Nursery(1662-1799)
⏰ 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: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Parser conformance
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: autofix
🔇 Additional comments (15)
justfile (1)
106-109: LGTM!The HTML lint rule generator follows the established pattern for other languages. Consistent and correct.
xtask/codegen/src/generate_new_analyzer_rule.rs (2)
12-12: LGTM!Html variant properly integrated into LanguageKind enum and its conversions.
Also applies to: 22-22, 35-35
356-380: Good addition of scaffolding!Adding the
runanddiagnosticfunction bodies for GraphQL rules improves the template completeness.crates/biome_html_analyze/Cargo.toml (1)
22-22: LGTM!Necessary dependency for the rule options support.
.changeset/tall-jokes-send.md (1)
1-5: LGTM!Changeset properly documents the new rule.
crates/biome_rule_options/src/lib.rs (1)
246-246: LGTM!Module export properly placed in alphabetical order.
crates/biome_html_analyze/tests/spec_tests.rs (2)
16-17: Good addition of Vue file support!Extending test discovery to include Vue files enables testing of Vue-specific lint rules.
97-97: Correct use of source_type!Properly passing the detected source type to the parser enables Vue-specific parsing behaviour.
crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue (1)
1-27: Excellent test coverage!The test fixture thoroughly covers various invalid
v-bindscenarios including missing arguments, invalid modifiers, and both long-form and shorthand syntax. Well-documented with clear comments.crates/biome_html_analyze/src/lint.rs (1)
6-7: LGTM!Nursery module and group properly integrated into the lint category.
crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue (1)
1-32: Excellent test coverage!The valid test cases are comprehensive and well-documented. They cover all the key scenarios: basic bindings (long-form and shorthand), all valid modifiers, combined modifiers, dynamic arguments, and edge cases like kebab-case attributes.
crates/biome_rule_options/src/no_vue_invalid_v_bind.rs (1)
1-6: LGTM! Standard empty options pattern.The empty options struct follows the established pattern for rules without configurable options. All derives and serde attributes are appropriate.
crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (3)
47-82: Solid implementation!The rule logic correctly handles both long-form
v-bind:and shorthand:directives. The filtering by directive name, missing argument detection, and invalid modifier validation all look correct.The comment on line 72 about the parser catching missing arguments for shorthand syntax is a helpful clarification.
84-115: Clear and helpful diagnostics!Both diagnostic messages provide good context and actionable guidance. The examples and notes will help users quickly understand and fix the issues.
40-40: VALID_MODIFIERS and helper function look correct.The list of valid modifiers matches the ESLint rule specification, and the
find_invalid_modifiershelper correctly identifies invalid modifiers by returning the range of the first offending modifier.Also applies to: 117-124
2cddaf8 to
8b46f75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (1)
34-34: Consider deferringrecommended: trueuntil after the nursery period.Nursery rules typically remain
recommended: falseuntil they've been thoroughly tested and promoted to a stable group.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (11)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(2 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/no_vue_invalid_v_bind.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- .changeset/tall-jokes-send.md
- crates/biome_rule_options/src/lib.rs
- crates/biome_html_analyze/src/lint.rs
- crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue
🧰 Additional context used
🧠 Learnings (27)
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_rule_options/src/no_vue_invalid_v_bind.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 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 : Use `dbg_write!` to debug and inspect the emitted IR during formatting
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement and expose the Workspace trait in src/workspace.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/**/Cargo.toml : Add the specified dev-dependencies under [dev-dependencies] for the test infrastructure
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rsjustfile
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Bogus nodes must be part of a variant/union (e.g., AnyHtmlAttribute includes HtmlBogusAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
🧬 Code graph analysis (2)
crates/biome_html_analyze/tests/spec_tests.rs (1)
crates/biome_html_parser/src/lib.rs (1)
parse_html(37-40)
crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
RuleDomain(927-935)crates/biome_analyze/src/rule.rs (4)
recommended(602-605)domains(632-635)sources(617-620)same(246-251)
⏰ 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). (18)
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: autofix
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Parser conformance
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_formatter)
🔇 Additional comments (11)
crates/biome_html_analyze/Cargo.toml (1)
22-22: LGTM!The workspace dependency addition is correct and necessary for the new rule options.
justfile (1)
106-109: LGTM!The HTML lint rule generator follows the established pattern for other languages.
xtask/codegen/src/generate_new_analyzer_rule.rs (2)
12-12: LGTM!The HTML language variant is properly integrated into the
LanguageKindenum with complete string conversion support.Also applies to: 22-22, 35-35
384-456: LGTM!The HTML rule template is well-structured and consistent with other language templates. Uses
HtmlRootas the query type and includes appropriate boilerplate for diagnostics.crates/biome_html_analyze/tests/spec_tests.rs (2)
16-17: LGTM!Adding
.vuefile support to test discovery is necessary for the new Vue-specific lint rule.
96-96: LGTM!Using the actual source type instead of default options is correct—Vue files require different parse options than plain HTML.
crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue (1)
1-27: LGTM!The test file provides comprehensive coverage of invalid v-bind scenarios, including edge cases like mixed modifiers and dynamic arguments.
crates/biome_rule_options/src/no_vue_invalid_v_bind.rs (1)
1-6: LGTM!The options struct follows the standard pattern with appropriate derives, allowing for future extensibility whilst keeping the current rule simple.
crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs (3)
53-82: LGTM!The logic correctly handles both
VueDirectiveandVueVBindShorthandDirectiveforms, properly delegating modifier validation to the helper function.
84-114: LGTM!The diagnostic messages are clear and actionable, with helpful notes explaining the requirements and providing examples.
117-124: LGTM!The helper function cleanly validates modifiers and returns the range of the first invalid modifier for precise diagnostics.
dd4767f to
f5c5d39
Compare
724e7a4 to
46f0b31
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: 0
🧹 Nitpick comments (3)
xtask/rules_check/src/lib.rs (1)
285-293: Consider refactoring the HACK to a proper solution.Whilst this workaround enables HTML rule testing, the explicit "HACK" comment signals technical debt. The root issue is that
test.document_file_source()uses JS-first resolution with experimental HTML support disabled (seebiome_ruledoc_utils/src/codeblock.rs:95-98).The fallback to
HtmlFileSource::html()when extension parsing fails might not be appropriate for all tags. Consider verifying that unknown tags should default to plain HTML rather than erroring.A cleaner long-term solution would be to make
document_file_source()language-aware, but that's likely beyond this PR's scope.xtask/codegen/src/generate_new_analyzer_rule.rs (1)
404-412: Consider a more illustrative example for the template.The current example shows
<div></div>as invalid, but this doesn't clearly demonstrate an "empty block" issue compared to the valid case. A clearer template example might help future rule authors.Perhaps something like:
/// ### Invalid /// /// ```html,expect_diagnostic -/// <div></div> +/// <style></style> /// ``` /// /// ### Valid /// /// ```html -/// <div>foo</div> +/// <style>body { color: red; }</style> /// ```This better matches the "empty block" diagnostic message, though rule authors will customise this anyway.
crates/biome_html_analyze/src/lint.rs (1)
6-7: LGTM—nursery group registered correctly.The addition of the
nurserymodule and its registration in theLintcategory follows the expected pattern.Minor note: duplicate comment on lines 1 and 3, though this is generated code.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (13)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(2 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/no_vue_invalid_v_bind.rs(1 hunks)crates/biome_ruledoc_utils/src/codeblock.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)xtask/rules_check/src/lib.rs(6 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_ruledoc_utils/src/codeblock.rs
🚧 Files skipped from review as they are similar to previous changes (7)
- crates/biome_html_analyze/Cargo.toml
- crates/biome_html_analyze/tests/spec_tests.rs
- crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/invalid.vue
- crates/biome_rule_options/src/no_vue_invalid_v_bind.rs
- .changeset/tall-jokes-send.md
- crates/biome_rule_options/src/lib.rs
- crates/biome_html_analyze/src/lint/nursery/no_vue_invalid_v_bind.rs
🧰 Additional context used
🧠 Learnings (18)
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register any new diagnostic category in `crates/biome_diagnostics_categories/src/categories.rs`
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
crates/biome_html_analyze/src/lint.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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:
xtask/rules_check/src/lib.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rsjustfile
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Bogus nodes must be part of a variant/union (e.g., AnyHtmlAttribute includes HtmlBogusAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
🧬 Code graph analysis (1)
xtask/rules_check/src/lib.rs (3)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source(96-99)crates/biome_js_syntax/src/file_source.rs (1)
try_from_extension(337-358)crates/biome_html_syntax/src/file_source.rs (2)
try_from_extension(112-121)html(43-47)
⏰ 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). (26)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Check JS Files
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: autofix
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Parser conformance
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
🔇 Additional comments (6)
xtask/rules_check/src/lib.rs (3)
268-276: LGTM: Language context propagated correctly.The addition of
rule_languageparameter enables language-specific handling in test infrastructure, which aligns with the PR's goal of adding HTML lint rules.
758-758: Correct parameter threading.The rule language is properly sourced from
rule_metadata.languageand passed to theTestRunner.
837-862: LGTM: TestRunner updates are consistent.The new
rule_languagefield is properly initialised in the constructor and correctly passed toassert_lintwhen running tests. The threading is clean and consistent.xtask/codegen/src/generate_new_analyzer_rule.rs (1)
12-12: LGTM: Html language variant correctly integrated.The Html variant is properly added to the enum and its conversion methods, following the established pattern for other languages.
Also applies to: 22-22, 35-35
justfile (1)
106-109: LGTM!Follows the established pattern for other language lint rule tasks. Consistent implementation.
crates/biome_html_analyze/tests/specs/nursery/noVueInvalidVBind/valid.vue (1)
1-32: Version mismatch detected—clarify which Vue version the rule targets.The official Vue docs confirm modifiers differ by version: Vue 3 supports .camel, .prop, .attr; Vue 2 supports .camel, .prop, .sync. Your test file includes all four as valid (lines 11, 14), which works only if the rule supports both versions. Please confirm:
- Does the rule target Vue 3, Vue 2, or both?
- If both, test cases should indicate version context.
46f0b31 to
bdf59be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (1)
44-44: Remove deprecatedsyncmodifier for Vue 3 compatibility.As noted in the previous review, the
syncmodifier is not valid in Vue 3. The valid modifiers are.camel,.prop, and.attr.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (13)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(2 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/use_vue_valid_v_bind.rs(1 hunks)crates/biome_ruledoc_utils/src/codeblock.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)xtask/rules_check/src/lib.rs(6 hunks)
✅ Files skipped from review due to trivial changes (2)
- crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue
- crates/biome_ruledoc_utils/src/codeblock.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- crates/biome_html_analyze/tests/spec_tests.rs
- xtask/rules_check/src/lib.rs
- crates/biome_rule_options/src/lib.rs
🧰 Additional context used
🧠 Learnings (22)
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register any new diagnostic category in `crates/biome_diagnostics_categories/src/categories.rs`
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_analyze/src/lint.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/src/lint.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_analyze/src/lint.rscrates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/**/src/lexer/mod.rs : Create a lexer module at crates/<parser_crate>/src/lexer/mod.rs
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
crates/biome_html_analyze/src/lint.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/**/Cargo.toml : Add the specified dev-dependencies under [dev-dependencies] for the test infrastructure
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement and expose the Workspace trait in src/workspace.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_rule_options/src/use_vue_valid_v_bind.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rsjustfile
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.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). (1)
- GitHub Check: Validate PR title
🔇 Additional comments (11)
.changeset/tall-jokes-send.md (1)
1-5: Changelog entry reads wellLinking the rule straight to the docs will save readers a hop; looks spot on.
crates/biome_html_analyze/Cargo.toml (1)
22-22: Dependency wiring makes sensePulling in
biome_rule_optionskeeps the analyser side in step with the new options surface—no complaints here.justfile (1)
106-109: html rule scaffolding will help contributorsMatching the other new--lintrule recipes keeps things familiar—future HTML rules just got a friendly shortcut.
xtask/codegen/src/generate_new_analyzer_rule.rs (1)
12-454: HTML generator branch slots in neatlyThe new variant, template, and stubbed diagnostics mirror the existing languages, so
--kind=htmlshould now spit out compilable scaffolding without drama.crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue (1)
1-29: Invalid matrix covers the troublemakersNice spread of missing arguments and rogue modifiers—plenty of chances for the rule to flex its error messages.
crates/biome_html_analyze/src/lint.rs (1)
1-7: LGTM! Generated code follows the expected pattern.The nursery module is correctly added and wired into the Lint category declaration.
crates/biome_rule_options/src/use_vue_valid_v_bind.rs (1)
1-6: LGTM! Standard options boilerplate.The empty struct is fine as a placeholder for future configuration options.
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (4)
57-86: Implementation logic is sound.The rule correctly handles both full
v-bindand shorthand:forms, with appropriate checks for missing arguments and invalid modifiers.
112-112: Note: Update this message after fixing VALID_MODIFIERS.When you remove "sync" from line 44, remember to update this diagnostic message to reflect only the valid modifiers: "prop", "camel", and "attr".
121-128: Helper function is clean and correct.The validation logic is straightforward and handles the modifier check appropriately.
38-38: The code follows project conventions—Vue nursery rules are intentionallyrecommended: true.The concern about
recommended: truein a nursery rule is unfounded. Analysis of other nursery rules reveals that Vue-related rules in this codebase (no_vue_reserved_keys,no_vue_duplicate_keys,no_vue_data_object_declaration) intentionally userecommended: true, whilst most other nursery rules usefalse. SinceuseVueValidVBindis a Vue-domain rule sourced from ESLint Vue.js, it correctly follows this established pattern.Likely an incorrect or invalid review comment.
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs
Outdated
Show resolved
Hide resolved
bdf59be to
0ddf5bb
Compare
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs
Outdated
Show resolved
Hide resolved
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 (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (1)
10-14: Doc note still talks about “attribute value”.Small tidy-up: the sentence should describe a missing value (or adjust the example), per prior feedback. It still says “The directive does not have that attribute value” while the example shows an argument-only binding. Could you rephrase it to match the actual failure case?(eslint.vuejs.org)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (13)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(2 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/use_vue_valid_v_bind.rs(1 hunks)crates/biome_ruledoc_utils/src/codeblock.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)xtask/rules_check/src/lib.rs(6 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_ruledoc_utils/src/codeblock.rs
🚧 Files skipped from review as they are similar to previous changes (7)
- .changeset/tall-jokes-send.md
- crates/biome_html_analyze/tests/spec_tests.rs
- crates/biome_rule_options/src/lib.rs
- crates/biome_rule_options/src/use_vue_valid_v_bind.rs
- crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue
- justfile
- crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue
🧰 Additional context used
🧠 Learnings (23)
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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:
xtask/rules_check/src/lib.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/**/Cargo.toml : Add the specified dev-dependencies under [dev-dependencies] for the test infrastructure
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement and expose the Workspace trait in src/workspace.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/Cargo.tomlcrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/**/*.rs : Do not copy or clone data between module graph entries (including behind Arc). Each module must avoid holding duplicated data from another module to enable simple invalidation.
Applied to files:
crates/biome_html_analyze/Cargo.toml
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rscrates/biome_html_analyze/src/lint.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register any new diagnostic category in `crates/biome_diagnostics_categories/src/categories.rs`
Applied to files:
crates/biome_html_analyze/src/lint.rs
🧬 Code graph analysis (2)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (1)
crates/biome_analyze/src/rule.rs (4)
recommended(602-605)domains(632-635)sources(617-620)same(246-251)
xtask/rules_check/src/lib.rs (4)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source(96-99)crates/biome_js_syntax/src/file_source.rs (1)
try_from_extension(337-358)crates/biome_service/src/file_handlers/mod.rs (1)
try_from_extension(168-204)crates/biome_html_syntax/src/file_source.rs (2)
try_from_extension(112-121)html(43-47)
⏰ 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). (27)
- GitHub Check: Validate rules documentation
- GitHub Check: autofix
- GitHub Check: Check JS Files
- GitHub Check: Test Node.js API
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_tailwind_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Parser conformance
🔇 Additional comments (1)
xtask/rules_check/src/lib.rs (1)
285-293: Nice call forcing HTML parsing here.This sidesteps the JS embedding route for
.vuesnippets, so the HTML analyser actually runs over the template content—exactly what this new rule needs.
| const VALID_MODIFIERS: &[&str] = &["prop", "camel", "sync", "attr"]; | ||
|
|
||
| pub enum ViolationKind { | ||
| MissingArgument, | ||
| InvalidModifier(TextRange), | ||
| } | ||
|
|
||
| impl Rule for UseVueValidVBind { | ||
| type Query = Ast<AnyVueDirective>; | ||
| type State = ViolationKind; | ||
| type Signals = Option<Self::State>; | ||
| type Options = UseVueValidVBindOptions; | ||
|
|
||
| fn run(ctx: &RuleContext<Self>) -> Option<Self::State> { | ||
| let node = ctx.query(); | ||
| match node { | ||
| AnyVueDirective::VueDirective(vue_directive) => { | ||
| if vue_directive.name_token().ok()?.text_trimmed() != "v-bind" { | ||
| return None; | ||
| } | ||
|
|
||
| if vue_directive.arg().is_none() { | ||
| return Some(ViolationKind::MissingArgument); | ||
| } | ||
|
|
||
| if let Some(invalid_range) = find_invalid_modifiers(&vue_directive.modifiers()) { | ||
| return Some(ViolationKind::InvalidModifier(invalid_range)); | ||
| } | ||
|
|
||
| None | ||
| } | ||
| AnyVueDirective::VueVBindShorthandDirective(dir) => { | ||
| // missing argument would be caught by the parser | ||
|
|
||
| if let Some(invalid_range) = find_invalid_modifiers(&dir.modifiers()) { | ||
| return Some(ViolationKind::InvalidModifier(invalid_range)); | ||
| } | ||
|
|
||
| None | ||
| } | ||
| _ => None, | ||
| } | ||
| } | ||
|
|
||
| fn diagnostic(ctx: &RuleContext<Self>, state: &Self::State) -> Option<RuleDiagnostic> { | ||
| Some( | ||
| match state { | ||
| ViolationKind::MissingArgument => RuleDiagnostic::new( | ||
| rule_category!(), | ||
| ctx.query().range(), | ||
| markup! { | ||
| "The v-bind directive is missing an argument." | ||
| }, | ||
| ) | ||
| .note(markup! { | ||
| "v-bind directives require an argument to specify which attribute to bind to." | ||
| }).note(markup! { | ||
| "For example, use " <Emphasis>"v-bind:foo"</Emphasis> " to bind to the " <Emphasis>"foo"</Emphasis> " attribute." | ||
| }), | ||
| ViolationKind::InvalidModifier(invalid_range) => | ||
| RuleDiagnostic::new( | ||
| rule_category!(), | ||
| invalid_range, | ||
| markup! { | ||
| "This v-bind directive has an invalid modifier." | ||
| }, | ||
| ) | ||
| .note(markup! { | ||
| "Only the following modifiers are allowed on v-bind directives: "<Emphasis>"prop"</Emphasis>", "<Emphasis>"camel"</Emphasis>", "<Emphasis>"sync"</Emphasis>", and "<Emphasis>"attr"</Emphasis>"." | ||
| }).note(markup! { | ||
| "Remove or correct the invalid modifier." | ||
| }), |
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.
Drop .sync from the allowed modifier list.
Vue 3 only accepts the .camel, .prop, and .attr modifiers on v-bind. Including .sync means we silently allow a deprecated construct that the Vue team removed in favour of v-model. Please remove .sync from VALID_MODIFIERS and update the diagnostic note accordingly so we flag it as invalid.(docs.w3cub.com)
🤖 Prompt for AI Agents
In crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs around
lines 44 to 115, the VALID_MODIFIERS array and the diagnostic note still include
".sync" which is no longer valid in Vue 3; remove ".sync" from VALID_MODIFIERS
and update the diagnostic note that lists allowed modifiers so it only mentions
"prop", "camel", and "attr" (adjust any punctuation/formatting to match
surrounding markup macros). Also ensure any wording elsewhere in this range that
references ".sync" is removed or changed to reflect it being invalid.
0ddf5bb to
1ddb103
Compare
1ddb103 to
db1b096
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_html_analyze/tests/spec_tests.rs (1)
182-183: Reuse the Vue parse options in re-validation.When we hit a
.vuetest, re-parsing withHtmlParseOptions::default()drops the Vue-specific source type, so the safety check can start screaming about perfectly valid constructs. Please feed the sameHtmlFileSourceback intoparse_htmlwhen we validate the mutation.fn check_code_action( path: &Utf8Path, source: &str, - _source_type: HtmlFileSource, + source_type: HtmlFileSource, action: &AnalyzerAction<HtmlLanguage>, ) { @@ - let re_parse = parse_html(&output, HtmlParseOptions::default()); + let re_parse = parse_html(&output, (&source_type).into());
♻️ Duplicate comments (2)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (2)
45-135: Drop the deprecated.syncmodifier.Vue 3 only blesses
.prop,.camel, and.attronv-bind; letting.syncslide guts the rule. Please prune it from the allow-list and from the diagnostic text.-const VALID_MODIFIERS: &[&str] = &["prop", "camel", "sync", "attr"]; +const VALID_MODIFIERS: &[&str] = &["prop", "camel", "attr"]; @@ - "Only the following modifiers are allowed on v-bind directives: "<Emphasis>"prop"</Emphasis>", "<Emphasis>"camel"</Emphasis>", "<Emphasis>"sync"</Emphasis>", and "<Emphasis>"attr"</Emphasis>"." + "Only the following modifiers are allowed on v-bind directives: "<Emphasis>"prop"</Emphasis>", "<Emphasis>"camel"</Emphasis>", and "<Emphasis>"attr"</Emphasis>"."
67-90: Stop flagging object-stylev-bind.At the moment any
v-bind="obj"(no argument, value present) is treated asMissingArgument, even though Vue explicitly allows the object form. Grip the ESLint behaviour by only complaining about missing arguments when the value is also absent; otherwise, let it pass.- if vue_directive.initializer().is_none() { - return Some(ViolationKind::MissingValue); - } - - if vue_directive.arg().is_none() { - return Some(ViolationKind::MissingArgument); - } + let has_argument = vue_directive.arg().is_some(); + let has_value = vue_directive.initializer().is_some(); + + if !has_argument { + return if has_value { + None + } else { + Some(ViolationKind::MissingArgument) + }; + } + + if !has_value { + return Some(ViolationKind::MissingValue); + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (8)
Cargo.lockis excluded by!**/*.lockand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/src/lint/nursery.rsis excluded by!**/nursery.rsand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (13)
.changeset/tall-jokes-send.md(1 hunks)crates/biome_html_analyze/Cargo.toml(1 hunks)crates/biome_html_analyze/src/lint.rs(1 hunks)crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs(1 hunks)crates/biome_html_analyze/tests/spec_tests.rs(2 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue(1 hunks)crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue(1 hunks)crates/biome_rule_options/src/lib.rs(1 hunks)crates/biome_rule_options/src/use_vue_valid_v_bind.rs(1 hunks)crates/biome_ruledoc_utils/src/codeblock.rs(1 hunks)justfile(1 hunks)xtask/codegen/src/generate_new_analyzer_rule.rs(4 hunks)xtask/rules_check/src/lib.rs(6 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
- .changeset/tall-jokes-send.md
- crates/biome_html_analyze/src/lint.rs
- crates/biome_html_analyze/Cargo.toml
- justfile
- crates/biome_ruledoc_utils/src/codeblock.rs
- crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue
- crates/biome_rule_options/src/use_vue_valid_v_bind.rs
- crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue
🧰 Additional context used
🧠 Learnings (21)
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
xtask/rules_check/src/lib.rscrates/biome_html_analyze/tests/spec_tests.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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:
xtask/rules_check/src/lib.rscrates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
xtask/rules_check/src/lib.rsxtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
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_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 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 : Use `dbg_write!` to debug and inspect the emitted IR during formatting
Applied to files:
crates/biome_html_analyze/tests/spec_tests.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Run cargo codegen grammar after covering all LanguageKind variants
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
xtask/codegen/src/generate_new_analyzer_rule.rs
🧬 Code graph analysis (3)
xtask/rules_check/src/lib.rs (2)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source(96-99)crates/biome_html_syntax/src/file_source.rs (2)
try_from_extension(112-121)html(43-47)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_bind.rs (1)
crates/biome_analyze/src/rule.rs (4)
recommended(602-605)domains(632-635)sources(617-620)same(246-251)
crates/biome_html_analyze/tests/spec_tests.rs (2)
crates/tests_macros/src/lib.rs (1)
gen_tests(305-312)crates/biome_html_parser/src/lib.rs (1)
parse_html(37-40)
⏰ 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). (14)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_css_formatter)
🔇 Additional comments (3)
xtask/codegen/src/generate_new_analyzer_rule.rs (2)
12-12: LGTM! Clean addition of HTML language support.The new
Htmlvariant and its string conversions follow the established pattern perfectly.Also applies to: 22-22, 35-35
356-380: HTML template structure looks sound—manually verify compilation.The GraphQL template completion and HTML template additions follow the established pattern with appropriate placeholder implementations. However, the verification script couldn't execute in this environment, so please confirm the generated HTML rules compile successfully by running:
cargo run -p xtask -- codegen-new-analyzer-rule html lint test_html_rule cargo check -p biome_html_analyzextask/rules_check/src/lib.rs (1)
271-271: LGTM on the parameter threading.The
rule_languageparameter is correctly threaded throughassert_lint,TestRunner, and all call sites. The implementation is consistent and enables language-specific handling in the test infrastructure.Also applies to: 758-758, 840-840, 854-858, 875-875
| let document_file_source = if rule_language == "html" { | ||
| // HACK: Force HTML analysis for rules that come from the HTML analyzer | ||
| DocumentFileSource::Html( | ||
| biome_html_syntax::HtmlFileSource::try_from_extension(&test.tag) | ||
| .unwrap_or_else(|_| biome_html_syntax::HtmlFileSource::html()), | ||
| ) | ||
| } else { | ||
| test.document_file_source() | ||
| }; |
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.
Consider the fallback behaviour for invalid test tags.
The HACK comment indicates this workaround is suboptimal. Specifically, if test.tag is an invalid HTML extension (e.g., "javascript" in an HTML rule's documentation), the fallback to generic HTML parsing may produce unexpected results or mask configuration errors.
Consider either:
- Validating that test.tag is a valid HTML extension before proceeding, or
- Logging a warning when the fallback is triggered
Additionally, using a string literal "html" for comparison is fragile. Consider defining a constant or using an enum to avoid typos.
🤖 Prompt for AI Agents
In xtask/rules_check/src/lib.rs around lines 285 to 293, the current HACK forces
HTML analysis when rule_language == "html" and silently falls back to
DocumentFileSource::Html(...) even if test.tag is an invalid HTML extension;
update this to (1) replace the fragile string literal "html" with a shared
constant or preferably an enum variant for the rule language and use that for
comparison, (2) validate test.tag before calling try_from_extension and if it is
invalid do not silently default — log a warning (including the offending tag and
rule identifier) when the fallback to biome_html_syntax::HtmlFileSource::html()
is used, and (3) consider failing fast or returning an error when an invalid tag
is detected depending on caller expectations so configuration mistakes are not
masked.
Summary
This is an exact port of https://eslint.vuejs.org/rules/valid-v-bind.html
It also does some of the plumbing needed to create new html lint rules.
Test Plan
Added snapshot tests, which were generated by AI
Docs