Skip to content

chore: migrate from Prettier to Oxfmt#2303

Open
AntonVishal wants to merge 3 commits into
browserbase:mainfrom
AntonVishal:oxfmt-migration
Open

chore: migrate from Prettier to Oxfmt#2303
AntonVishal wants to merge 3 commits into
browserbase:mainfrom
AntonVishal:oxfmt-migration

Conversation

@AntonVishal

@AntonVishal AntonVishal commented Jul 2, 2026

Copy link
Copy Markdown

why

Oxfmt is a faster Prettier alternative from the Oxc toolchain.

what changed

Configs and scripts updated to use Oxfmt instead of Prettier. Root format check was 0.8s warm, now 0.5s so ~40% faster.

test plan

pnpm format:check
pnpm lint


Summary by cubic

Replaced Prettier with oxfmt and adopted oxlint across the repo to unify formatting/linting and speed up checks (~0.8s → ~0.5s warm, ~40% faster). Updated scripts, configs, and VSCode settings accordingly.

  • Dependencies

    • Added oxfmt, oxlint, and oxlint-plugin-eslint; removed prettier, eslint, and @eslint/js.
    • Added .oxfmtrc.json and .oxlintrc.json (root and packages/cli); removed .prettierrc, .prettierignore, and eslint.config.mjs files.
    • VSCode: set default formatter to oxc.oxc-vscode and added it to recommendations.
  • Migration

    • Install dependencies: pnpm i. Format with pnpm format; check with pnpm format:check; lint with pnpm oxlint or pnpm lint.
    • In VSCode, install/select oxc.oxc-vscode as the default formatter.
    • CI/Turbo now track .oxfmtrc.json/.oxlintrc.json; formatting checks use oxfmt --check and linting uses oxlint.

Written for commit 2ce0986. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2ce0986

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Jul 2, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 36 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Dev as Developer
    participant LintStaged as lint-staged (pre-commit)
    participant CI as CI Pipeline
    participant Oxfmt as oxfmt
    participant Oxlint as oxlint
    participant Turbo as Turbo

    Note over Dev,CI: NEW: Development workflow uses oxfmt + oxlint

    Dev->>Dev: Run pnpm format
    Dev->>Oxfmt: oxfmt (format all files)
    Oxfmt-->>Dev: Formatted output

    Dev->>Dev: Run pnpm lint
    Dev->>Oxfmt: pnpm format:check → oxfmt --check
    alt Format check passes
        Oxfmt-->>Dev: All files ok
        Dev->>Oxlint: pnpm oxlint → oxlint .
        Oxlint-->>Dev: Lint result
        Dev->>Turbo: pnpm check (typecheck)
        Turbo-->>Dev: Types ok
    else Format check fails
        Oxfmt-->>Dev: Formatting errors
    end

    Dev->>LintStaged: Git commit (pre-commit hook)
    LintStaged->>Oxfmt: oxfmt --no-error-on-unmatched-pattern
    Oxfmt-->>LintStaged: Formatted staged files
    LintStaged-->>Dev: Commit proceeds

    CI->>Turbo: Run turbo tasks (format:check, lint)
    Note over CI,Oxfmt: CI tracks new config files: .oxfmtrc.json, .oxlintrc.json
    Turbo->>Oxfmt: oxfmt --check across packages
    Turbo->>Oxlint: oxlint . across packages
    Oxfmt-->>Turbo: Format check result
    Oxlint-->>Turbo: Lint result
    Turbo-->>CI: Build/lint status
Loading

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant