Skip to content

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Aug 26, 2025

Summary

This PR implements the actual functionality behind the indentScriptAndStyle configuration for vue and svelte files.

Test Plan

Added tests. Also, Pretter's default for this option is false, so we align with that.

Docs

biomejs/website#3007

@changeset-bot
Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: facff75

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

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 26, 2025

Walkthrough

Adds html.formatter.indentScriptAndStyle (default false) for Vue and Svelte and wires a new Prettier migration field (vue_indent_script_and_style) into the CLI → biome_configuration conversion. Vue and Svelte handlers now obtain HtmlLanguage format options and use indent_script_and_style to control print_with_indent. Adds DocumentFileSource::to_htmlish to map embedded JS sources to HTML-like variants and implements Deref for IndentScriptAndStyle. Includes tests covering default, CLI-flag and config-driven indentation for .vue and .svelte and registers the new test module.

Possibly related PRs

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5baf71d and facff75.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_end_of_line.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_fix.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_jsonc.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_overrides.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_with_ignore.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_write.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_write_biome_jsonc.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_write_packagejson.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettier_migrate_write_with_ignore_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate_prettier/prettierjson_migrate_write.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (1)
  • crates/biome_cli/src/execute/migrate/prettier.rs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_cli/src/execute/migrate/prettier.rs
⏰ 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). (18)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/indent-script-style

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Formatter Area: formatter L-HTML Language: HTML labels Aug 26, 2025
@dyc3 dyc3 mentioned this pull request Aug 26, 2025
11 tasks
@dyc3 dyc3 force-pushed the dyc3/indent-script-style branch from 5baf71d to facff75 Compare August 26, 2025 15:51
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 26, 2025

CodSpeed Performance Report

Merging #7333 will not alter performance

Comparing dyc3/indent-script-style (facff75) with next (272632f)

Summary

✅ 131 untouched benchmarks

@dyc3 dyc3 requested review from a team August 26, 2025 16:36
@ematipico
Copy link
Member

Pretter's default for this option is false, so we align with that.

We don't guarantee Prettier's defaults in Biome (see indentation style). So what's your preference @dyc3 ? I honestly prefer the indentation by default

@dyc3
Copy link
Contributor Author

dyc3 commented Aug 27, 2025

My personal preference is unindented because otherwise it's just more line width being consumed and I can't have as much code on screen side by side without word wrapping. Also, at a glance it appears that not a whole lot of people enable the option: https://github.com/search?q=path%3A**%2F.prettierrc+%22vueIndentScriptAndStyle%5C%22%3A+true%22&type=code (3.3k hits for true vs 5.4k hits for explicit false, the rest use the default, which is false)

Having it be false by default also makes this less disruptive for our users when upgrading, and we don't have to have a migration for it. The migration rule to preserve existing behavior would have to be present for the next minor, and then probably removed in the next minor. Imagine a scenario where a user upgrades 2.2 -> 2.3, decides to opt in to the default behavior by removing the configuration, and then on upgrading from 2.3 -> 2.4 the migration adds the configuration back.

Ultimately, having it be false by default is more in line with biome's goal of having "good defaults" and its just less work for us to do.

@ematipico
Copy link
Member

Makes sense! Thank you

@dyc3 dyc3 merged commit de0d2d6 into next Aug 27, 2025
31 checks passed
@dyc3 dyc3 deleted the dyc3/indent-script-style branch August 27, 2025 21:29
@coderabbitai coderabbitai bot mentioned this pull request Oct 22, 2025
@github-actions github-actions bot mentioned this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Formatter Area: formatter A-Project Area: project L-HTML Language: HTML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants