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

Skip to content

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Nov 18, 2025

Summary

Adds a new lint rule to enforce valid v-text directives. It's a direct port of https://eslint.vuejs.org/rules/valid-v-text.html Implementation is pretty much the same as the v-html one.

Also adds some codegen to make new html/vue lint rules easier to author.

This now also refactors useVueValidVHtml based on the feedback given here, since the implementation for this rule was copied from that one.

Test Plan

Snapshot tests.

Docs

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

🦋 Changeset detected

Latest commit: 3182d1a

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Tooling Area: internal tools A-Diagnostic Area: diagnostocis L-HTML Language: HTML and super languages labels Nov 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 51355 51355 0
Passed 50142 50142 0
Failed 1171 1171 0
Panics 42 42 0
Coverage 97.64% 97.64% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6323 6323 0
Passed 2106 2106 0
Failed 4217 4217 0
Panics 0 0 0
Coverage 33.31% 33.31% 0.00%

ts/babel

Test result main count This PR count Difference
Total 835 835 0
Passed 742 742 0
Failed 93 93 0
Panics 0 0 0
Coverage 88.86% 88.86% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18821 18821 0
Passed 14069 14069 0
Failed 4751 4751 0
Panics 1 1 0
Coverage 74.75% 74.75% 0.00%

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

Adds a Vue-specific HTML lint rule useVueValidVText that validates v-text directives (flags arguments, modifiers, or missing/empty values). Implements analyzer, diagnostics, rule options type, and ViolationKind. Adds valid/invalid .vue test fixtures and changelog entries. Extends codegen with a new html-vue LanguageKind (generates .vue tests) and a justfile recipe to scaffold html-vue rules. Also tightens useVueValidVHtml directive handling to correctly flag empty-string values.

Suggested reviewers

  • ematipico

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new useVueValidVText lint rule for HTML/Vue code.
Description check ✅ Passed The description clearly explains the motivation (porting an ESLint rule), implementation details (similar to v-html), and includes context about codegen improvements and refactoring.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/vue-valid-v-text

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
xtask/codegen/src/generate_new_analyzer_rule.rs (1)

387-425: HtmlVue rule template looks good; consider generating the ESLint rule name

The Html‑Vue template correctly:

  • Uses HtmlRoot as the query AST.
  • Marks language: "html" while scoping to Vue via domains: &[RuleDomain::Vue].
  • Seeds sources with RuleSource::EslintVueJs("rule-name").same().

That’s a solid baseline. If you fancy a small quality‑of‑life tweak, you could derive the "rule-name" string from the rule name (e.g. kebab‑case) so new rules start with a closer default ESLint mapping instead of a hard‑coded placeholder, but it’s strictly optional.

crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue (1)

1-4: Valid fixture covers the key happy paths

Both examples use v-text with a value and no argument/modifier, including a self‑closing tag, which is exactly what this rule should accept. If you need extra paranoia later, you could add a case alongside other directives, but this is perfectly adequate for now.

crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1)

1-9: Invalid fixture set looks good, consider adding empty-string case

The fixture nicely covers no value, arguments, and modifiers (both normal and self-closing). Since the rule also treats v-text="" as a missing value, you might want to add that explicitly to these cases for a bit more coverage, but it’s not essential.

crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)

9-46: Rule metadata and docs look consistent, tiny example nit

The rule declaration looks spot-on: Vue domain, ESLint rule wired, and examples aligned with the behaviour. One tiny polish you could do: in the bullet list you use <div v-text:aaa></div> as the “argument” example, while the invalid snippets below and tests use v-text:aaa="foo". Aligning those examples would make the docs just a bit crisper, but it’s purely cosmetic.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 748e948 and 91b2bc7.

⛔ Files ignored due to path filters (7)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_html_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (8)
  • .changeset/use-vue-valid-v-text-rule.md (1 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs (1 hunks)
  • justfile (1 hunks)
  • xtask/codegen/src/generate_new_analyzer_rule.rs (6 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
crates/biome_rule_options/src/use_vue_valid_v_text.rs (1)
crates/biome_rule_options/src/use_vue_valid_v_html.rs (1)
  • UseVueValidVHtmlOptions (6-6)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs (1)
  • Rule (55-145)
⏰ 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). (10)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Parser conformance
🔇 Additional comments (8)
justfile (1)

115-118: Html‑Vue rule scaffolding looks consistent

Recipe mirrors new-html-lintrule and wires --kind=html-vue through gen-analyzer, so it should fit nicely into the existing workflow. No changes needed.

xtask/codegen/src/generate_new_analyzer_rule.rs (4)

7-14: HtmlVue language kind wiring looks sound

Adding HtmlVue to LanguageKind, mapping --kind=html-vue in FromStr, while keeping as_str() as "html" to reuse the HTML analyser crate, all hangs together nicely. It should route html-vue rules into biome_html_analyze without surprising the rest of the codegen pipeline.

Also applies to: 17-25, 31-39


359-383: GraphQL template body: sensible defaults

The new GraphQL run/diagnostic stubs match the other language templates and give a reasonable starting point for new rules. Nothing to change here.


427-458: HtmlVue Rule impl mirrors Html impl correctly

The generated Rule impl for Html‑Vue reuses the same trivial run/diagnostic pattern as HTML, just with the Vue domain metadata above. Looks consistent and should compile cleanly once options exist.


541-555: Vue test generation: extension and fixtures line up

The test_extension override to "vue" for HtmlVue, plus the Vue‑flavoured valid/invalid contents, means new html‑vue rules will get:

  • valid.vue / invalid.vue under crates/biome_html_analyze/tests/specs/nursery/<RuleName>/
  • Sensible starter HTML snippets for Vue templates.

Nice touch; this matches the added useVueValidVText fixtures.

Also applies to: 623-636

crates/biome_rule_options/src/lib.rs (1)

379-389: Rule options export is in the right place

Exporting use_vue_valid_v_text alongside the other Vue rules keeps the module list tidy and makes the new options type available where expected. All good.

crates/biome_rule_options/src/use_vue_valid_v_text.rs (1)

1-6: Options struct matches existing Vue rule patterns

This mirrors the UseVueValidVHtmlOptions pattern and gives you room to evolve options later without churn. No issues from my side.

crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)

49-139: Logic mirrors valid-v-html nicely and handles all three violation kinds

The run implementation correctly gates on v-text, then short-circuits on argument, modifier, and finally missing/empty value. The empty-string handling and “non-string initialiser is fine” behaviour match the existing UseVueValidVHtml pattern, which is great for consistency. Diagnostics read well and the ranges you highlight (argument/modifier vs whole directive) make sense from a UX perspective. I don’t see any issues here.

@dyc3 dyc3 force-pushed the dyc3/vue-valid-v-text branch from 91b2bc7 to 1b2f87c Compare November 18, 2025 18:30
@dyc3 dyc3 requested review from a team November 18, 2025 18:30
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 18, 2025

CodSpeed Performance Report

Merging #8158 will not alter performance

Comparing dyc3/vue-valid-v-text (3182d1a) with main (8d64655)1

Summary

✅ 1 untouched
⏩ 154 skipped2

Footnotes

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)

49-53: Consider making ViolationKind non‑public

ViolationKind seems internal to this rule; if it’s not referenced from other modules, you can drop the pub to keep the public surface minimal. Not urgent, just tidier.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91b2bc7 and 1b2f87c.

⛔ Files ignored due to path filters (7)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_html_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (8)
  • .changeset/use-vue-valid-v-text-rule.md (1 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs (1 hunks)
  • justfile (1 hunks)
  • xtask/codegen/src/generate_new_analyzer_rule.rs (6 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/use-vue-valid-v-text-rule.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue
  • justfile
🧰 Additional context used
🧬 Code graph analysis (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)
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). (13)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Check Dependencies
  • GitHub Check: Test Node.js API
  • GitHub Check: Parser conformance
  • GitHub Check: autofix
  • GitHub Check: Validate rules documentation
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Check JS Files
🔇 Additional comments (8)
crates/biome_rule_options/src/lib.rs (1)

379-389: Vue rule export placement looks good

The new use_vue_valid_v_text module is named and ordered consistently with the other Vue rules; no issues from this side.

crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (3)

9-46: Rule metadata and docs look solid, just double‑check recommended status

Docs, examples, language/domain wiring, and sources pointing at valid-v-text all look spot on. The only thing I'd sanity‑check is recommended: true for a nursery rule – if nursery rules are usually opt‑in, you might want this false until it graduates.


61-99: Edge cases around “missing value” might be worth re‑checking

The control‑flow for arguments/modifiers looks good, and the overall idea for detecting a missing value matches the rule description. Two nuance points you may want to verify against the actual AST and ESLint’s behaviour:

  • initializer.value() returning Err(_) is treated as “no value at all”, but that may also cover parse errors in the directive expression. Users could see a “missing value” message on what is essentially a syntax error.
  • The HtmlString branch flags empty string tokens as missing, but it’s not obvious from the HTML AST whether cases like <div v-text=""></div> or whitespace‑only values should be treated as “missing”, or left to the generic parsing/expr rules.

Might be worth running this against a few edge templates (v-text="", v-text=" ", invalid JS expressions) to confirm you get the same diagnostics you expect from the ESLint rule.


102-139: Diagnostics are clear and nicely explanatory

Messages and notes make it very obvious what’s wrong (argument, modifier, or missing value) and how to fix it, and ranges are appropriate (range for arg/modifier, whole directive for missing value). Nicely done.

xtask/codegen/src/generate_new_analyzer_rule.rs (4)

6-42: LanguageKind::HtmlVue wiring looks correct

Adding HtmlVue with as_str()"html" and "html-vue" in FromStr cleanly reuses the existing biome_html_analyze crate while giving a distinct CLI kind. No concerns here.


312-385: GraphQL template stub change is harmless

The GraphQL branch now mirrors the JSON stub (no signals, generic diagnostic). Since this is just a scaffold that authors will immediately edit, there’s no functional risk. All good.


387-461: HtmlVue rule template is a good starting point for Vue rules

The new HtmlVue template pulls in RuleDomain::Vue and an EslintVueJs source, queries HtmlRoot, and sets language: "html", which is exactly what you want for Vue SFC templates living in the HTML analyser. The stubbed run/diagnostic are generic but compile‑ready, so future Vue rules can iterate from there.


538-556: .vue test generation logic is nicely scoped

Using test_extension = "vue" only for LanguageKind::HtmlVue and otherwise falling back to rule_kind, plus the Vue‑specific valid_contents/invalid_contents, ensures new Vue rules get .vue fixtures while existing languages keep their current behaviour. Paths valid.{test_extension} / invalid.{test_extension} look consistent.

Also applies to: 622-636

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments to make the code shorter. The rule should test against empty values

@dyc3 dyc3 force-pushed the dyc3/vue-valid-v-text branch from 1b2f87c to 7654ddd Compare November 19, 2025 21:30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and updated the implementation for useVueValidVHtml because useVueValidVText was copied from there.

@dyc3 dyc3 force-pushed the dyc3/vue-valid-v-text branch from 7654ddd to 7188d7b Compare November 19, 2025 21:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

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/src/lint/nursery/use_vue_valid_v_html.rs (1)

9-16: Update v-html rule docs to match empty-string handling

The new run logic correctly reports MissingValue for both absent values and empty/whitespace-only values via inner_string_text. The doc comment above still only mentions “does not have an attribute value” and shows <div v-html></div> as the sole example. It would be clearer to also call out (and/or example) v-html="" / whitespace-only as reported cases so docs stay in lockstep with the behaviour.

Also applies to: 55-87

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b2f87c and 7188d7b.

⛔ Files ignored due to path filters (8)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_html_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVHtml/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (10)
  • .changeset/use-vue-valid-v-text-rule.md (1 hunks)
  • .changeset/weak-houses-doubt.md (1 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs (2 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs (1 hunks)
  • justfile (1 hunks)
  • xtask/codegen/src/generate_new_analyzer_rule.rs (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs
🧰 Additional context used
🧬 Code graph analysis (2)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)
  • run (61-88)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)
crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs (2)
  • run (61-87)
  • diagnostic (89-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • 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: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_configuration)
🔇 Additional comments (7)
justfile (1)

115-118: Html-Vue rule scaffolding and move-rule regeneration look solid

The new-html-vue-lintrule recipe cleanly mirrors the existing HTML rule scaffolder with --kind=html-vue, and extending move-rule to rerun the analyzer avoids stale codegen. No concerns here.

Also applies to: 121-124

xtask/codegen/src/generate_new_analyzer_rule.rs (3)

7-13: HtmlVue language kind and test generation are wired coherently

LanguageKind::HtmlVue maps from "html-vue" and deliberately reuses "html" for as_str(), so new Vue rules land in biome_html_analyze while getting .vue fixtures via test_extension. The HtmlVue-specific valid/invalid contents also line up with Vue templates. Looks consistent with the rest of the generator.

Also applies to: 17-25, 29-41, 538-555, 622-636


313-386: Nice consistency bump for GraphQL rule templates

Adding run and diagnostic stubs for the GraphQL template brings it in line with the other languages, which should make new rules less of a blank page. No functional issues spotted.


387-461: Vue-specific rule skeleton looks appropriate

The HtmlVue template sets language: "html", domains: &[RuleDomain::Vue], and an ESLint Vue.js source, which matches how the concrete Vue rules are structured. The Vue-flavoured examples and HtmlRoot query give a sensible starting point for new rules.

.changeset/weak-houses-doubt.md (1)

1-5: Changeset accurately documents the v-html fix

The note about useVueValidVHtml now flagging v-html="" matches the new empty-string handling in the rule. All good.

crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1)

1-13: Invalid fixtures nicely cover the rule’s surface

You’ve got missing values, explicit empty strings, arguments, modifiers, and both normal and self-closing tags covered, which should exercise all ViolationKind branches. Looks comprehensive.

crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1)

61-87: Rule logic matches intent and mirrors v-html nicely

The run implementation cleanly sequences argument → modifier → value checks, and the inner_string_text(...).trim().is_empty() guard is a neat way to treat empty/whitespace values as missing. Using VueDirective directly also keeps the query tight. No issues from the engine room.

Comment on lines +5 to +13
Added the `useVueValidVText` lint rule to enforce valid `v-text` directives. The rule reports when `v-text` has an argument, has modifiers, or is missing a value.

Invalid:

```vue
<div v-text /> <!-- missing value -->
<div v-text:aaa="foo" /> <!-- has argument -->
<div v-text.bbb="foo" /> <!-- has modifier -->
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify that empty or whitespace-only values are also reported

The rule (and fixtures) treat v-text="" / whitespace-only as a missing value, but the changeset text and examples only mention the attribute being absent. Consider adding an empty-value example (e.g. v-text="") or explicitly saying “missing or empty value” so users know those cases are intentional.

🤖 Prompt for AI Agents
.changeset/use-vue-valid-v-text-rule.md around lines 5 to 13: the changeset
examples only mention a missing attribute value but the rule also treats empty
or whitespace-only values as missing; update the text to say “missing or empty
value (including empty or whitespace-only strings)” and add an example such as
`<div v-text="" />` or `<div v-text="   " />` to the invalid list so users
clearly understand those cases are intentionally reported.

Comment on lines +10 to +16
/// Enforce valid `v-text` Vue directives.
///
/// This rule reports `v-text` directives in the following cases:
/// - The directive has an argument. E.g. `<div v-text:aaa></div>`
/// - The directive has any modifiers. E.g. `<div v-text.bbb></div>`
/// - The directive does not have a value. E.g. `<div v-text></div>`
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Align v-text rule docs with empty/whitespace-value behaviour

Like the v-html rule, this one now reports MissingValue for both absent values and empty/whitespace-only ones (e.g. v-text=""), and the tests reflect that. The comment currently only says “does not have a value” and shows <div v-text></div>. Consider tweaking the wording (e.g. “missing or empty value”) and/or adding an v-text="" example so users aren’t surprised by those diagnostics.

Also applies to: 61-87

🤖 Prompt for AI Agents
In crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs around
lines 10 to 16 (and similarly update lines 61 to 87), the doc comment only
mentions “does not have a value” and shows <div v-text></div> but the rule also
reports MissingValue for empty or whitespace-only values (e.g. v-text="").
Update the comment to say “missing or empty/whitespace-only value” (or “missing
or empty value”) and add an example such as <div v-text=""></div> to the list so
the docs match the behavior and tests.

@dyc3 dyc3 force-pushed the dyc3/vue-valid-v-text branch from 7188d7b to 3182d1a Compare November 19, 2025 21:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1)

3-14: Add test coverage for argument/modifier combined with empty values.

The test suite is missing cases where an argument or modifier is combined with an empty or whitespace-only value. These cases should trigger multiple violations.

Consider adding:

<div v-text:aaa=""></div>
<div v-text.bbb=""></div>
<div v-text:aaa="    "></div>
<div v-text.bbb="    "></div>

This addresses the concern raised in previous review comments and ensures the rule correctly handles multiple simultaneous violations.

xtask/codegen/src/generate_new_analyzer_rule.rs (1)

23-25: Consider adding a clarifying comment.

Both Html and HtmlVue return "html" since they share the same crate (biome_html_analyze). Whilst correct, a brief comment might help future maintainers understand this intentional duplication.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7188d7b and 3182d1a.

⛔ Files ignored due to path filters (8)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_html_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVHtml/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (10)
  • .changeset/use-vue-valid-v-text-rule.md (1 hunks)
  • .changeset/weak-houses-doubt.md (1 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs (2 hunks)
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/invalid.vue (1 hunks)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs (1 hunks)
  • justfile (1 hunks)
  • xtask/codegen/src/generate_new_analyzer_rule.rs (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVText/valid.vue
  • crates/biome_rule_options/src/use_vue_valid_v_text.rs
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_html.rs
  • crates/biome_html_analyze/src/lint/nursery/use_vue_valid_v_text.rs
  • .changeset/weak-houses-doubt.md
  • .changeset/use-vue-valid-v-text-rule.md
  • justfile
⏰ 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). (12)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: Parser conformance
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
🔇 Additional comments (8)
crates/biome_rule_options/src/lib.rs (1)

388-388: LGTM!

Module declaration correctly placed in alphabetical order and follows the established pattern.

xtask/codegen/src/generate_new_analyzer_rule.rs (7)

13-13: LGTM!

Clean addition of the HtmlVue variant to the enum.


37-39: LGTM!

The "html-vue" string mapping is intuitive and consistent with the hyphenated naming convention.


359-383: Diff annotations appear spurious.

These lines are marked as changed but appear to be pre-existing Graphql template code with no visible modifications. This is likely a formatting artefact or diff generation issue.


387-461: Excellent Vue template implementation.

The HtmlVue branch properly includes Vue-specific configuration (RuleDomain::Vue, RuleSource::EslintVueJs) whilst correctly using the HTML language infrastructure. The placeholder "rule-name" on line 423 is appropriate for developers to replace when generating rules.


541-555: LGTM!

The conditional logic properly sets Vue-specific test extensions and HTML-style test content for HtmlVue rules. Clean implementation.


623-627: LGTM!

Valid test file creation properly uses the test_extension variable, ensuring .vue files are generated for HtmlVue rules.


631-635: LGTM!

Invalid test file creation mirrors the valid test logic correctly.

@dyc3 dyc3 added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit fb1458b Nov 19, 2025
18 checks passed
@dyc3 dyc3 deleted the dyc3/vue-valid-v-text branch November 19, 2025 23:32
@github-actions github-actions bot mentioned this pull request Nov 19, 2025
ryan-m-walker pushed a commit to ryan-m-walker/biome that referenced this pull request Nov 23, 2025
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project A-Tooling Area: internal tools L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants