refactor: add .js import extensions to Confirmations packages#9582
Merged
Conversation
Mrtenz
enabled auto-merge
July 21, 2026 14:59
matthewwalsh0
self-requested a review
July 21, 2026 15:00
matthewwalsh0
requested changes
Jul 21, 2026
| import type { Hex } from '@metamask/utils'; | ||
|
|
||
| import type { AddressBookControllerMethodActions } from './AddressBookController-method-action-types'; | ||
| import type { AddressBookControllerMethodActions } from './AddressBookController-method-action-types.js'; |
Member
There was a problem hiding this comment.
What do we gain by this distinction?
Regardless of what format we compile our packages to, surely it can support either import format to avoid this chore refactor?
matthewwalsh0
previously approved these changes
Jul 21, 2026
Mrtenz
force-pushed
the
mrtenz/esm-import-extensions-confirmations
branch
3 times, most recently
from
July 22, 2026 12:04
23004b5 to
8e19dc4
Compare
Mrtenz
force-pushed
the
mrtenz/esm-import-extensions-confirmations
branch
from
July 23, 2026 08:57
8e19dc4 to
eb91453
Compare
matthewwalsh0
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
.jsimport extensions to all relative imports in the Confirmationspackages, in preparation for the ESM refactor.
The ESLint rule that enforces this (
n/file-extension-in-import+import-x/extensions) has been added for these packages ineslint.config.mjs.Packages
@metamask/address-book-controller@metamask/approval-controller@metamask/ens-controller@metamask/gas-fee-controller@metamask/logging-controller@metamask/message-manager@metamask/name-controller@metamask/signature-controller@metamask/transaction-controller@metamask/transaction-pay-controller@metamask/user-operation-controllerNote
Low Risk
Mechanical import-path and lint/tooling updates with no intentional runtime behavior changes; risk is limited to mis-resolved module paths if build/test ESM config is incomplete.
Overview
Prepares Confirmations controller packages for ESM by appending
.jsto relative imports/exports (including auto-generated messenger action types and cross-package test helpers) and wiring those packages into the root ESLintn/file-extension-in-importallowlist.package.jsonscripts formessenger-action-types:check/generatenow pass--esmso generated types match the new import style. No controller business logic changes.Reviewed by Cursor Bugbot for commit eb91453. Bugbot is set up for automated code reviews on this repo. Configure here.