From 21cc2f15ac512f537ae5ab35aa615f6985cb7189 Mon Sep 17 00:00:00 2001 From: lisiur Date: Tue, 4 Nov 2025 21:39:25 +0800 Subject: [PATCH 1/3] feat: support html.experimentalFullSupportEnabled for vue with jsx/tsx script --- .changeset/public-spiders-glow.md | 7 ++ .../biome_cli/tests/cases/handle_vue_files.rs | 115 ++++++++++++++++++ .../full_support_jsx.snap | 48 ++++++++ .../full_support_tsx.snap | 53 ++++++++ crates/biome_html_syntax/src/element_ext.rs | 36 ++++++ .../biome_service/src/file_handlers/html.rs | 4 + 6 files changed, 263 insertions(+) create mode 100644 .changeset/public-spiders-glow.md create mode 100644 crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_jsx.snap create mode 100644 crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_tsx.snap diff --git a/.changeset/public-spiders-glow.md b/.changeset/public-spiders-glow.md new file mode 100644 index 000000000000..8986c7ec5cfc --- /dev/null +++ b/.changeset/public-spiders-glow.md @@ -0,0 +1,7 @@ +--- +"@biomejs/biome": patch +--- + +Fixed [#7981](https://github.com/biomejs/biome/issues/7981) + +Added support for `html.experimentalFullSupportEnabled` in Vue jsx/tsx scripts. Biome now supports `html.experimentalFullSupportEnabled` in Vue jsx/tsx scripts instead of throwing errors. diff --git a/crates/biome_cli/tests/cases/handle_vue_files.rs b/crates/biome_cli/tests/cases/handle_vue_files.rs index 1c98fb509f9a..aa7c97bb38b6 100644 --- a/crates/biome_cli/tests/cases/handle_vue_files.rs +++ b/crates/biome_cli/tests/cases/handle_vue_files.rs @@ -568,6 +568,121 @@ const props: Props = { title: "Hello" }; )); } +#[test] +fn full_support_tsx() { + let fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + fs.insert( + "biome.json".into(), + r#"{ "html": { "formatter": {"enabled": true}, "linter": {"enabled": true}, "experimentalFullSupportEnabled": true } }"#.as_bytes(), + ); + + let vue_file_path = Utf8Path::new("file.vue"); + fs.insert( + vue_file_path.into(), + r#" + + + + +"# + .as_bytes(), + ); + + let (fs, result) = run_cli( + fs, + &mut console, + Args::from(["check", "--write", "--unsafe", vue_file_path.as_str()].as_slice()), + ); + + assert!(result.is_ok(), "run_cli returned {result:?}"); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "full_support_tsx", + fs, + console, + result, + )); +} + +#[test] +fn full_support_jsx() { + let fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + fs.insert( + "biome.json".into(), + r#"{ "html": { "formatter": {"enabled": true}, "linter": {"enabled": true}, "experimentalFullSupportEnabled": true } }"#.as_bytes(), + ); + + let vue_file_path = Utf8Path::new("file.vue"); + fs.insert( + vue_file_path.into(), + r#" + + + + +"# + .as_bytes(), + ); + + let (fs, result) = run_cli( + fs, + &mut console, + Args::from(["check", "--write", "--unsafe", vue_file_path.as_str()].as_slice()), + ); + + assert!(result.is_ok(), "run_cli returned {result:?}"); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "full_support_jsx", + fs, + console, + result, + )); +} + #[test] fn format_stdin_successfully() { let fs = MemoryFileSystem::default(); diff --git a/crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_jsx.snap b/crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_jsx.snap new file mode 100644 index 000000000000..72a47fbde2c9 --- /dev/null +++ b/crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_jsx.snap @@ -0,0 +1,48 @@ +--- +source: crates/biome_cli/tests/snap_test.rs +expression: redactor(content) +--- +## `biome.json` + +```json +{ + "html": { + "formatter": { "enabled": true }, + "linter": { "enabled": true }, + "experimentalFullSupportEnabled": true + } +} +``` + +## `file.vue` + +```vue + + + + + + +``` + +# Emitted Messages + +```block +Checked 1 file in