Conversation
|
Cursor Agent can help with this pull request. Just |
There was a problem hiding this comment.
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 updatedpnpmscripts (lint,fmt,check,_fmt). - Apply mechanical code changes driven by Biome rules (e.g.,
node:imports, import organization, removal ofeslint-disablecomments). - 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.
| "enabled": true, | ||
| "actions": { | ||
| "source": { | ||
| "organizeImports": "off" | ||
| } |
There was a problem hiding this comment.
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).
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>
70c6e6d to
e586a6e
Compare
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:
eslint,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-plugin-import,globals,prettier) and adds@biomejs/biome.eslint.config.cjs,.prettierrc,.prettierignore, and introducesbiome.json.package.jsonscripts forlint,fmt,_fmt, and adds a newcheckscript for comprehensive Biome checks.import typeannotations, organizing imports, applyingnode:protocol, and removing obsoleteeslint-disablecomments.Test Plan
pnpm installto ensure all dependencies are correctly installed.pnpm checkto verify linting, formatting, and import sorting.pnpm lintto verify linting.pnpm fmtto apply formatting changes andpnpm _fmtto check formatting.pnpm buildto ensure the project builds successfully after the changes.pnpm testto ensure all tests pass.Differences
Related Links
N/A
Checklist
pnpm fmt?CHANGELOG.md?