Skip to content

Eslint to biome migration#832

Open
gregnazario wants to merge 8 commits intomainfrom
cursor/eslint-to-biome-migration-b82b
Open

Eslint to biome migration#832
gregnazario wants to merge 8 commits intomainfrom
cursor/eslint-to-biome-migration-b82b

Conversation

@gregnazario
Copy link
Collaborator

@gregnazario gregnazario commented Feb 26, 2026

Description

Migrates the project from ESLint + Prettier to Biome to significantly speed up the development process by using a single, fast tool for linting, formatting, and import sorting.

This change:

  • Replaces ESLint (9.x) with its plugins and Prettier with Biome (2.4.4).
  • Removes 7 dependencies (eslint, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint-config-prettier, eslint-plugin-import, globals, prettier) and adds @biomejs/biome.
  • Deletes eslint.config.cjs, .prettierrc, .prettierignore, and introduces biome.json.
  • Updates package.json scripts for lint, fmt, _fmt, and adds a new check script for comprehensive Biome checks.
  • Applies codebase auto-fixes including adding import type annotations, organizing imports, applying node: protocol, and removing obsolete eslint-disable comments.
  • Improves performance dramatically: Biome checks 240 files (lint + format + import sorting) in ~200ms, compared to multi-second runs with the previous ESLint + Prettier setup.

Test Plan

  1. Run pnpm install to ensure all dependencies are correctly installed.
  2. Run pnpm check to verify linting, formatting, and import sorting.
  3. Run pnpm lint to verify linting.
  4. Run pnpm fmt to apply formatting changes and pnpm _fmt to check formatting.
  5. Run pnpm build to ensure the project builds successfully after the changes.
  6. Run pnpm test to ensure all tests pass.

Differences

  • Lint and Format speedup: 44x faster
  • Build output: No change
  • Dependency footprint: 26 less transitive dependencies

Related Links

N/A

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

Open in Web Open in Cursor 

@cursor
Copy link

cursor bot commented Feb 26, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@gregnazario gregnazario marked this pull request as ready for review February 27, 2026 18:46
@gregnazario gregnazario requested a review from a team as a code owner February 27, 2026 18:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the repo’s JavaScript/TypeScript linting + formatting workflow from ESLint + Prettier to Biome, updating CI scripts and applying large-scale autofixes (imports, Node node: protocol, and lint-disable cleanup) across source and test files.

Changes:

  • Replace ESLint/Prettier configuration and dependencies with a Biome configuration (biome.json) and updated pnpm scripts (lint, fmt, check, _fmt).
  • Apply mechanical code changes driven by Biome rules (e.g., node: imports, import organization, removal of eslint-disable comments).
  • Update CI composite actions and contributor docs (CLAUDE.md / AGENTS.md) to reference Biome-based commands.

Reviewed changes

