feat(lint/vue): add `noVueVIfWithVFor`, `useVueHyphenatedAttributes`
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
๐ฆ 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
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.
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.
Great job!