Skip to content

refactor: add .js import extensions to Confirmations packages#9582

Merged
Mrtenz merged 11 commits into
mainfrom
mrtenz/esm-import-extensions-confirmations
Jul 23, 2026
Merged

refactor: add .js import extensions to Confirmations packages#9582
Mrtenz merged 11 commits into
mainfrom
mrtenz/esm-import-extensions-confirmations

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds .js import extensions to all relative imports in the Confirmations
packages, 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 in
eslint.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-controller

Note

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 .js to relative imports/exports (including auto-generated messenger action types and cross-package test helpers) and wiring those packages into the root ESLint n/file-extension-in-import allowlist.

package.json scripts for messenger-action-types:check / generate now pass --esm so 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.

@Mrtenz
Mrtenz requested review from a team as code owners July 21, 2026 14:45
@Mrtenz
Mrtenz temporarily deployed to default-branch July 21, 2026 14:46 — with GitHub Actions Inactive
@Mrtenz
Mrtenz enabled auto-merge July 21, 2026 14:59
@matthewwalsh0
matthewwalsh0 self-requested a review July 21, 2026 15:00
import type { Hex } from '@metamask/utils';

import type { AddressBookControllerMethodActions } from './AddressBookController-method-action-types';
import type { AddressBookControllerMethodActions } from './AddressBookController-method-action-types.js';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
matthewwalsh0 previously approved these changes Jul 21, 2026
@Mrtenz
Mrtenz force-pushed the mrtenz/esm-import-extensions-confirmations branch 3 times, most recently from 23004b5 to 8e19dc4 Compare July 22, 2026 12:04
@Mrtenz
Mrtenz force-pushed the mrtenz/esm-import-extensions-confirmations branch from 8e19dc4 to eb91453 Compare July 23, 2026 08:57
@Mrtenz
Mrtenz added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit af10b42 Jul 23, 2026
427 checks passed
@Mrtenz
Mrtenz deleted the mrtenz/esm-import-extensions-confirmations branch July 23, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants