MetaMask / MetaMask/metamask-extension

[P1] util.js: delete dead / test-only exports (Phase 0)

Open
#44,554 0 comments 0 reactions 0 assignees View on GitHub
for-migration INVALID-ISSUE-TEMPLATE mig-epic-70-child team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Parent Epic:** [#44552 — `util.js` decomposition](https://github.com/MetaMask/metamask-extension/issues/44552)
**Source:** `ui/helpers/utils/util.js`
**Size:** S

---

## Problem

Ten exports are referenced only in `util.test.js` or nowhere: `formatDateWithSuffix` (+ private `getOrdinalSuffix`), `isDefaultMetaMaskChain`, `addressSummary`, `isOriginContractAddress`, `getRandomFileName`, `checkExistingAllTokens`, `bnLessThan`, `bnGreaterThanEqualTo`, `bnLessThanEqualTo`, `IS_FLASK`. Deleting them shrinks the file with zero import rewrites and de-risks every downstream relocation.

## Solution

Delete the 10 dead/test-only exports, their tests, and any now-unused private helpers. Keep `parseBalance`/`stripOneLayerofNesting`/`stripHttpsScheme` un-exported inside their group's later move.

## Acceptance Criteria

- [ ] 10 exports + dead private helpers removed; `util.test.js` cases for them removed.
- [ ] `yarn lint:tsc` + tests green; zero import-site changes needed.

Contributor guide

Open the contributing guide

Research direction

Start with ui/helpers/utils/util.js and util.test.js. Locate the ten listed exports, their tests, and any now-unused private helpers, then remove those cases without changing import sites. Run yarn lint:tsc and the tests; done means the listed exports and tests are gone and everything remains green.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.