Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1560,21 +1560,6 @@
"count": 3
}
},
"packages/notification-services-controller/src/NotificationServicesController/constants/notification-schema.ts": {
"@typescript-eslint/naming-convention": {
"count": 18
}
},
"packages/notification-services-controller/src/NotificationServicesController/mocks/mockResponses.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 6
}
},
"packages/notification-services-controller/src/NotificationServicesController/processors/process-api-notifications.test.ts": {
"id-length": {
"count": 1
}
},
"packages/notification-services-controller/src/NotificationServicesController/services/perp-notifications.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Using SCREAMING_SNAKE_CASE for enum name and members to mirror snake_case API string values for readability
/* eslint-disable @typescript-eslint/naming-convention */
export enum TRIGGER_TYPES {
FEATURES_ANNOUNCEMENT = 'features_announcement',
METAMASK_SWAP_COMPLETED = 'metamask_swap_completed',
Expand All @@ -18,6 +20,7 @@ export enum TRIGGER_TYPES {
SNAP = 'snap',
PLATFORM = 'platform',
}
/* eslint-enable @typescript-eslint/naming-convention */

export const NOTIFICATION_API_TRIGGER_TYPES_SET: Set<string> = new Set([
TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,
Expand Down Expand Up @@ -50,5 +53,7 @@ export const NOTIFICATION_CHAINS_ID = {
SEI: '1329',
} as const;

// Kept as SCREAMING_SNAKE_CASE for backwards compatibility
// eslint-disable-next-line @typescript-eslint/naming-convention
export type NOTIFICATION_CHAINS_IDS =
(typeof NOTIFICATION_CHAINS_ID)[keyof typeof NOTIFICATION_CHAINS_ID];
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type MockResponse = {

export const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();

// Using `satisfies` to preserve narrow return types while ensuring type safety; explicit return types would widen to MockResponse
/* eslint-disable @typescript-eslint/explicit-function-return-type */
export const getMockFeatureAnnouncementResponse = () => {
return {
url: FEATURE_ANNOUNCEMENT_API,
Expand All @@ -40,10 +42,13 @@ export const getMockOnChainNotificationsConfig = () => {
response: [{ address: '0xTestAddress', enabled: true }],
} satisfies MockResponse;
};
/* eslint-enable @typescript-eslint/explicit-function-return-type */

export const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =
createMockRawOnChainNotifications();

// Using `satisfies` to preserve narrow return types while ensuring type safety; explicit return types would widen to MockResponse
/* eslint-disable @typescript-eslint/explicit-function-return-type */
export const getMockListNotificationsResponse = () => {
return {
url: NOTIFICATION_API_LIST_ENDPOINT(),
Expand All @@ -67,3 +72,4 @@ export const getMockCreatePerpOrderNotification = () => {
response: null,
} satisfies MockResponse;
};
/* eslint-enable @typescript-eslint/explicit-function-return-type */
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const rawNotifications = [
];

const rawNotificationTestSuite = rawNotifications.map(
(n) => [n.type, n] as const,
(notification) => [notification.type, notification] as const,
);

describe('process-onchain-notifications - processOnChainNotification()', () => {
Expand Down
Loading