-
-
Notifications
You must be signed in to change notification settings - Fork 262
chore: Notification services controller lint cleanup #7487
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 #7487
Conversation
Co-authored-by: prithpal.sooriya <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
@cursor update the |
|
I've updated the - Improve code quality by adding explicit return types, renaming short identifiers, and resolving ESLint violations ([#7487](https://github.com/MetaMask/core/pull/7487))This entry succinctly describes the lint cleanup work that was done:
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 entry for the ESLint cleanup changes. Since these are internal code quality improvements that don't affect the implementation or public API, they don't need to be documented in the changelog. Learn more about Cursor Agents |
Co-authored-by: prithpal.sooriya <[email protected]>
Explanation
The
notification-services-controllerpackage contained numerous ESLint suppressions for@typescript-eslint/explicit-function-return-type,id-length,id-denylist, and@typescript-eslint/no-misused-promises. These suppressions indicated areas where the code did not adhere to established linting rules, impacting readability, maintainability, and type safety.This PR addresses these violations by:
NotificationServicesController.ts,NotificationServicesController.test.ts, andmockServices.tsto improve type clarity.e,s,a,n,x) to more descriptive names to satisfyid-lengthand enhance readability.errtoerrorin catch blocks to comply withid-denylist.eslint-disablecomment with an explanation for a specificsubscribecallback inNotificationServicesController.ts. This addresses@typescript-eslint/no-misused-promiseswhere the promise result is intentionally not awaited due to the nature of the messaging system's callback.All corresponding entries have been removed from
eslint-suppressions.json.References
Checklist
Note
Adds explicit function return types and stricter typings across the notification services controller, tests, and mocks, and removes related ESLint suppressions.
NotificationServicesController.ts):error.NotificationServicesController.test.ts):nock.Scope), adjust filters/callback param names.typedMockActiontyping and rename auth failure scenario keys.__fixtures__/mockServices.ts):nock.Scope; typeMockReply; add explicit return types.eslint-suppressions.jsonfor these files related to@typescript-eslint/explicit-function-return-type,id-length,id-denylist, and@typescript-eslint/no-misused-promises.Written by Cursor Bugbot for commit 889d9a8. This will update automatically on new commits. Configure here.