chore: migrate from Prettier to Oxfmt#2303
Conversation
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
There was a problem hiding this comment.
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
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
oxfmtand adoptedoxlintacross 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
oxfmt,oxlint, andoxlint-plugin-eslint; removedprettier,eslint, and@eslint/js..oxfmtrc.jsonand.oxlintrc.json(root andpackages/cli); removed.prettierrc,.prettierignore, andeslint.config.mjsfiles.oxc.oxc-vscodeand added it to recommendations.Migration
oxc.oxc-vscodeas the default formatter..oxfmtrc.json/.oxlintrc.json; formatting checks useoxfmt --checkand linting usesoxlint.Written for commit 2ce0986. Summary will update on new commits.