Conversation
🦋 Changeset detectedLatest commit: 4b6f882 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will degrade performance by 73.51%
Performance Changes
Comparing Footnotes
|
76ac82f to
e4b6fea
Compare
e4b6fea to
0bbda9e
Compare
ematipico
left a comment
There was a problem hiding this comment.
I would like to have a discussion about the applicability of this option.
I think it's safer to target only .html files, not .astro and .svelte.
However, if we've set on this, we need to document how users can opt out.
Also, there must be a docs PR
26d2dd3 to
41db234
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThis PR exposes the Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
41db234 to
fc44d5f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_cli/tests/cases/html.rs`:
- Around line 444-528: The two tests should only differ by the parser.vue flag;
update the should_error_when_vue_is_disabled test so its biome.json parser block
explicitly sets "interpolation": true (and "vue": false) to match
should_not_error_when_vue_is_enabled except for vue, ensuring the regression is
isolated; locate the test function should_error_when_vue_is_disabled and adjust
the JSON under the Utf8Path::new("biome.json") insert so parser.interpolation is
true while parser.vue is false, keeping linter.enabled true and leaving
run_cli/Args/SnapshotPayload usage unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4c196fb7-4a0c-4ded-8a73-0fea02836c70
⛔ Files ignored due to path filters (4)
crates/biome_cli/tests/snapshots/main_cases_html/should_error_when_vue_is_disabled.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_html/should_not_error_when_vue_is_enabled.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 (7)
.changeset/expose-html-parser-vue-option.mdcrates/biome_cli/tests/cases/html.rscrates/biome_configuration/src/html.rscrates/biome_html_parser/src/parser.rscrates/biome_service/src/file_handlers/html.rscrates/biome_service/src/settings.rscrates/biome_service/src/settings.tests.rs
| #[test] | ||
| fn should_error_when_vue_is_disabled() { | ||
| let fs = MemoryFileSystem::default(); | ||
| let mut console = BufferConsole::default(); | ||
|
|
||
| let html_file = Utf8Path::new("file.html"); | ||
| fs.insert( | ||
| html_file.into(), | ||
| r#"<div v-if="show">{{ message }}</div> | ||
| "# | ||
| .as_bytes(), | ||
| ); | ||
| fs.insert( | ||
| Utf8Path::new("biome.json").into(), | ||
| r#"{ | ||
| "html": { | ||
| "linter": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| }"# | ||
| .as_bytes(), | ||
| ); | ||
|
|
||
| let (fs, result) = run_cli( | ||
| fs, | ||
| &mut console, | ||
| Args::from(["lint", html_file.as_str()].as_slice()), | ||
| ); | ||
|
|
||
| assert!(result.is_err(), "run_cli returned {result:?}"); | ||
|
|
||
| assert_cli_snapshot(SnapshotPayload::new( | ||
| module_path!(), | ||
| "should_error_when_vue_is_disabled", | ||
| fs, | ||
| console, | ||
| result, | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn should_not_error_when_vue_is_enabled() { | ||
| let fs = MemoryFileSystem::default(); | ||
| let mut console = BufferConsole::default(); | ||
|
|
||
| let html_file = Utf8Path::new("file.html"); | ||
| fs.insert( | ||
| html_file.into(), | ||
| r#"<div v-if="show">{{ message }}</div> | ||
| "# | ||
| .as_bytes(), | ||
| ); | ||
| fs.insert( | ||
| Utf8Path::new("biome.json").into(), | ||
| r#"{ | ||
| "html": { | ||
| "parser": { | ||
| "vue": true, | ||
| "interpolation": true | ||
| }, | ||
| "linter": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| }"# | ||
| .as_bytes(), | ||
| ); | ||
|
|
||
| let (fs, result) = run_cli( | ||
| fs, | ||
| &mut console, | ||
| Args::from(["lint", html_file.as_str()].as_slice()), | ||
| ); | ||
|
|
||
| assert!(result.is_ok(), "run_cli returned {result:?}"); | ||
|
|
||
| assert_cli_snapshot(SnapshotPayload::new( | ||
| module_path!(), | ||
| "should_not_error_when_vue_is_enabled", | ||
| fs, | ||
| console, | ||
| result, | ||
| )); | ||
| } |
There was a problem hiding this comment.
Vue toggle tests are coupled to interpolation and can mask regressions.
Right now the “disabled” case can fail purely because interpolation is off, even if Vue parsing wiring breaks. Please isolate the variable under test so only parser.vue differs.
Suggested test adjustment
@@
- r#"<div v-if="show">{{ message }}</div>
+ r#"<div v-if="show"></div>
"#
@@
"html": {
+ "parser": {
+ "interpolation": true
+ },
"linter": {
"enabled": true
}
@@
- r#"<div v-if="show">{{ message }}</div>
+ r#"<div v-if="show"></div>
"#
@@
"parser": {
"vue": true,
"interpolation": true
},As per coding guidelines: “All code changes MUST include appropriate tests … and bug fixes require tests that reproduce and validate the fix.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/biome_cli/tests/cases/html.rs` around lines 444 - 528, The two tests
should only differ by the parser.vue flag; update the
should_error_when_vue_is_disabled test so its biome.json parser block explicitly
sets "interpolation": true (and "vue": false) to match
should_not_error_when_vue_is_enabled except for vue, ensuring the regression is
isolated; locate the test function should_error_when_vue_is_disabled and adjust
the JSON under the Utf8Path::new("biome.json") insert so parser.interpolation is
true while parser.vue is false, keeping linter.enabled true and leaving
run_cli/Args/SnapshotPayload usage unchanged.
fc44d5f to
4b6f882
Compare
Summary
This option was supposed to be exposed, and is referenced in error messages, but it was not exposed.
Test Plan
added cli tests
Docs