Skip to content

feat: migrate ts formatting from prettier to oxfmt#7973

Merged
paulbalaji merged 10 commits intomainfrom
pbio/migrate-to-oxfmt
Feb 7, 2026
Merged

feat: migrate ts formatting from prettier to oxfmt#7973
paulbalaji merged 10 commits intomainfrom
pbio/migrate-to-oxfmt

Conversation

@paulbalaji
Copy link
Collaborator

@paulbalaji paulbalaji commented Jan 30, 2026

Summary

  • Replaced Prettier with oxfmt for TypeScript/JavaScript formatting
  • oxfmt is ~100x faster than Prettier
  • Solidity files still use Prettier (oxfmt doesn't support .sol)

Changes

File Change
pnpm-workspace.yaml Added oxfmt: ^0.27.0 to catalog
package.json Added oxfmt, updated format scripts
.oxfmtrc.json Created - oxfmt config
.lintstagedrc Use oxfmt for JS/TS/MD files
.github/workflows/test.yml Use oxfmt for format checking
.vscode/extensions.json Added oxc extension recommendation
typescript/*/package.json Updated format scripts to use oxfmt

Test plan

  • pnpm exec oxfmt --check . passes
  • pnpm run lint passes
  • pnpm build succeeds
  • CI passes

Summary by CodeRabbit

  • Chores

    • Migrated formatting from Prettier to oxfmt and updated format scripts/dev tooling.
    • Updated package manifests with consolidated metadata, scripts and publish settings.
    • Added VS Code extension recommendations.
  • CI

    • Split lint/format checks: oxfmt for general files and dedicated Prettier checks for Solidity.
  • Style

    • Widespread formatting and whitespace cleanups across docs, changelogs, and source files.
  • Docs

    • Minor README and docs formatting cleanup for clarity.

@claude
Copy link
Contributor

claude bot commented Jan 30, 2026

Claude finished @paulbalaji's task in 1m 1s —— View job


Review: Prettier to oxfmt Migration

  • Review PR context and understand scope of changes
  • Check for security concerns in changed files
  • Review formatting configuration changes
  • Verify CodeRabbit feedback has been addressed
  • Provide final review summary

Overall Assessment: ✅ LGTM

This is a well-executed tooling migration from Prettier to oxfmt for TypeScript/JavaScript formatting. The PR correctly preserves Prettier for Solidity files where oxfmt lacks support.

Key Changes Reviewed

Configuration Status
.oxfmtrc.json ✅ Proper config with ignorePatterns for non-TS/JS files
.prettierrc ✅ Simplified to Solidity-only use
.lintstagedrc ✅ Routes TS/JS/MD to oxfmt, Solidity/JSON to Prettier
test.yml workflow ✅ Correctly runs oxfmt for TS/JS and Prettier for Solidity
Package updates ✅ All workspace packages use oxfmt via catalog

CodeRabbit Issues - Addressed ✅

  1. typescript/ccip-server/package.json - moduleResolution removed from package.json (it belongs in tsconfig, and parent tsconfig already defines it)

  2. typescript/sdk/package.json - Exports now properly include types condition:

"exports": {
  ".": {
    "types": "./dist/index.d.ts",
    "default": "./dist/index.js"
  }
}

Security Review

No security concerns - this PR only touches:

  • Formatting configuration
  • Package.json scripts and dependencies
  • Whitespace/formatting in source files

No Solidity contract logic was modified, so Trail of Bits security analysis is not applicable.

Minor Observations (non-blocking)

  1. .lintstagedrc uses Prettier for .json files while CI uses oxfmt for them. Consider aligning for consistency, or leave as-is if intentional.

  2. VS Code settings configure oxfmt for TypeScript/JavaScript but .lintstagedrc also formats .md with oxfmt - VS Code has no markdown formatter config. Minor inconsistency but not blocking.

CI Status

  • 2 checks passed, 11 in progress at time of review

@socket-security
Copy link

socket-security bot commented Jan 30, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​oxfmt@​0.27.0911008896100
Updatednpm/​prettier@​3.5.3 ⏵ 3.8.190 -710097 +196100

View full report

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Warning

Rate limit exceeded

@paulbalaji has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

This PR migrates formatting from Prettier to oxfmt across the monorepo, updates CI and editor settings, adds an .oxfmtrc.json, adjusts many package.json manifests and scripts, and applies widespread TypeScript formatting changes (mostly generic/implements/extends line-wrapping) and minor doc/changelog cleanups.

Changes

Cohort / File(s) Summary
Formatting Tooling & Config
/.oxfmtrc.json, /.prettierrc, /.lintstagedrc, /.vscode/extensions.json, /.vscode/settings.json
Add oxfmt config and switch lint-staged to use oxfmt; simplify Prettier config; recommend oxc.oxc-vscode and set oxc as default formatter for many languages; keep Prettier for Solidity.
CI Workflow
.github/workflows/test.yml
Replace single prettier step with oxfmt for general changed files and add dedicated Prettier checks for .sol files; add an all-files oxfmt check for non-PR events.
Monorepo Tooling / Scripts
package.json, pnpm-workspace.yaml, turbo.json
Switch many scripts from prettieroxfmt, add/rename format tasks, add oxfmt dep, remove @trivago/prettier-plugin-sort-imports, set root private: true and expand scripts.
VSCode Workspace Additions
solidity/.vscode/extensions.json, typescript/.vscode/extensions.json
Add VS Code recommendations (esbenp.prettier-vscode, oxc.oxc-vscode) for respective workspaces.
Package Manifest Updates (many packages)
typescript/*/package.json, starknet/package.json, solhint-plugin/package.json, typescript/utils/package.json, ...
Widespread package.json edits: add/ consolidate publish metadata (type, exports, types, files, homepage, repository, keywords), replace prettier with oxfmt in scripts/devDependencies, add format scripts, and reorganize fields.
TypeScript Formatting - Class/Generics
`typescript//src//(*igp-hook
*merkle-tree-hook
TypeScript Formatting - Interfaces / Types
`typescript//src//(provider-sdk/src/hook.ts
provider-sdk/src/ism.ts
TypeScript Misc. Code Style
typescript/sdk/src/deploy/HyperlaneDeployer.ts, typescript/sdk/src/providers/MultiProvider.ts, typescript/deploy-sdk/src/protocol.ts, typescript/sdk/src/zksync/ZKSyncDeployer.ts
Minor argument/line-wrapping and dynamic import formatting changes; no behavioral effect.
Docs, Changelogs, License
README.md, LICENSE.md, docs/*, .claude/skills/*/SKILL.md, **/CHANGELOG.md
Remove stray blank lines, tighten list formatting, reflow some imports and README steps, and minor license whitespace adjustments.
Tests / ESLint rules
typescript/utils/src/eslint-rules/sort-yaml-arrays.test.ts
Small test formatting adjustments (AST test data expanded); no behavior changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Mo-Hussain
  • xeno097

Poem

A wee tidy-up across the lair,
Oxfmt came in, gave code cleanair,
No dragons slain, no logic torn,
Just wrapped generics at the break of morn.
Repo's tidier now — that’s fair and square.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: migrating TypeScript formatting from Prettier to oxfmt, which is the primary objective of this PR.
Description check ✅ Passed The description covers the main changes with a summary, a detailed file-by-file table, and a test plan. However, the template sections for 'Drive-by changes', 'Related issues', 'Backward compatibility', and 'Testing methodology' are not explicitly addressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pbio/migrate-to-oxfmt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.02%. Comparing base (b930534) to head (122b2b3).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7973   +/-   ##
=======================================
  Coverage   77.02%   77.02%           
=======================================
  Files         117      117           
  Lines        2651     2651           
  Branches      244      244           
=======================================
  Hits         2042     2042           
  Misses        593      593           
  Partials       16       16           
Flag Coverage Δ
solidity 77.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 87.80% <ø> (ø)
hooks 71.86% <ø> (ø)
isms 81.10% <ø> (ø)
token 86.67% <ø> (ø)
middlewares 84.98% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paulbalaji paulbalaji force-pushed the pbio/migrate-to-oxfmt branch from fd1c012 to 2b1267e Compare January 30, 2026 17:32
@paulbalaji paulbalaji marked this pull request as draft January 30, 2026 17:39
@paulbalaji
Copy link
Collaborator Author

paulbalaji commented Jan 30, 2026

Filed upstream issue for the line-breaking differences: oxc-project/oxc#18737

Update: likely just prettier differences and not oxfmt related

@paulbalaji paulbalaji marked this pull request as ready for review January 30, 2026 18:00
@paulbalaji paulbalaji force-pushed the pbio/migrate-to-oxfmt branch from 2b1267e to 89af23a Compare February 5, 2026 12:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@typescript/ccip-server/package.json`:
- Line 72: Remove the stray "moduleResolution": "nodenext" entry from
package.json and add (or ensure it exists) under the TypeScript compilerOptions
in tsconfig.json instead; look for the literal "moduleResolution" key in
package.json and move it into the "compilerOptions" object in tsconfig.json (or
delete the package.json key if the parent tsconfig already defines it), so the
TypeScript compiler options live in tsconfig.json rather than package.json.

In `@typescript/sdk/package.json`:
- Around line 18-21: The package.json exports map currently sets "." to
"./dist/index.js" while the top-level "types": "./dist/index.d.ts" remains but
modern TypeScript won't find it when "exports" exists; update the "exports"
entry so "." is an object that includes a "types" condition pointing to
"./dist/index.d.ts" and an "import" (or "default") condition pointing to
"./dist/index.js" (e.g., "." : { "types": "./dist/index.d.ts", "import":
"./dist/index.js" }), and keep the top-level "types" as a fallback for older
tools.
🧹 Nitpick comments (6)
typescript/sdk/src/zksync/ZKSyncDeployer.ts (1)

51-54: Consider stronger typing for constructor arguments.

The any[] type for constructorArguments bypasses type safety. Since this is pre-existing code and not the focus of this formatting PR, consider addressing this in a follow-up.

Typing alternatives

Options to explore:

  • Use a generic type parameter if constructor arg types vary by contract
  • Define a union type for known constructor signatures
  • Use unknown[] with runtime validation if types can't be known statically
typescript/relayer/src/metadata/multisig.ts (1)

543-543: Consider replacing any with a proper union type.

Right now we're using any for the prefix variable. Since it can be one of two shapes from decodeProofPrefix or decodeSimplePrefix, a union type would be cleaner and give us better type safety. As per coding guidelines, we should prefer proper typing over any.

♻️ Proposed refactor using union type
+type DecodedPrefix = 
+  | ReturnType<typeof MultisigMetadataBuilder.decodeProofPrefix>
+  | ReturnType<typeof MultisigMetadataBuilder.decodeSimplePrefix>;
+
-    const prefix: any =
+    const prefix: DecodedPrefix =
       type === IsmType.MERKLE_ROOT_MULTISIG ||
       type === IsmType.STORAGE_MERKLE_ROOT_MULTISIG
         ? this.decodeProofPrefix(metadata)
.vscode/settings.json (1)

6-27: Good formatter configuration for the editor.

The per-language settings properly route JS/TS/JSON to oxc-vscode and Solidity to Prettier. formatOnSave will keep things tidy without manual intervention.

One thing though - the .lintstagedrc apparently handles .md files with oxfmt, but there's no [markdown] formatter specified here. Might want to add that for consistency when editing docs, or leave it if manual formatting is preferred for markdown.

🔧 Optional: Add markdown formatter config
   "[jsonc]": {
     "editor.defaultFormatter": "oxc.oxc-vscode"
   },
+  "[markdown]": {
+    "editor.defaultFormatter": "oxc.oxc-vscode"
+  },
   "[solidity]": {
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   }
starknet/package.json (1)

30-30: Minor inconsistency: format script includes ./package.json.

This package formats both ./src and ./package.json, while most other packages in this PR only format ./src. Not a problem per se – oxfmt can handle JSON – but might be worth aligning for consistency across the swamp. Or leave it be, no ogre's gonna lose sleep over it.

🔧 Optional: align with other packages
-    "format": "oxfmt --write ./src ./package.json"
+    "format": "oxfmt --write ./src"
typescript/aleo-sdk/package.json (1)

52-58: eslint-config-prettier is actively used but may be worth reconciling with oxfmt.

The root eslint config extends the 'prettier' configuration (via eslint-config-prettier) which gets inherited by aleo-sdk. However, since aleo-sdk uses oxfmt for formatting rather than Prettier, there's a mismatch—eslint-config-prettier's rules disable ESLint checks that conflict with Prettier's formatting, which is irrelevant when oxfmt is doing the actual formatting work.

If oxfmt and Prettier have different formatting behaviors, this could lead to formatting conflicts. You might consider whether aleo-sdk needs its own eslint config override that doesn't extend the prettier rules, or whether the root config should be updated to account for projects using oxfmt instead.

typescript/cosmos-types/package.json (1)

19-22: Minor inconsistency in exports format.

The exports here use the shorthand style ".": "./dist/index.js" while other packages in this PR (like cosmos-sdk) use the full conditional exports with explicit types:

".": {
  "types": "./dist/index.d.ts",
  "default": "./dist/index.js"
}

It still works because the top-level types field exists, but for consistency across the swamp... er, monorepo, you might want to align the format.

🔧 Suggested change for consistency
-  "exports": {
-    ".": "./dist/index.js"
-  },
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    }
+  },

Replaced Prettier with oxfmt for TypeScript/JavaScript formatting.
oxfmt is ~100x faster than Prettier. Solidity files still use Prettier.

Changes:
- Added oxfmt to catalog and root package.json
- Created .oxfmtrc.json config
- Updated format scripts in all packages
- Updated CI workflow to use oxfmt
- Added VS Code oxc extension recommendation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@paulbalaji paulbalaji force-pushed the pbio/migrate-to-oxfmt branch from 1d9aa96 to 9697bd8 Compare February 5, 2026 12:39
- Remove stray moduleResolution from ccip-server/package.json (belongs in tsconfig)
- Add types condition to sdk exports for node16/nodenext/bundler moduleResolution
@paulbalaji paulbalaji force-pushed the pbio/migrate-to-oxfmt branch from 9a686d4 to 944cdf4 Compare February 5, 2026 13:03
@paulbalaji paulbalaji enabled auto-merge February 6, 2026 21:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@typescript/infra/package.json`:
- Line 26: The package.json still defines a "prettier" npm script and lists
"prettier" in devDependencies; replace that with the intended formatter: update
the "prettier" script (scripts.prettier) to use the oxfmt CLI (e.g., "oxfmt fmt
./src ./config ./scripts ./test" or your project’s oxfmt invocation) and remove
"prettier" from devDependencies, adding the oxfmt package to devDependencies
instead; ensure you update any README or CI steps that reference the old
"prettier" script to call the new scripts/oxfmt binary (referencing the
scripts.prettier entry and the devDependencies keys to locate the changes).
🧹 Nitpick comments (3)
typescript/helloworld/.prettierrc (1)

1-19: Looks good, though the top-level settings are now just swamp decoration.

Since Prettier only formats .sol files now (which have their own overrides block), the top-level tabWidth: 2, singleQuote: true, and trailingComma: "all" on lines 2–4 are effectively dead config. Not harmful, but you could slim this down to just the overrides and plugins if you fancy a tidy swamp.

.vscode/settings.json (1)

6-27: Markdown formatting gap between lint-staged and VSCode settings.

The .lintstagedrc runs oxfmt --write on *.md files, but there's no [markdown] formatter configured here. Developers might get surprised by formatting changes on commit that they don't see in their editor. Consider adding a [markdown] block with oxc.oxc-vscode for consistency, or this might be intentional if MD format-on-save is undesirable.

typescript/radix-sdk/package.json (1)

32-32: Format script misses test files.

The format script only targets ./src, but this package has test:unit and test:e2e scripts, suggesting test files exist. For comparison, typescript/http-registry-server includes both ./src ./test in its format script.

Suggested fix
-    "format": "oxfmt --write ./src",
+    "format": "oxfmt --write ./src ./test",

Renamed 'prettier' scripts to 'format' using oxfmt in 11 packages:
- typescript/infra, sdk, utils, ccip-server, widgets, rebalancer-sim,
  github-proxy, tron-sdk, starknet
- solidity: renamed to 'format' but kept prettier for .sol files
- typescript/helloworld: oxfmt for src, prettier for contracts (.sol)

Removed prettier devDependency from packages that no longer need it.
Kept prettier only where Solidity formatting is needed (root, solidity,
helloworld).
@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Feb 6, 2026

⚙️ Node Service Docker Images Built Successfully

Service Tag
🔑 key-funder 122b2b3-20260206-213803
🔍 offchain-lookup-server 122b2b3-20260206-213803
♻️ rebalancer 122b2b3-20260206-213803
🚀 ts-relayer 122b2b3-20260206-213803
🕵️ warp-monitor 122b2b3-20260206-213803
Full image paths
gcr.io/abacus-labs-dev/hyperlane-key-funder:122b2b3-20260206-213803
gcr.io/abacus-labs-dev/hyperlane-offchain-lookup-server:122b2b3-20260206-213803
gcr.io/abacus-labs-dev/hyperlane-rebalancer:122b2b3-20260206-213803
gcr.io/abacus-labs-dev/hyperlane-ts-relayer:122b2b3-20260206-213803
gcr.io/abacus-labs-dev/hyperlane-warp-monitor:122b2b3-20260206-213803

@paulbalaji paulbalaji added this pull request to the merge queue Feb 7, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 7, 2026
@paulbalaji paulbalaji added this pull request to the merge queue Feb 7, 2026
Merged via the queue into main with commit 60fe1f7 Feb 7, 2026
253 of 255 checks passed
@paulbalaji paulbalaji deleted the pbio/migrate-to-oxfmt branch February 7, 2026 12:04
@github-project-automation github-project-automation bot moved this from In Review to Done in Hyperlane Tasks Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants