Repository navigation
Commit 052debe
chore(helpers): remove unused ui helper exports (#47518)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Removes unused exports from unowned `ui/helpers` files. Owner set:
`(none)` (no CODEOWNERS match). No user-facing behavior change.
The declarations are not imported anywhere. Whole-word search only hit
the definitions. None of these symbols or files are referenced by an
open pull request. Declaration blame is older than 90 days, and the
files themselves were not edited in the last 30 days. String values that
are still locale message keys remain quoted elsewhere in `ui/`, so `yarn
verify-locales` does not lose a message reference.
| path | removed (file / symbol / class) | why dead |
| --- | --- | --- |
| ui/helpers/constants/error-keys.js | INSUFFICIENT_FUNDS_ERROR_KEY |
unused export |
| ui/helpers/constants/error-keys.js | TRANSACTION_ERROR_KEY | unused
export |
| ui/helpers/constants/error-keys.js | IS_SIGNING_OR_SUBMITTING | unused
export |
| ui/helpers/constants/gas.js | PRIORITY_LEVEL_ICON_MAP | unused export
|
| ui/helpers/constants/connected-sites.js | STATUS_CONNECTED_TO_SNAP |
unused export |
| ui/helpers/utils/confirm-tx.util.ts | convertTokenToFiat | unused
export |
| ui/helpers/utils/confirm-tx.util.ts | roundExponential | unused export
|
| ui/helpers/utils/confirm-tx.util.ts | BigNumber import | cascade from
roundExponential |
Left in place on purpose: five other unused error-key exports and
`getGasFormErrorText`, because each is the only quoted reference to a
locale message key. Locales are out of scope.
Checks that passed: `yarn lint:tsc`, eslint on the touched files, and
`yarn test:unit --coverage=false` for
`ui/helpers/utils/confirm-tx.util.test.js` and `ui/helpers/constants`
(no snapshot updates). No stylesheets changed.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
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**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **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**
> Deletes unreachable helper exports only; no runtime paths or
security-sensitive logic are modified.
>
> **Overview**
> Removes dead exports from `ui/helpers` that are not imported
anywhere—proactive cleanup with no intended user-facing behavior change.
>
> **Constants:** drops `STATUS_CONNECTED_TO_SNAP`, three error-key
constants (`INSUFFICIENT_FUNDS_ERROR_KEY`, `TRANSACTION_ERROR_KEY`,
`IS_SIGNING_OR_SUBMITTING`), and the unused `PRIORITY_LEVEL_ICON_MAP`
emoji map from gas helpers.
>
> **Confirm-tx utils:** deletes `convertTokenToFiat` and
`roundExponential`, and removes the `bignumber.js` import that only
served `roundExponential`. Remaining helpers (gas totals, fee
formatting, dapp gas comparison, etc.) are unchanged.
>
> Other unused symbols were left when they still anchor locale message
keys (per PR notes).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2d41c1b. 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 060669f commit 052debe
4 files changed
Lines changed: 0 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | | - | |
9 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 74 | | |
117 | 75 | | |
118 | 76 | | |
| |||
0 commit comments