Skip to content

Commit 093b11a

Browse files
chore(selectors): remove unused selector imports (#47637)
## **Description** Removes two unused imports reported by `tsc --noUnusedLocals`. `infuraProjectId` remains the live constant in `shared/constants/network.ts`; only the unused import in the multichain network selectors is removed. `ProductType` remains used by subscription hooks; only the unused import in `ui/selectors/subscription/subscription.ts` is removed. Owner set: none (no CODEOWNERS match for any touched file). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `ui/selectors/multichain/networks.ts` | `infuraProjectId` import | unused local | | `ui/selectors/subscription/subscription.ts` | `ProductType` import | unused local | Whole-repo whole-word search: remaining `infuraProjectId` hits are the live constant, its callers, and docs/fixtures. Remaining `ProductType` hits are other files that import the type themselves. Open PRs mention `infuraProjectId` in unrelated diffs; none edit these two files, and none mention `ProductType`. `infuraProjectId` import blame is 2026-03-02 (file last changed 2026-08-17). `ProductType` import blame is 2025-09-24 (file last changed 2026-06-12). No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched files, and `yarn test:unit --coverage=false` for `ui/selectors/multichain/networks.test.ts` and `ui/selectors/subscription/subscription.test.ts` with no snapshot updates. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Import-only cleanup with no runtime or type surface changes beyond satisfying the compiler. > > **Overview** > Removes **unused imports** flagged by `tsc --noUnusedLocals` in two selector modules, with no logic or export changes. > > In `ui/selectors/multichain/networks.ts`, the **`infuraProjectId`** import from shared network constants is dropped; the file still uses **`CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP`**, and **`infuraProjectId`** remains defined and used elsewhere in the repo. > > In `ui/selectors/subscription/subscription.ts`, the unused **`ProductType`** import from `@metamask/subscription-controller` is removed; subscription selectors still rely on **`PRODUCT_TYPES`**, **`Subscription`**, and related types. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 46b2290. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
1 parent 0492f59 commit 093b11a

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

‎ui/selectors/multichain/networks.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ import {
2929
MULTICHAIN_PROVIDER_CONFIGS,
3030
type MultichainProviderConfig,
3131
} from '../../../shared/constants/multichain/networks';
32-
import {
33-
CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP,
34-
infuraProjectId,
35-
} from '../../../shared/constants/network';
32+
import { CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP } from '../../../shared/constants/network';
3633
import {
3734
type ProviderConfigState,
3835
type SelectedNetworkClientIdState,

‎ui/selectors/subscription/subscription.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
CachedLastSelectedPaymentMethod,
33
PricingResponse,
44
PRODUCT_TYPES,
5-
ProductType,
65
Subscription,
76
SubscriptionControllerState,
87
} from '@metamask/subscription-controller';

0 commit comments

Comments
 (0)