-
-
Notifications
You must be signed in to change notification settings - Fork 262
chore: Notification controller eslint cleanup #7483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Notification controller eslint cleanup #7483
Conversation
Co-authored-by: prithpal.sooriya <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
@cursor update the |
core
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cursor remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've completed both tasks:
-
Removed the
corefile - This was an accidentally committed core dump file (36MB ELF binary fromlight-locker) -
Updated the changelog - Added an entry under
[Unreleased] > Changedfor PR chore: Notification controller eslint cleanup #7483:- Improve code quality by adding explicit return types and fixing ESLint violations in push notification utilities ([#7483](https://github.com/MetaMask/core/pull/7483))
The changes have been committed and pushed to the branch.
Learn more about Cursor Agents
- Remove accidentally committed core dump file - Add changelog entry for ESLint cleanup PR #7483
|
@cursor please remove the changelog changes, as these eslint changes does not impact the implementation |
|
Done! I've removed the changelog entry for this PR. Since the ESLint changes are purely internal code quality improvements that don't affect the implementation or API, they don't need to be documented in the changelog. Learn more about Cursor Agents |
ESLint changes don't impact implementation, so no changelog entry needed.
6a319e9
…ion-controller-eslint-cleanup-f7ec
6a319e9 to
ba5e91a
Compare
Explanation
This PR addresses and removes ESLint suppressions from three files within
packages/notification-services-controlleras part of a larger cleanup effort (ASSETS-2100).@typescript-eslint/explicit-function-return-type,no-restricted-globals,require-atomic-updates, andid-length. These suppressions masked potential code quality issues and reduced code clarity.push-utils.test.ts: Explicit return types were added to all functions to satisfy@typescript-eslint/explicit-function-return-type. Forno-restricted-globalsrelated toself, targetedeslint-disable-next-linecomments with explanations were added, asselfis required for testing service worker functionality.push-utils.ts: Explicit return types were added to functions to satisfy@typescript-eslint/explicit-function-return-type. Therequire-atomic-updatesissue was addressed with a targetedeslint-disable-next-linecomment and explanation, as the race condition for caching a boolean is acceptable.is-onchain-notification.ts: Theid-lengthviolation was fixed by renaming the parameterntonotificationfor improved readability.eslint-suppressions.json.eslint-disable-next-linecomments forno-restricted-globalsandrequire-atomic-updatesare intentional and include inline explanations in the code, detailing why these specific rules are being ignored at those points.References
Checklist
Note
Adds explicit return types and stricter typings to web push utils and tests, renames a short param in on-chain notification check, and removes related entries from eslint-suppressions.json.
getPushAvailability,listenToPushNotificationsReceived,listenToPushNotificationsClicked, andcreateSubscribeToPushNotifications; ensure handlers returnPromise<void>/void; typeunsubscribefunctions.eslint-disable-next-line require-atomic-updates.web/push-utils.test.ts):functions; add explicit return types; type Jest spies; add targetedeslint-disable-next-line no-restricted-globalsforselfusage; simulatenotificationclickviaself.dispatchEvent.isOnChainRawNotificationparam fromntonotificationfor clarity.eslint-suppressions.json.Written by Cursor Bugbot for commit ba5e91a. This will update automatically on new commits. Configure here.