-
-
Notifications
You must be signed in to change notification settings - Fork 262
chore: Notification services controller lint cleanup #7481
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 services controller lint cleanup #7481
Conversation
Co-authored-by: prithpal.sooriya <[email protected]>
|
Cursor Agent can help with this pull request. Just |
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.
|
@cursor update the |
|
I've completed both tasks:
- Improve type safety by adding explicit return types to functions in `NotificationServicesPushController` and related files ([#7481](https://github.com/MetaMask/core/pull/7481))
The current changes in this PR now include:
Learn more about Cursor Agents |
Co-authored-by: prithpal.sooriya <[email protected]>
|
@cursor please remove the changelog changes, as these eslint changes does not impact the implementation |
|
Done! I've removed the changelog changes. The PR now only contains the ESLint fix changes:
The Learn more about Cursor Agents |
Co-authored-by: prithpal.sooriya <[email protected]>
52123bd
…ion-services-controller-lint-cleanup-c8e9
52123bd to
f5e64a1
Compare
Explanation
What is the current state of things and why does it need to change?
The
packages/notification-services-controllercontained ESLint suppressions for@typescript-eslint/explicit-function-return-typeand@typescript-eslint/prefer-nullish-coalescing. These suppressions indicated areas where type safety and modern JavaScript practices were not fully enforced, leading to potential maintainability issues and reduced code clarity.What is the solution your changes offer and how does it work?
This PR addresses these suppressions by:
NotificationServicesPushController.test.ts,NotificationServicesPushController.ts, and__fixtures__/mockServices.tsto satisfy the@typescript-eslint/explicit-function-return-typerule.||) with the nullish coalescing operator (??) inNotificationServicesPushController.test.tsto fix the@typescript-eslint/prefer-nullish-coalescingrule.eslint-suppressions.json.Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
No, the changes are straightforward type annotations and a minor logical operator update.
References
Checklist
Note
Adds explicit return types across NotificationServicesPushController code/tests, adopts nullish coalescing in tests, and removes related ESLint suppressions.
#getAndAssertBearerToken,#updatePushState,subscribeToPushNotifications,enablePushNotifications,disablePushNotifications, andupdateTriggerPushNotificationsinNotificationServicesPushController.ts.mockErrorLog,arrangeServicesMocks,arrangeMockMessenger,mockAuthBearerTokenCall) and improve Jest typings inNotificationServicesPushController.test.ts.??) for config defaults.mockEndpointUpdatePushNotificationLinksin__fixtures__/mockServices.ts.@typescript-eslint/explicit-function-return-typeand@typescript-eslint/prefer-nullish-coalescingentries related to these files ineslint-suppressions.json.Written by Cursor Bugbot for commit f5e64a1. This will update automatically on new commits. Configure here.