Skip to content

Replace Prettier with BiomeJS for webview client formatting#372

Merged
bmaranville merged 5 commits into
masterfrom
copilot/port-formatter-migration-pattern
May 6, 2026
Merged

Replace Prettier with BiomeJS for webview client formatting#372
bmaranville merged 5 commits into
masterfrom
copilot/port-formatter-migration-pattern

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

Ports the formatter migration from bumps/bumps#434 into this repo, scoped to the refl1d/webview/client frontend.

Config

  • New refl1d/webview/client/biome.json — 2-space indent, 120-char line width, double quotes, ES5 trailing commas; linter disabled (ESLint owns that); schema pinned to 2.4.13 matching bumps PR
  • Deleted refl1d/webview/client/prettier.config.js

package.json

  • Added @biomejs/biome ^2.4.13
  • Removed: prettier, eslint-plugin-prettier, @vue/eslint-config-prettier, eslint-config-prettier, @ianvs/prettier-plugin-sort-imports, prettier-plugin-css-order, prettier-plugin-jsdoc
  • Scripts updated:
    - "format": "prettier --write src",
    - "test:lint": "eslint src && prettier --check ...",
    + "format": "biome format --write src",
    + "test:format": "biome format src/",
    + "test:lint": "eslint src",

eslint.config.js

  • Removed eslint-plugin-prettier/recommended, @vue/eslint-config-prettier, prettier/prettier rule, and "prettier" compat extend
  • Disabled Vue stylistic rules that conflict with Biome (vue/html-indent, vue/max-attributes-per-line, vue/html-self-closing, etc.)

CI (.github/workflows/test-webview-client.yaml)

  • Renamed existing job comment from "formatted and linted" → "linted"
  • Added dedicated test-format job running bun run test:format

Pre-commit (.pre-commit-config.yaml)

  • Added biome-format hook via biomejs/pre-commit v0.6.1 targeting .(vue|js|ts|…|json) files

Formatter-driven source changes

Biome reformatted ternary expressions in DataView.vue and SimpleBuilder.vue (condition-first style vs. Prettier's value-first).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • biomejs.dev
    • Triggering command: /usr/bin/curl curl -s -o /dev/null -w %{http_code} REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Port the formatter migration pattern from merged PR bumps/bumps#434 into the reflectometry/refl1d repository, but scope it to this repo’s current frontend/webview setup.

Repository: reflectometry/refl1d
Base branch: master

Goal

  • Replace the frontend Prettier-based formatting setup with BiomeJS for the Refl1D webview client, following the same overall intent as bumps/bumps#434.
  • Preserve or improve existing lint/test workflow behavior.
  • Open a pull request with the resulting changes.

Relevant current files in reflectometry/refl1d

  • .pre-commit-config.yaml
  • .github/workflows/test-webview-client.yaml
  • refl1d/webview/client/package.json
  • refl1d/webview/client/eslint.config.js
  • refl1d/webview/client/prettier.config.js
  • likely a new refl1d/webview/client/biome.json or repo-level biome.json, whichever best fits this repo

Reference PR behavior to mirror
From bumps/bumps#434, the important behavior was:

  • add Biome config
  • remove Prettier config/dependencies from the web client
  • update package scripts so formatting uses Biome and linting is separated from formatting
  • update ESLint config to stop integrating with Prettier
  • add a dedicated format check job in GitHub Actions
  • keep stylistic conflicts between ESLint/Vue rules and Biome under control
  • apply any necessary formatting-only code changes caused by the formatter switch

Repository-specific guidance

  1. Inspect the current Refl1D frontend setup rather than blindly copying the bumps PR.
  2. Update refl1d/webview/client/package.json to:
    • replace Prettier usage in scripts with Biome equivalents
    • add @biomejs/biome
    • remove Prettier-only dependencies that are no longer needed
    • keep lint and formatting responsibilities separated, similar to the bumps PR
    • add a test:format script if appropriate for CI
  3. Update refl1d/webview/client/eslint.config.js to remove Prettier integration:
    • remove eslint-plugin-prettier/recommended
    • remove @vue/eslint-config-prettier / prettier extends if present
    • remove prettier/prettier rule wiring
    • if necessary, disable Vue stylistic rules that conflict with Biome formatting
  4. Remove refl1d/webview/client/prettier.config.js if it becomes obsolete.
  5. Add Biome configuration in the most sensible location for this repo. Prefer matching the practical behavior of the bumps PR, but adapt includes/excludes to Refl1D’s file layout.
  6. Update .github/workflows/test-webview-client.yaml to separate lint and format checks, mirroring the bumps PR’s CI shape.
  7. Update .pre-commit-config.yaml if needed so frontend formatting/linting continues to work coherently with the new toolchain.
  8. Run/apply formatter-driven updates to affected frontend files as needed.

Important constraints

Suggested PR title

  • Replace Prettier with BiomeJS for webview client formatting

Suggested PR body points

  • switch webview client formatting from Prettier to BiomeJS
  • remove Prettier integration from ESLint
  • add format check to webview client CI
  • update formatting scripts/config accordingly

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Create a PR that does the same thing done in @bumps/bumps/pull/434 for the reflectometry/refl1d repository, replacing the prettier formatter with biomejs

Assistant: I’ve started the pull request creation process and we’re waiting for your response to the GitHub confirmation dialog before I can continue.

This pull request was created from Copilot chat.

Copilot AI and others added 2 commits May 5, 2026 17:47
Copilot AI changed the title [WIP] Replace Prettier with BiomeJS for webview client Replace Prettier with BiomeJS for webview client formatting May 5, 2026
Copilot AI requested a review from bmaranville May 5, 2026 17:50
@bmaranville

Copy link
Copy Markdown
Member

This was somewhat a test if copilot could make a simple PR given clear instructions. I don't know that it saved me any time over doing it myself, as it missed a couple things and didn't follow directions exactly. (it went off-script in that it didn't copy the structure from the bumps PR exactly, so the pre-commit throws errors without having a biome.json both in the project and client root)

@bmaranville bmaranville requested a review from glass-ships May 5, 2026 18:05
@bmaranville bmaranville marked this pull request as ready for review May 5, 2026 18:08
Comment thread refl1d/webview/client/biome.json
@bmaranville bmaranville merged commit 59dcc0f into master May 6, 2026
15 checks passed
@bmaranville bmaranville deleted the copilot/port-formatter-migration-pattern branch May 6, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants