biome icon indicating copy to clipboard operation
biome copied to clipboard

feat(lint/vue): add `noVueVIfWithVFor`, `useVueHyphenatedAttributes`

Open dyc3 opened this issue 1 month ago โ€ข 4 comments

Summary

This PR adds noVueVIfWithVFor, and useVueHyphenatedAttributes.

It also fixes a parsing bug that I found while working on these rules.

Test Plan

Added snapshot tests.

Docs

dyc3 avatar Nov 13 '25 17:11 dyc3

๐Ÿฆ‹ Changeset detected

Latest commit: 95ddb3974c96c9d4dad9c72d5a9ef5cf19eb240a

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

changeset-bot[bot] avatar Nov 13 '25 17:11 changeset-bot[bot]

CodSpeed Performance Report

Merging #8097 will not alter performance

Comparing dyc3/vue-high-value-rules (95ddb39) with main (47d940e)

Summary

โœ… 1 untouched
โฉ 154 skipped[^skipped]

[^skipped]: 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.

codspeed-hq[bot] avatar Nov 13 '25 17:11 codspeed-hq[bot]

Walkthrough

Adds two Vue-focused HTML lints and supporting infra: NoVueVIfWithVFor (flags v-if and v-for on the same element) and UseVueHyphenatedAttributes (enforce kebab-case attribute names). Implements diagnostics and a code-action for attribute renames, adds rule option types and changeset entries, extends the HTML lexer to recognise Vue dynamic-argument brackets ([ / ]), updates parser options for Vue, and wires HTML lint metadata into the service/analyser configuration with corresponding tests and fixtures.

Possibly related PRs

  • biomejs/biome#5814 โ€” Changes to the HTML analyser registry and service wiring that this PR extends with new Vue rules and metadata.
  • biomejs/biome#8060 โ€” Adds additional Vue HTML lint rules and touches the same analyser/linting subsystems and tests.
  • biomejs/biome#7702 โ€” Refactors HTML/Vue parser/tokenisation and ties into the same lexer/parser surface modified here (Vue dynamic-argument handling).

Suggested reviewers

  • mdevils
  • arendjr

Pre-merge checks and finishing touches

โŒ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 27.78% 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 two Vue linting rules (noVueVIfWithVFor and useVueHyphenatedAttributes) to the linter.
Description check โœ… Passed The description clearly explains the PR's purpose: adding two Vue rules, fixing a parsing bug, and implementing configuration plumbing for HTML lint rules.
โœจ 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-high-value-rules

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

coderabbitai[bot] avatar Nov 14 '25 16:11 coderabbitai[bot]

Great job!

mdevils avatar Nov 14 '25 16:11 mdevils