Commit 11cf87a
chore: Notification controller eslint cleanup (#7479)
## Explanation
This PR addresses ESLint suppressions in
`packages/notification-services-controller` as part of the ASSETS-2100
cleanup initiative.
* **Current state and why it needs to change:** The specified files had
existing ESLint suppressions for
`@typescript-eslint/explicit-function-return-type`, `id-length`, and
`@typescript-eslint/naming-convention`. These suppressions needed to be
resolved to improve code quality and consistency.
* **Solution your changes offer and how it works:**
* In `perp-notifications.ts`, the `createPerpOrderNotification` function
now has an explicit `Promise<void>` return type, and the catch block
variable `e` was renamed to `error` to satisfy `id-length`.
* In `notification-api.ts` and `schema.ts`, file-level `eslint-disable
@typescript-eslint/naming-convention` comments were added.
* **Changes whose purpose might not be obvious:** The `eslint-disable`
comments for `naming-convention` are intentional. `schema.ts` is an
auto-generated file from an OpenAPI specification, and
`notification-api.ts` defines types directly derived from an external
Notification API, both of which dictate their own naming conventions
(e.g., snake_case) that cannot be changed without breaking compatibility
or manual intervention that would be overwritten.
## References
* Fixes
[ASSETS-2100](https://consensyssoftware.atlassian.net/browse/ASSETS-2100)
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
---
<a
href="https://cursor.com/background-agent?bcId=bc-29b62e75-f654-4fb7-819e-bfdcb9872187"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a> <a
href="https://cursor.com/agents?id=bc-29b62e75-f654-4fb7-819e-bfdcb9872187"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>
[ASSETS-2100]:
https://consensyssoftware.atlassian.net/browse/ASSETS-2100?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Removes ESLint suppressions by adding an explicit return type and
standardizing error variable in `perp-notifications.ts`, adding
file-level `naming-convention` disables to API-derived type files, and
updating `eslint-suppressions.json`.
>
> - **Notification Services Controller**:
> - `services/perp-notifications.ts`: Add explicit `Promise<void>`
return type to `createPerpOrderNotification`; rename catch variable to
`error`.
> - `types/notification-api/notification-api.ts`: Add file-level
`eslint-disable @typescript-eslint/naming-convention` with note about
external schema.
> - `types/notification-api/schema.ts`: Add file-level `eslint-disable
@typescript-eslint/naming-convention` and auto-generated file note.
> - **ESLint suppressions**:
> - Update `eslint-suppressions.json` to remove entries for the above
files.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8ddabd4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor Agent <[email protected]>1 parent 4a396db commit 11cf87a
File tree
4 files changed
+7
-21
lines changed- packages/notification-services-controller/src/NotificationServicesController
- services
- types/notification-api
4 files changed
+7
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | 1563 | | |
1582 | 1564 | | |
1583 | 1565 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
0 commit comments