-
-
Notifications
You must be signed in to change notification settings - Fork 262
chore: Notification controller eslint cleanup #7484
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 #7484
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 in `NotificationServicesPushController` utils ([#7484](https://github.com/MetaMask/core/pull/7484))
- Add explicit return types to functions in `get-notification-data.ts` and `get-notification-message.ts`
- Rename short identifiers for better clarity (e.g., `num` to `numericValue`, `t` to `translate`, `n` to `notification`)
- Use nullish coalescing operator (`??`) instead of logical OR (`||`) where appropriateThis changelog entry describes the code quality improvements made in this PR, which includes:
The CI changelog check should now pass. 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 I previously added. The changelog now has no changes from this PR, which is correct since the ESLint cleanup is purely internal code quality improvements that don't affect the implementation or API. Learn more about Cursor Agents |
Co-authored-by: prithpal.sooriya <[email protected]>
df69908 to
010ce45
Compare
…ion-controller-eslint-cleanup-27b8
…ion-controller-eslint-cleanup-27b8
Explanation
This PR addresses and removes ESLint suppressions in three files within
packages/notification-services-controller/src/NotificationServicesPushController. The goal is to improve code quality and consistency by adhering to established linting rules.The changes include:
@typescript-eslint/explicit-function-return-type.??) to fix@typescript-eslint/prefer-nullish-coalescing.numtonumericValue,ttotranslate,ntonotification) to resolveid-denylistandid-lengthviolations.NtoTNotification,KtoTriggerType/TKey) for better clarity and to fix@typescript-eslint/naming-convention.eslint-disablecomment with an explanation for theregistration_tokenproperty inservices.ts. Itssnake_casenaming is dictated by an external API contract, making a code change impractical.eslint-suppressions.json.References
Checklist
Note
Tightens TypeScript types and naming in NotificationServicesPushController utilities/services, adds a justified snake_case exception for
registration_token, and removes related ESLint suppressions.utils/get-notification-data.ts:calcTokenAmount: BigNumber,getLeadingZeroCount: number,formatAmount: string,getAmount: string).handleShouldEllipseand options.num→numericValue).utils/get-notification-message.ts:N/K→TNotification/TKey,n→notification,t→translate).getChainSymbol.services/services.ts:registration_tokeninPushTokenRequest.eslint-suppressions.jsonfor the updated files.Written by Cursor Bugbot for commit 8dfbc12. This will update automatically on new commits. Configure here.