Copilot reviewed 45 out of 49 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/serializer.test.ts Replace @ts-ignore with @ts-expect-error; remove ESLint suppression comments.
tests/unit/hdKey.test.ts Replace ESLint suppression with Biome suppression for bracket notation used in tests.
tests/unit/bcsHelper.test.ts Remove obsolete ESLint suppression comment.
tests/step-definitions/crypto_private_keys.steps.mts Switch assert import to node:assert; remove ESLint disables.
tests/step-definitions/bcs.steps.mts Switch assert import to node:assert; formatting updates and switch-case scoping tweaks.
tests/postTest.cjs Formatting-only change (arrow function style).
tests/move/arguments/publish.json Formatting-only change.
tests/e2e/transactionManagement/transactionWorker.test.ts Update Array construction to satisfy new lint/style rules.
tests/e2e/transaction/transactionSubmission.test.ts Switch assert import to node:assert.
tests/e2e/client/aptosRequest.test.ts Remove obsolete ESLint suppression comments.
tests/e2e/api/transactionResponse.test.ts Rename unused variables to satisfy linting without ESLint disables.
tests/e2e/api/digitalAsset.test.ts Small non-null assertion/style adjustment in test helper.
tests/e2e/ans/publishANSContracts.ts Switch execSync import to node:child_process; remove ESLint disables.
src/utils/helpers.ts Remove obsolete ESLint suppression comment.
src/transactions/typeTag/parser.ts Switch-case scoping adjustment and ESLint suppression cleanup.
src/transactions/typeTag/index.ts Remove obsolete ESLint disables at top of file.
src/transactions/transactionBuilder/transactionBuilder.ts Update Array construction style to satisfy lint/style rules.
src/transactions/management/accountSequenceNumber.ts Remove obsolete ESLint disables around console usage.
src/transactions/instances/transactionPayload.ts Remove obsolete ESLint disable for unused parameter.
src/transactions/authenticator/account.ts Remove obsolete ESLint disable for unused parameter.
src/internal/transaction.ts Replace new Date().getTime() with Date.now(); minor style cleanup.
src/internal/queries/getTableItemsMetadata.graphql Formatting updates.
src/internal/queries/getTableItemsData.graphql Formatting updates.
src/internal/queries/getAuthKeysForPublicKey.graphql Formatting updates (multi-line query signature).
src/internal/queries/getAccountAddressesForAuthKey.graphql Formatting updates (multi-line query signature).
src/internal/keyless.ts Replace throw Error(...) with throw new Error(...).
src/internal/account.ts Replace throw Error(...) with throw new Error(...).
src/core/crypto/privateKey.ts Remove obsolete ESLint suppression comment.
src/core/crypto/keyless.ts Remove obsolete ESLint suppression comment.
src/core/crypto/abstraction.ts Remove obsolete ESLint suppressions for unused parameters.
src/cli/move.ts Switch Node built-in imports to node: protocol.
src/cli/localNode.ts Switch Node built-in imports to node: protocol; remove ESLint disables.
src/bcs/serializable/movePrimitives.ts Remove obsolete ESLint disable at top of file.
src/api/transactionSubmission/helpers.ts Remove obsolete ESLint suppression comment.
src/api/aptosConfig.ts Remove obsolete ESLint suppression comments; normalize throw new Error.
src/api/aptos.ts Formatting-only change in interface extends list.
src/account/EphemeralKeyPair.ts Remove redundant switch case (Ed25519 handled by default).
src/account/Account.ts Adjust deprecated helper to call Account.fromPrivateKey directly.
pnpm-lock.yaml Remove ESLint/Prettier-related packages; add Biome packages.
package.json Update scripts to Biome; replace devDependencies (ESLint/Prettier → Biome).
eslint.config.cjs Delete ESLint configuration.
biome.json Add Biome configuration.
CLAUDE.md Update developer workflow docs to reference Biome scripts.
CHANGELOG.md Document migration to Biome and related behavioral changes.
AGENTS.md Update developer workflow docs to reference Biome scripts.
.prettierrc Delete Prettier configuration.
.prettierignore Delete Prettier ignore file.
.github/actions/run-lint/action.yaml Update lint CI action to run Biome lint.
.github/actions/run-fmt/action.yaml Update format CI action to run Biome-based formatting check.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +137 to +141
"enabled": true,
"actions": {
"source": {
"organizeImports": "off"
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

assist.actions.source.organizeImports is set to "off", but the PR description/CHANGELOG mention import sorting via Biome. If import sorting is intended to be part of pnpm check, consider enabling organize-imports in Biome (or adjusting the docs/CHANGELOG to match the actual configuration).

Copilot uses AI. Check for mistakes.
cursoragent and others added 7 commits February 27, 2026 19:14
Replace ESLint and Prettier with Biome for linting and formatting:

- Add biome.json with equivalent lint rules and Prettier-compatible formatting
- Update package.json scripts: lint, fmt, _fmt now use Biome; add 'check' command
- Remove ESLint deps: eslint, @typescript-eslint/*, eslint-config-prettier, eslint-plugin-import, globals
- Remove Prettier deps: prettier
- Remove config files: eslint.config.cjs, .prettierrc, .prettierignore
- Update CHANGELOG.md, CLAUDE.md, AGENTS.md to reflect new tooling

Biome checks 240 files in ~200ms vs multi-second ESLint runs.

Co-authored-by: Greg Nazario <greg@gnazar.io>
- Add 'import type' annotations where imports are only used as types
- Organize imports alphabetically
- Apply useNodejsImportProtocol (node: prefix)
- Apply useConsistentBuiltinInstantiation
- Apply useArrayLiterals, useDateNow, useLiteralKeys
- Remove all obsolete eslint-disable comments

Co-authored-by: Greg Nazario <greg@gnazar.io>
- Add 'import type' annotations where imports are only used as types
- Organize imports alphabetically
- Apply useNodejsImportProtocol (node: prefix)
- Apply useConsistentBuiltinInstantiation, useArrayLiterals
- Fix noNonNullAssertedOptionalChain in digitalAsset.test.ts
- Remove all obsolete eslint-disable comments

Co-authored-by: Greg Nazario <greg@gnazar.io>
- Restore all console.log/warn/error/info calls removed by Biome's
  unsafe noConsole auto-fix (src/api/aptosConfig.ts, src/cli/localNode.ts,
  src/core/crypto/singleKey.ts, src/transactions/management/accountSequenceNumber.ts,
  src/utils/helpers.ts, tests/e2e/ans/publishANSContracts.ts,
  tests/e2e/client/aptosRequest.test.ts)
- Disable noConsole rule in biome.json to prevent future auto-removal
- Revert useArrayLiterals auto-fixes (new Array<T>() -> T[] = [])
  across all files; disable useArrayLiterals rule in biome.json
- Revert catch variable renaming (error -> _error) where console
  logging was restored

Co-authored-by: Greg Nazario <greg@gnazar.io>
…olution

Restore original export * statement order from e197116 in:
- src/bcs/index.ts
- src/core/crypto/index.ts
- src/errors/index.ts
- src/transactions/index.ts
- src/transactions/instances/index.ts
- src/transactions/transactionBuilder/index.ts
- src/transactions/typeTag/index.ts
- src/types/index.ts
- src/utils/index.ts

Biome's import sorting had reordered exports which can break circular
dependency resolution at runtime.

Co-authored-by: Greg Nazario <greg@gnazar.io>
- Fix format check: update CI action to run 'pnpm _fmt' instead of
  'pnpm _fmt --check' since biome format without --write already checks
- Fix hdKey.test.ts: restore bracket notation for private method access
  (Ed25519PrivateKey["fromDerivationPathInner"]) that was incorrectly
  changed to dot notation by Biome's useLiteralKeys rule
- Fix accountSequenceNumber.test.ts: revert export ordering in
  src/account/index.ts and other barrel files to preserve circular
  dependency resolution order
- Disable organize imports for barrel files (index.ts) in biome.json
  overrides to prevent future reordering
- Update CI action descriptions to reference Biome instead of
  ESLint/Prettier
- Fix import type warnings in reverted barrel files

Co-authored-by: Greg Nazario <greg@gnazar.io>
…olution

The previous commits applied Biome's import sorting and import-type
annotations across the codebase. This broke circular dependency
resolution when modules are loaded via ts-jest (CommonJS), causing
'Ed25519PrivateKey is not a constructor' errors.

Root cause: import type annotations change which modules get loaded
at evaluation time (type-only imports are erased), and import
reordering changes the module evaluation order. Both can break
circular dependency chains that depend on specific load ordering.

Changes:
- Restore original import ordering in all source files
- Disable organizeImports and useImportType rules in biome.json
- Keep eslint-disable comment removal
- Keep Biome formatting and safe lint auto-fixes (useNodejsImportProtocol,
  useConsistentBuiltinInstantiation, useDateNow, noUselessSwitchCase)
- Keep biome-ignore comments for hdKey.test.ts bracket notation

Co-authored-by: Greg Nazario <greg@gnazar.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gregnazario gregnazario force-pushed the cursor/eslint-to-biome-migration-b82b branch from 70c6e6d to e586a6e Compare February 28, 2026 00:14
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.

3 participants