Commit c0e8f603e28 for woocommerce
commit c0e8f603e28d6d7f6138fafe10938f9310945fa8
Author: Manzoor Wani <manzoorwani.jk@gmail.com>
Date: Thu Jul 23 13:41:04 2026 +0530
Enable @typescript-eslint/no-floating-promises across the monorepo (#66795)
* Enable @typescript-eslint/no-floating-promises across the monorepo
Turn on the type-aware rule as `error` in the private
@woocommerce/eslint-config layer (never in the public plugin, which
must stay portable): a `**/*.ts(x)` block sets
parserOptions.projectService and the rule. A TYPE_AWARE_IGNORES list
keeps the project service off files no tsconfig covers (tests, mocks,
stories, typings, *.d.ts) so it does not parse-error on them.
Add two tsconfig `include` entries for TS files that are linted but no
tsconfig covered, which would otherwise parse-error under the project
service: blocks packages/prices and code-analyzer index.ts.
* Await async ops that must complete before dependent steps in tooling
Two latent floating-promise ordering bugs, surfaced by the new
no-floating-promises rule:
- accelerated-prep: addHeader()/createChangelog() write files into the
repo, but the following git.diffSummary()/git.add('.') ran without
waiting for those writes. Await them so the diff and commit see the
changes.
- transfer-issues: resetProjectFields()/addLabelsToIssue() are async
GraphQL mutations fired in a loop; the "Successfully transferred" log
(and process exit) could occur before they finished. Await them.
Both enclosing functions are already async.
* Void fire-and-forget promises flagged by no-floating-promises
Prefix intentionally-unawaited promises (dispatch, tracking,
navigation, hydration HOCs, effect/handler callbacks) with `void`,
matching the repo's existing convention. `void` is behavior-preserving:
these promises were already floating.
diff --git a/packages/js/components/changelog/dev-eslint-no-floating-promises b/packages/js/components/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/packages/js/components/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/packages/js/components/src/confetti-animation/index.ts b/packages/js/components/src/confetti-animation/index.ts
index de84ea1cf08..7d7a70d2ed7 100644
--- a/packages/js/components/src/confetti-animation/index.ts
+++ b/packages/js/components/src/confetti-animation/index.ts
@@ -40,7 +40,7 @@ function fireConfetti( colors: string[] ) {
};
function fire( particleRatio: number, opts: FireOptions ) {
- confetti(
+ void confetti(
Object.assign( {}, defaults, opts, {
particleCount: Math.floor( count * particleRatio ),
startVelocity: opts.startVelocity
diff --git a/packages/js/components/src/plugins/index.tsx b/packages/js/components/src/plugins/index.tsx
index dab9eba96c3..e194ed69ac9 100644
--- a/packages/js/components/src/plugins/index.tsx
+++ b/packages/js/components/src/plugins/index.tsx
@@ -116,7 +116,7 @@ export const Plugins = ( {
useEffect( () => {
if ( autoInstall ) {
- installAndActivate();
+ void installAndActivate();
}
}, [ autoInstall ] );
@@ -170,7 +170,7 @@ export const Plugins = ( {
onClick={ () => {
onClick();
setHasBeenClicked( true );
- installAndActivate();
+ void installAndActivate();
} }
>
{ installText }
diff --git a/packages/js/components/src/product-fields/api/registration.ts b/packages/js/components/src/product-fields/api/registration.ts
index d9b8c5f4cc6..40a34ddae65 100644
--- a/packages/js/components/src/product-fields/api/registration.ts
+++ b/packages/js/components/src/product-fields/api/registration.ts
@@ -36,7 +36,7 @@ export function registerProductField(
return;
}
- dispatch( productFieldStore ).registerProductField( {
+ void dispatch( productFieldStore ).registerProductField( {
attributes: {},
...settings,
} );
diff --git a/packages/js/customer-effort-score/changelog/dev-eslint-no-floating-promises b/packages/js/customer-effort-score/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/packages/js/customer-effort-score/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/packages/js/customer-effort-score/src/components/customer-effort-score-modal-container/index.tsx b/packages/js/customer-effort-score/src/components/customer-effort-score-modal-container/index.tsx
index cb4df97ae3d..1b724b19bfd 100644
--- a/packages/js/customer-effort-score/src/components/customer-effort-score-modal-container/index.tsx
+++ b/packages/js/customer-effort-score/src/components/customer-effort-score-modal-container/index.tsx
@@ -82,12 +82,12 @@ export const CustomerEffortScoreModalContainer = () => {
secondQuestion={ visibleCESModalData.secondQuestion }
recordScoreCallback={ ( ...args ) => {
recordScore( ...args );
- hideCesModal();
+ void hideCesModal();
visibleCESModalData.props?.onRecordScore?.();
} }
onCloseModal={ () => {
visibleCESModalData.props?.onCloseModal?.();
- hideCesModal();
+ void hideCesModal();
} }
shouldShowComments={ visibleCESModalData.props?.shouldShowComments }
getExtraFieldsToBeShown={
diff --git a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-exit-page-tracker/index.ts b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-exit-page-tracker/index.ts
index 4658ee77a77..6a10ae816e2 100644
--- a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-exit-page-tracker/index.ts
+++ b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-exit-page-tracker/index.ts
@@ -27,7 +27,7 @@ export const useCustomerEffortScoreExitPageTracker = (
return () => {
if ( hasUnsavedChangesRef.current ) {
// unmounted.
- addExitPage( pageId );
+ void addExitPage( pageId );
}
};
}, [] );
diff --git a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
index 10d82c9cc24..8fd8f219479 100644
--- a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
+++ b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
@@ -49,7 +49,7 @@ export const useCustomerEffortScoreModal = () => {
? rawShownForActions
: [];
- updateOptions( {
+ void updateOptions( {
[ SHOWN_FOR_ACTIONS_OPTION_NAME ]: [
action,
...shownForActionsOption,
@@ -66,7 +66,7 @@ export const useCustomerEffortScoreModal = () => {
_showCesModal( surveyProps, props, onSubmitNoticeProps, tracksProps );
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore We don't have type definitions for this.
- markCesAsShown( surveyProps.action );
+ void markCesAsShown( surveyProps.action );
};
return {
diff --git a/packages/js/customer-effort-score/src/utils/customer-effort-score-exit-page.ts b/packages/js/customer-effort-score/src/utils/customer-effort-score-exit-page.ts
index 1fe08dfaba0..637475c6af3 100644
--- a/packages/js/customer-effort-score/src/utils/customer-effort-score-exit-page.ts
+++ b/packages/js/customer-effort-score/src/utils/customer-effort-score-exit-page.ts
@@ -110,11 +110,11 @@ export const addCustomerEffortScoreExitPageListener = (
hasUnsavedChanges: () => boolean
) => {
// Pre-fetch the tracking option so that it is available before the unload event.
- isTrackingAllowed();
+ void isTrackingAllowed();
eventListeners[ pageId ] = () => {
if ( hasUnsavedChanges() ) {
- addExitPage( pageId );
+ void addExitPage( pageId );
}
};
window.addEventListener( 'unload', eventListeners[ pageId ] );
@@ -298,7 +298,7 @@ export function triggerExitPageCesSurvey() {
const copy = getExitPageCESCopy( exitPageItems[ 0 ] );
if ( copy?.title?.length ) {
- dispatch( store ).addCesSurvey( {
+ void dispatch( store ).addCesSurvey( {
...copy,
pageNow: window.pagenow,
adminPage: window.adminpage,
diff --git a/packages/js/data/changelog/dev-eslint-no-floating-promises b/packages/js/data/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/packages/js/data/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/packages/js/data/src/countries/resolvers.ts b/packages/js/data/src/countries/resolvers.ts
index 1181e034c26..742f45cf228 100644
--- a/packages/js/data/src/countries/resolvers.ts
+++ b/packages/js/data/src/countries/resolvers.ts
@@ -67,8 +67,8 @@ export const geolocate =
method: 'GET',
} );
const result: GeolocationResponse = await response.json();
- dispatch.geolocationSuccess( result );
+ void dispatch.geolocationSuccess( result );
} catch ( error ) {
- dispatch.geolocationError( error );
+ void dispatch.geolocationError( error );
}
};
diff --git a/packages/js/data/src/navigation/index.ts b/packages/js/data/src/navigation/index.ts
index 24b05831f48..887ce13a66b 100644
--- a/packages/js/data/src/navigation/index.ts
+++ b/packages/js/data/src/navigation/index.ts
@@ -63,7 +63,7 @@ export const store = createReduxStore( STORE_NAME, {
register( store );
-initDispatchers();
+void initDispatchers();
export const NAVIGATION_STORE_NAME = STORE_NAME;
diff --git a/packages/js/data/src/navigation/with-navigation-hydration.tsx b/packages/js/data/src/navigation/with-navigation-hydration.tsx
index 66ca96ce34d..1be6c45d253 100644
--- a/packages/js/data/src/navigation/with-navigation-hydration.tsx
+++ b/packages/js/data/src/navigation/with-navigation-hydration.tsx
@@ -46,9 +46,9 @@ export const withNavigationHydration = ( data: { menuItems: MenuItem[] } ) =>
if ( ! shouldHydrate ) {
return;
}
- startResolution( 'getMenuItems', [] );
- setMenuItems( data.menuItems );
- finishResolution( 'getMenuItems', [] );
+ void startResolution( 'getMenuItems', [] );
+ void setMenuItems( data.menuItems );
+ void finishResolution( 'getMenuItems', [] );
}, [ shouldHydrate ] );
return <OriginalComponent { ...props } />;
diff --git a/packages/js/data/src/onboarding/with-onboarding-hydration.tsx b/packages/js/data/src/onboarding/with-onboarding-hydration.tsx
index ea01c377995..5ba4f5eb3b9 100644
--- a/packages/js/data/src/onboarding/with-onboarding-hydration.tsx
+++ b/packages/js/data/src/onboarding/with-onboarding-hydration.tsx
@@ -59,9 +59,9 @@ export const withOnboardingHydration = ( data: {
! isResolvingGroup &&
! hasFinishedResolutionGroup
) {
- startResolution( 'getProfileItems', [] );
- setProfileItems( profileItems, true );
- finishResolution( 'getProfileItems', [] );
+ void startResolution( 'getProfileItems', [] );
+ void setProfileItems( profileItems, true );
+ void finishResolution( 'getProfileItems', [] );
hydratedProfileItems = true;
}
diff --git a/packages/js/data/src/options/with-options-hydration.tsx b/packages/js/data/src/options/with-options-hydration.tsx
index 72a5a081ea8..7c442d815a3 100644
--- a/packages/js/data/src/options/with-options-hydration.tsx
+++ b/packages/js/data/src/options/with-options-hydration.tsx
@@ -36,9 +36,9 @@ export const useOptionsHydration = ( data: Options ) => {
useEffect( () => {
Object.entries( shouldHydrate ).forEach( ( [ name, hydrate ] ) => {
if ( hydrate ) {
- startResolution( 'getOption', [ name ] );
- receiveOptions( { [ name ]: data[ name ] } );
- finishResolution( 'getOption', [ name ] );
+ void startResolution( 'getOption', [ name ] );
+ void receiveOptions( { [ name ]: data[ name ] } );
+ void finishResolution( 'getOption', [ name ] );
}
} );
}, [ shouldHydrate ] );
diff --git a/packages/js/data/src/payment-settings/actions.ts b/packages/js/data/src/payment-settings/actions.ts
index 7a4473952d7..b429aa4946a 100644
--- a/packages/js/data/src/payment-settings/actions.ts
+++ b/packages/js/data/src/payment-settings/actions.ts
@@ -126,7 +126,7 @@ export function updateProviderOrdering( orderMap: OrderMap ): {
type: ACTION_TYPES.UPDATE_PROVIDER_ORDERING;
} {
try {
- apiFetch( {
+ void apiFetch( {
path: WC_ADMIN_NAMESPACE + '/settings/payments/providers/order',
method: 'POST',
data: {
diff --git a/packages/js/data/src/plugins/with-plugins-hydration.tsx b/packages/js/data/src/plugins/with-plugins-hydration.tsx
index a73e00f0511..dc66b1f01cf 100644
--- a/packages/js/data/src/plugins/with-plugins-hydration.tsx
+++ b/packages/js/data/src/plugins/with-plugins-hydration.tsx
@@ -47,19 +47,19 @@ export const withPluginsHydration = ( data: PluginHydrationData ) =>
if ( ! shouldHydrate ) {
return;
}
- startResolution( 'getActivePlugins', [] );
- startResolution( 'getInstalledPlugins', [] );
- startResolution( 'isJetpackConnected', [] );
- updateActivePlugins( data.activePlugins, true );
- updateInstalledPlugins( data.installedPlugins, true );
- updateIsJetpackConnected(
+ void startResolution( 'getActivePlugins', [] );
+ void startResolution( 'getInstalledPlugins', [] );
+ void startResolution( 'isJetpackConnected', [] );
+ void updateActivePlugins( data.activePlugins, true );
+ void updateInstalledPlugins( data.installedPlugins, true );
+ void updateIsJetpackConnected(
data.jetpackStatus && data.jetpackStatus.isActive
? true
: false
);
- finishResolution( 'getActivePlugins', [] );
- finishResolution( 'getInstalledPlugins', [] );
- finishResolution( 'isJetpackConnected', [] );
+ void finishResolution( 'getActivePlugins', [] );
+ void finishResolution( 'getInstalledPlugins', [] );
+ void finishResolution( 'isJetpackConnected', [] );
}, [ shouldHydrate ] );
return <OriginalComponent { ...props } />;
diff --git a/packages/js/data/src/setting-options/actions.ts b/packages/js/data/src/setting-options/actions.ts
index ea324bc79dc..64a0f493288 100644
--- a/packages/js/data/src/setting-options/actions.ts
+++ b/packages/js/data/src/setting-options/actions.ts
@@ -258,7 +258,7 @@ const saveSettingRequest = async (
throw error;
} finally {
dispatch( setSaving( groupId, settingId, false ) );
- dispatch.__unstableReleaseStoreLock( lock );
+ void dispatch.__unstableReleaseStoreLock( lock );
}
};
@@ -335,7 +335,7 @@ const saveSettingsGroupRequest = async (
throw error;
} finally {
dispatch( setSaving( groupId, null, false ) );
- dispatch.__unstableReleaseStoreLock( lock );
+ void dispatch.__unstableReleaseStoreLock( lock );
}
};
diff --git a/packages/js/data/src/setting-options/resolvers.ts b/packages/js/data/src/setting-options/resolvers.ts
index dce25953b83..b74f17ff2c3 100644
--- a/packages/js/data/src/setting-options/resolvers.ts
+++ b/packages/js/data/src/setting-options/resolvers.ts
@@ -61,7 +61,7 @@ export const getSettings =
);
throw error;
} finally {
- dispatch.__unstableReleaseStoreLock( lock );
+ void dispatch.__unstableReleaseStoreLock( lock );
}
};
@@ -96,7 +96,7 @@ export const getSetting =
);
throw error;
} finally {
- dispatch.__unstableReleaseStoreLock( lock );
+ void dispatch.__unstableReleaseStoreLock( lock );
}
};
diff --git a/packages/js/data/src/settings/use-settings.ts b/packages/js/data/src/settings/use-settings.ts
index a2417097038..bd8cef51702 100644
--- a/packages/js/data/src/settings/use-settings.ts
+++ b/packages/js/data/src/settings/use-settings.ts
@@ -41,18 +41,18 @@ export const useSettings = ( group: string, settingsKeys: string[] = [] ) => {
} = useDispatch( store );
const updateSettings = useCallback(
( name: string, data: Settings ) => {
- updateSettingsForGroup( group, { [ name ]: data } );
+ void updateSettingsForGroup( group, { [ name ]: data } );
},
[ group ]
);
const persistSettings = useCallback( () => {
// this action would simply persist all settings marked as dirty in the
// store state and then remove the dirty record in the isDirtyMap
- persistSettingsForGroup( group );
+ void persistSettingsForGroup( group );
}, [ group ] );
const updateAndPersistSettings = useCallback(
( name: string, data: Settings ) => {
- updateAndPersistSettingsForGroup( group, { [ name ]: data } );
+ void updateAndPersistSettingsForGroup( group, { [ name ]: data } );
},
[ group ]
);
diff --git a/packages/js/data/src/settings/with-settings-hydration.tsx b/packages/js/data/src/settings/with-settings-hydration.tsx
index 882884693ef..43ca266f581 100644
--- a/packages/js/data/src/settings/with-settings-hydration.tsx
+++ b/packages/js/data/src/settings/with-settings-hydration.tsx
@@ -46,10 +46,10 @@ export const withSettingsHydration = ( group: string, settings: Settings ) =>
return;
}
if ( ! isResolvingGroup && ! hasFinishedResolutionGroup ) {
- startResolution( 'getSettings', [ group ] );
- updateSettingsForGroup( group, settingsRef.current );
- clearIsDirty( group );
- finishResolution( 'getSettings', [ group ] );
+ void startResolution( 'getSettings', [ group ] );
+ void updateSettingsForGroup( group, settingsRef.current );
+ void clearIsDirty( group );
+ void finishResolution( 'getSettings', [ group ] );
}
}, [
isResolvingGroup,
diff --git a/packages/js/data/src/user/with-current-user-hydration.tsx b/packages/js/data/src/user/with-current-user-hydration.tsx
index 51e0c987038..6d4a097505a 100644
--- a/packages/js/data/src/user/with-current-user-hydration.tsx
+++ b/packages/js/data/src/user/with-current-user-hydration.tsx
@@ -40,9 +40,9 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) =>
useDispatch( store );
if ( shouldHydrate ) {
- startResolution( 'getCurrentUser', [] );
- receiveCurrentUser( currentUser );
- finishResolution( 'getCurrentUser', [] );
+ void startResolution( 'getCurrentUser', [] );
+ void receiveCurrentUser( currentUser );
+ void finishResolution( 'getCurrentUser', [] );
}
return <OriginalComponent { ...props } />;
diff --git a/packages/js/email-editor/changelog/dev-eslint-no-floating-promises b/packages/js/email-editor/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/packages/js/email-editor/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/packages/js/email-editor/src/blocks/core/rich-text.tsx b/packages/js/email-editor/src/blocks/core/rich-text.tsx
index fcef6b4352b..e5799ec91e5 100644
--- a/packages/js/email-editor/src/blocks/core/rich-text.tsx
+++ b/packages/js/email-editor/src/blocks/core/rich-text.tsx
@@ -126,7 +126,7 @@ function PersonalizationTagsButton( { contentRef }: Props ) {
updatedContent = toHTMLString( { value: richTextValue } );
}
- updateBlockAttributes( selectedBlockId, {
+ void updateBlockAttributes( selectedBlockId, {
[ blockContentKey ]: updatedContent,
} );
},
@@ -160,7 +160,7 @@ function PersonalizationTagsButton( { contentRef }: Props ) {
`<!--[${ originalTag }]-->`,
`<!--[${ updatedTag }]-->`
);
- updateBlockAttributes( selectedBlockId, {
+ void updateBlockAttributes( selectedBlockId, {
[ blockContentKey ]: updatedContent,
} );
} }
@@ -184,7 +184,7 @@ function PersonalizationTagsButton( { contentRef }: Props ) {
return `<a${ beforeAttrs }data-link-href="${ newTag }"${ afterAttrs }>${ newText }</a>`;
}
);
- updateBlockAttributes( selectedBlockId, {
+ void updateBlockAttributes( selectedBlockId, {
content: updatedContent,
} );
} }
diff --git a/packages/js/email-editor/src/components/block-editor/editor.tsx b/packages/js/email-editor/src/components/block-editor/editor.tsx
index fbe3b28fbcf..a1f136454a1 100644
--- a/packages/js/email-editor/src/components/block-editor/editor.tsx
+++ b/packages/js/email-editor/src/components/block-editor/editor.tsx
@@ -124,7 +124,7 @@ export function InnerEditor( {
const { removeEditorPanel } = useDispatch( editorStore );
useEffect( () => {
- removeEditorPanel( 'post-status' );
+ void removeEditorPanel( 'post-status' );
}, [ removeEditorPanel ] );
const [ styles ] = useEmailCss();
diff --git a/packages/js/email-editor/src/components/header/trash-email-post.tsx b/packages/js/email-editor/src/components/header/trash-email-post.tsx
index 4ab6cd59291..0d4b87ca127 100644
--- a/packages/js/email-editor/src/components/header/trash-email-post.tsx
+++ b/packages/js/email-editor/src/components/header/trash-email-post.tsx
@@ -214,7 +214,7 @@ const getTrashEmailPostAction = () => {
items.length
);
}
- createSuccessNotice( successMessage, {
+ void createSuccessNotice( successMessage, {
type: 'snackbar',
id: 'trash-email-post-action',
} );
@@ -289,7 +289,7 @@ const getTrashEmailPostAction = () => {
errorMessage,
}
);
- createErrorNotice( errorMessage, {
+ void createErrorNotice( errorMessage, {
type: 'snackbar',
} );
}
diff --git a/packages/js/email-editor/src/components/personalization-tags/category-section.tsx b/packages/js/email-editor/src/components/personalization-tags/category-section.tsx
index c8bc23144fb..86ee582694d 100644
--- a/packages/js/email-editor/src/components/personalization-tags/category-section.tsx
+++ b/packages/js/email-editor/src/components/personalization-tags/category-section.tsx
@@ -90,7 +90,7 @@ const CategorySection = ( {
<Button
variant="link"
onClick={ () => {
- updateBlockAttributes(
+ void updateBlockAttributes(
selectedBlockId,
{
url: item.valueToInsert,
diff --git a/packages/js/email-editor/src/components/preview/preview-save-guard.ts b/packages/js/email-editor/src/components/preview/preview-save-guard.ts
index 89e021f2362..695df0ba27e 100644
--- a/packages/js/email-editor/src/components/preview/preview-save-guard.ts
+++ b/packages/js/email-editor/src/components/preview/preview-save-guard.ts
@@ -45,7 +45,7 @@ export const PreviewSaveGuard = () => {
event.stopPropagation();
event.stopImmediatePropagation();
- dispatch( noticesStore ).createNotice(
+ void dispatch( noticesStore ).createNotice(
'warning',
__(
'You have unsaved changes. Please save the post before previewing.',
@@ -71,7 +71,7 @@ export const PreviewSaveGuard = () => {
( event.key === 'Enter' || event.key === ' ' ) &&
target?.closest( selector )
) {
- guard( event );
+ void guard( event );
}
} catch ( error ) {
// eslint-disable-next-line no-console
diff --git a/packages/js/email-editor/src/components/preview/send-preview.tsx b/packages/js/email-editor/src/components/preview/send-preview.tsx
index 294e8daa646..bacbcf77056 100644
--- a/packages/js/email-editor/src/components/preview/send-preview.tsx
+++ b/packages/js/email-editor/src/components/preview/send-preview.tsx
@@ -24,7 +24,7 @@ export function SendPreview() {
recordEvent(
'header_preview_dropdown_send_test_email_selected'
);
- togglePreviewModal( true );
+ void togglePreviewModal( true );
} }
>
{ __( 'Send a test email', __i18n_text_domain__ ) }
diff --git a/packages/js/email-editor/src/components/sidebar/reset-email-template.tsx b/packages/js/email-editor/src/components/sidebar/reset-email-template.tsx
index 214b68fe553..e0caa5b9221 100644
--- a/packages/js/email-editor/src/components/sidebar/reset-email-template.tsx
+++ b/packages/js/email-editor/src/components/sidebar/reset-email-template.tsx
@@ -126,7 +126,7 @@ const getResetEmailTemplateAction = () => {
);
// Apply the reset with original blocks
- editEntityRecord(
+ void editEntityRecord(
'postType',
item.type,
item.id,
@@ -153,11 +153,10 @@ const getResetEmailTemplateAction = () => {
} );
// Invalidate to ensure editor and actions menu see the file version
- invalidateResolution( 'getEntityRecord', [
- 'postType',
- item.type,
- item.id,
- ] );
+ void invalidateResolution(
+ 'getEntityRecord',
+ [ 'postType', item.type, item.id ]
+ );
const successMessage = sprintf(
/* translators: The template's title. */
@@ -168,7 +167,7 @@ const getResetEmailTemplateAction = () => {
getItemTitle( item )
);
- createSuccessNotice( successMessage, {
+ void createSuccessNotice( successMessage, {
type: 'snackbar',
id: 'reset-email-template-action',
} );
@@ -195,7 +194,7 @@ const getResetEmailTemplateAction = () => {
errorMessage,
} );
- createErrorNotice( errorMessage, {
+ void createErrorNotice( errorMessage, {
type: 'snackbar',
} );
diff --git a/packages/js/email-editor/src/editor.tsx b/packages/js/email-editor/src/editor.tsx
index b6ace3a7663..fb5dcc9b93b 100644
--- a/packages/js/email-editor/src/editor.tsx
+++ b/packages/js/email-editor/src/editor.tsx
@@ -66,7 +66,7 @@ function Editor( {
const { setEmailPost } = useDispatch( storeName );
useEffect( () => {
- setEmailPost( postId, postType );
+ void setEmailPost( postId, postType );
setIsInitialized( true );
}, [ postId, postType, setEmailPost ] );
@@ -161,7 +161,7 @@ export function initialize( elementId: string ) {
// Set configuration to store from window object for backward compatibility
const editorConfig = getEditorConfigFromWindow();
- dispatch( storeName ).setEditorConfig( editorConfig );
+ void dispatch( storeName ).setEditorConfig( editorConfig );
const root = createRoot( container );
root.render(
@@ -195,14 +195,14 @@ export function ExperimentalEmailEditor( {
const editorConfig = config || getEditorConfigFromWindow();
onInit();
- dispatch( storeName ).setEditorConfig( editorConfig );
+ void dispatch( storeName ).setEditorConfig( editorConfig );
setIsInitialized( true );
// Cleanup global editor settings
return () => {
try {
cleanupConfigurationChanges();
} finally {
- dispatch( editorStore ).updateEditorSettings(
+ void dispatch( editorStore ).updateEditorSettings(
backupEditorSettings
);
}
diff --git a/packages/js/email-editor/src/hooks/use-content-validation.ts b/packages/js/email-editor/src/hooks/use-content-validation.ts
index 16af6cd749b..a2326ff1e48 100644
--- a/packages/js/email-editor/src/hooks/use-content-validation.ts
+++ b/packages/js/email-editor/src/hooks/use-content-validation.ts
@@ -91,12 +91,12 @@ export const useContentValidation = (): ContentValidationData => {
// Register the validation function with the store
useEffect( () => {
- dispatch( emailEditorStore ).setContentValidation( {
+ void dispatch( emailEditorStore ).setContentValidation( {
validateContent,
} );
return () => {
- dispatch( emailEditorStore ).setContentValidation( undefined );
+ void dispatch( emailEditorStore ).setContentValidation( undefined );
};
}, [ validateContent ] );
diff --git a/packages/js/email-editor/src/hooks/use-remove-saving-failed-notices.ts b/packages/js/email-editor/src/hooks/use-remove-saving-failed-notices.ts
index ee8c11e0594..0db73556b84 100644
--- a/packages/js/email-editor/src/hooks/use-remove-saving-failed-notices.ts
+++ b/packages/js/email-editor/src/hooks/use-remove-saving-failed-notices.ts
@@ -30,7 +30,7 @@ export const useRemoveSavingFailedNotices = () => {
typeof notice.content === 'string' &&
savingFailedRegex.test( notice.content )
) {
- dispatch( noticesStore ).removeNotice( notice.id );
+ void dispatch( noticesStore ).removeNotice( notice.id );
}
} );
} );
diff --git a/packages/js/email-editor/src/store/store.ts b/packages/js/email-editor/src/store/store.ts
index 9390cb58239..2ce52aa9e6e 100644
--- a/packages/js/email-editor/src/store/store.ts
+++ b/packages/js/email-editor/src/store/store.ts
@@ -42,7 +42,7 @@ export const createStore = () => {
register( store );
// Register personalization tag entity with core-data
- dispatch( coreStore ).addEntities( [ PERSONALIZATION_TAG_ENTITY ] );
+ void dispatch( coreStore ).addEntities( [ PERSONALIZATION_TAG_ENTITY ] );
return store;
};
diff --git a/packages/js/internal-build/src/composer/index.ts b/packages/js/internal-build/src/composer/index.ts
index 983622c7209..37ee3a7887e 100644
--- a/packages/js/internal-build/src/composer/index.ts
+++ b/packages/js/internal-build/src/composer/index.ts
@@ -364,7 +364,7 @@ export async function watchComposerPackages(
// Consuming project's composer.json is its own path; not in any pkg.
if ( absPath === composerJsonPath ) {
if ( event === 'change' || event === 'add' )
- onComposerJsonChange();
+ void onComposerJsonChange();
return;
}
@@ -379,7 +379,7 @@ export async function watchComposerPackages(
absPath === path.join( pkg.sourceDir, 'composer.json' )
) {
await mirror( absPath, pkg ).catch( () => undefined );
- onComposerJsonChange();
+ void onComposerJsonChange();
return;
}
diff --git a/packages/js/onboarding/changelog/dev-eslint-no-floating-promises b/packages/js/onboarding/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/packages/js/onboarding/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/packages/js/onboarding/src/components/WooOnboardingTask/WooOnboardingTask.tsx b/packages/js/onboarding/src/components/WooOnboardingTask/WooOnboardingTask.tsx
index 8c3d660c65e..e01d90e857b 100644
--- a/packages/js/onboarding/src/components/WooOnboardingTask/WooOnboardingTask.tsx
+++ b/packages/js/onboarding/src/components/WooOnboardingTask/WooOnboardingTask.tsx
@@ -63,7 +63,7 @@ WooOnboardingTask.Slot = ( { id, fillProps }: WooOnboardingTaskSlotProps ) => {
// The Slot is a React component and this hook works as expected.
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect( () => {
- trackView( id );
+ void trackView( id );
}, [ id ] );
return (
diff --git a/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises b/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/plugins/woocommerce-beta-tester/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/plugins/woocommerce-beta-tester/src/live-branches/hooks/live-branches.tsx b/plugins/woocommerce-beta-tester/src/live-branches/hooks/live-branches.tsx
index 5309d15b837..46ea6d7553c 100644
--- a/plugins/woocommerce-beta-tester/src/live-branches/hooks/live-branches.tsx
+++ b/plugins/woocommerce-beta-tester/src/live-branches/hooks/live-branches.tsx
@@ -53,7 +53,7 @@ export const useLiveBranchesData = () => {
}
};
- getBranches();
+ void getBranches();
}, [] );
return { branches, isLoading: loading, isError };
diff --git a/plugins/woocommerce-beta-tester/src/remote-logging/index.tsx b/plugins/woocommerce-beta-tester/src/remote-logging/index.tsx
index 772be0dea3a..c5742220aba 100644
--- a/plugins/woocommerce-beta-tester/src/remote-logging/index.tsx
+++ b/plugins/woocommerce-beta-tester/src/remote-logging/index.tsx
@@ -51,7 +51,7 @@ function RemoteLogging() {
}
};
- fetchRemoteLoggingStatus();
+ void fetchRemoteLoggingStatus();
}, [] );
const toggleRemoteLogging = async () => {
diff --git a/plugins/woocommerce-beta-tester/src/remote-logging/register-exception-filter.tsx b/plugins/woocommerce-beta-tester/src/remote-logging/register-exception-filter.tsx
index 485c17eef90..9409cbb17e6 100644
--- a/plugins/woocommerce-beta-tester/src/remote-logging/register-exception-filter.tsx
+++ b/plugins/woocommerce-beta-tester/src/remote-logging/register-exception-filter.tsx
@@ -55,7 +55,7 @@ const deleteSimulateErrorOption = async () => {
*/
const addCoreExceptionFilter = () => {
addFilter( 'woocommerce_admin_pages_list', 'wc-beta-tester', () => {
- deleteSimulateErrorOption();
+ void deleteSimulateErrorOption();
throw new Error(
'Test JS exception in WC Core context via WC Beta Tester'
@@ -84,7 +84,7 @@ export const registerExceptionFilter = async () => {
if ( context === 'core' ) {
addCoreExceptionFilter();
} else {
- deleteSimulateErrorOption();
+ void deleteSimulateErrorOption();
throwBetaTesterException();
}
};
diff --git a/plugins/woocommerce/changelog/dev-eslint-no-floating-promises b/plugins/woocommerce/changelog/dev-eslint-no-floating-promises
new file mode 100644
index 00000000000..e1986b60836
--- /dev/null
+++ b/plugins/woocommerce/changelog/dev-eslint-no-floating-promises
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add void to intentionally-unawaited promises for the new no-floating-promises lint rule
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/use-import-status.ts b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/use-import-status.ts
index 3cc131ee3bc..dfd6383fda3 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/use-import-status.ts
+++ b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/use-import-status.ts
@@ -84,7 +84,7 @@ export function useImportStatus(): UseImportStatusReturn {
* Initial fetch on mount
*/
useEffect( () => {
- fetchStatus();
+ void fetchStatus();
}, [ fetchStatus ] );
/**
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/index.tsx b/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/index.tsx
index 0248658b266..42b2db3cab7 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/index.tsx
+++ b/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/index.tsx
@@ -33,7 +33,7 @@ export default function ScheduledUpdatesPromotionNotice() {
}
const onDismiss = () => {
- updateUserPreferences( {
+ void updateUserPreferences( {
scheduled_updates_promotion_notice_dismissed: 'yes',
} );
recordEvent( 'scheduled_updates_promotion_notice_dismissed' );
diff --git a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/failed-orders-notice.tsx b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/failed-orders-notice.tsx
index 0a442b33b0f..b445290949c 100644
--- a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/failed-orders-notice.tsx
+++ b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/failed-orders-notice.tsx
@@ -76,7 +76,7 @@ function FailedOrdersNotice() {
}, [] );
useEffect( () => {
- fetchStatus();
+ void fetchStatus();
}, [ fetchStatus ] );
const failedCount = status?.failed_count ?? 0;
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
index 525b949b9fc..3dfcf425885 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
@@ -409,7 +409,7 @@ const updateTrackingOption = fromPromise(
} );
const trackingValue = input.optInDataSharing ? 'yes' : 'no';
- dispatch( settingOptionsStore ).saveSetting(
+ void dispatch( settingOptionsStore ).saveSetting(
'advanced',
'woocommerce_allow_tracking',
trackingValue
@@ -543,7 +543,7 @@ const preFetchGetPlugins = fromPromise( async () =>
);
const getPlugins = fromPromise( async () => {
- dispatch( onboardingStore ).invalidateResolutionForStoreSelector(
+ void dispatch( onboardingStore ).invalidateResolutionForStoreSelector(
'getFreeExtensions'
);
const extensionsBundles =
@@ -586,7 +586,7 @@ const updateQueryStep = ( _: unknown, params: { step: CoreProfilerStep } ) => {
const updateProfilerCompletedSteps = fromPromise(
async ( { input }: { input: { step: CoreProfilerStep } } ) => {
- dispatch( onboardingStore ).updateCoreProfilerStep( input.step );
+ void dispatch( onboardingStore ).updateCoreProfilerStep( input.step );
}
);
@@ -1462,11 +1462,13 @@ export const coreProfilerStateMachineDefinition = createMachine( {
} ),
invoke: {
src: fromPromise( () => {
- dispatch( onboardingStore ).updateProfileItems( {
- is_plugins_page_skipped: true,
- skipped: false,
- completed: true,
- } );
+ void dispatch( onboardingStore ).updateProfileItems(
+ {
+ is_plugins_page_skipped: true,
+ skipped: false,
+ completed: true,
+ }
+ );
return promiseDelay( 3000 );
} ),
onDone: [ { actions: [ 'redirectToWooHome' ] } ],
diff --git a/plugins/woocommerce/client/admin/client/customize-store/index.tsx b/plugins/woocommerce/client/admin/client/customize-store/index.tsx
index 3c6c7c0945d..f5097a35500 100644
--- a/plugins/woocommerce/client/admin/client/customize-store/index.tsx
+++ b/plugins/woocommerce/client/admin/client/customize-store/index.tsx
@@ -89,7 +89,7 @@ const CustomizeStoreController = () => {
) => {
if ( isNewTabClick( event ) ) {
// New tab: page stays open, so fire-and-forget is safe
- markTaskComplete();
+ void markTaskComplete();
return;
}
diff --git a/plugins/woocommerce/client/admin/client/error-boundary/index.tsx b/plugins/woocommerce/client/admin/client/error-boundary/index.tsx
index addf2b73fa2..f8a781e5bbd 100644
--- a/plugins/woocommerce/client/admin/client/error-boundary/index.tsx
+++ b/plugins/woocommerce/client/admin/client/error-boundary/index.tsx
@@ -48,7 +48,7 @@ export class ErrorBoundary extends Component<
.slice( 0, 10 )
.map( ( line ) => line.trim() );
- captureException( error, {
+ void captureException( error, {
severity: 'critical',
extra: {
componentStack,
diff --git a/plugins/woocommerce/client/admin/client/guided-tours/report-date-tour.tsx b/plugins/woocommerce/client/admin/client/guided-tours/report-date-tour.tsx
index 71bf603c09d..0f7bf6fc5e9 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/report-date-tour.tsx
+++ b/plugins/woocommerce/client/admin/client/guided-tours/report-date-tour.tsx
@@ -96,7 +96,7 @@ export const ReportDateTour = ( {
},
],
closeHandler: () => {
- updateOptions( {
+ void updateOptions( {
[ optionName ]: 'yes',
} );
setIsDismissed( true );
diff --git a/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx b/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx
index 95df22163c1..a4caafc7cdf 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx
+++ b/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx
@@ -326,7 +326,7 @@ export const ShippingTour = ( {
}
);
// Fire-and-forget retry — failure only means the tour replays next visit.
- updateOptions( {
+ void updateOptions( {
[ REVIEWED_DEFAULTS_OPTION ]: 'yes',
} );
}
diff --git a/plugins/woocommerce/client/admin/client/guided-tours/variable-product-tour/index.tsx b/plugins/woocommerce/client/admin/client/guided-tours/variable-product-tour/index.tsx
index 6ed69be7aff..ea4fcd42707 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/variable-product-tour/index.tsx
+++ b/plugins/woocommerce/client/admin/client/guided-tours/variable-product-tour/index.tsx
@@ -63,7 +63,9 @@ export const VariableProductTour = () => {
},
},
closeHandler: ( steps, currentStepIndex ) => {
- updateUserPreferences( { variable_product_tour_shown: 'yes' } );
+ void updateUserPreferences( {
+ variable_product_tour_shown: 'yes',
+ } );
setIsTourOpen( false );
if ( currentStepIndex === steps.length - 1 ) {
diff --git a/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/get-config.ts b/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/get-config.ts
index 00d154a182b..0cc21ab19e0 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/get-config.ts
+++ b/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/get-config.ts
@@ -68,7 +68,7 @@ export const getTourConfig = ( {
? 'right'
: defaultPlacement;
if ( state.placement !== desiredPlacement ) {
- instance.setOptions( {
+ void instance.setOptions( {
placement: desiredPlacement,
} );
}
diff --git a/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/index.tsx b/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/index.tsx
index 55e9eaa64ba..d58411558ca 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/index.tsx
+++ b/plugins/woocommerce/client/admin/client/guided-tours/wc-addons-tour/index.tsx
@@ -83,7 +83,7 @@ const WCAddonsTour = () => {
) => {
setShowTour( false );
// mark tour as completed
- updateOptions( {
+ void updateOptions( {
woocommerce_admin_dismissed_in_app_marketplace_tour: 'yes',
} );
// remove `tutorial` from search query, so it's not shown on page refresh
diff --git a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRDirectLoginCode.tsx b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRDirectLoginCode.tsx
index b38d7b185ef..58166668671 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRDirectLoginCode.tsx
+++ b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRDirectLoginCode.tsx
@@ -101,7 +101,7 @@ export const QRDirectLoginCode = ( {
if ( availability.isLoading || ! availability.available ) {
return;
}
- fetchToken();
+ void fetchToken();
}, [ availability.isLoading, availability.available, fetchToken ] );
// Bubble the consumed snapshot up to the parent so it can advance its
@@ -132,7 +132,7 @@ export const QRDirectLoginCode = ( {
variant="secondary"
onClick={ () => {
recordEvent( eventName );
- refreshToken();
+ void refreshToken();
} }
>
{ buttonLabel }
@@ -194,7 +194,7 @@ export const QRDirectLoginCode = ( {
recordEvent(
'mobile_app_qr_direct_login_refreshed'
);
- refreshToken();
+ void refreshToken();
} }
>
{ __( 'Try again', 'woocommerce' ) }
@@ -214,7 +214,7 @@ export const QRDirectLoginCode = ( {
variant="secondary"
onClick={ () => {
recordEvent( 'mobile_app_qr_direct_login_refreshed' );
- refreshToken();
+ void refreshToken();
} }
>
{ __( 'Generate new code', 'woocommerce' ) }
@@ -281,7 +281,7 @@ export const QRDirectLoginCode = ( {
variant="secondary"
onClick={ () => {
recordEvent( 'mobile_app_qr_direct_login_refreshed' );
- refreshToken();
+ void refreshToken();
} }
>
{ __( 'Start over', 'woocommerce' ) }
@@ -340,7 +340,7 @@ export const QRDirectLoginCode = ( {
className="woocommerce-qr-direct-login__renew"
onClick={ () => {
recordEvent( 'mobile_app_qr_direct_login_renewed' );
- refreshToken();
+ void refreshToken();
} }
>
{ __( 'Renew code', 'woocommerce' ) }
diff --git a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRLoginNumberMatchStep.tsx b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRLoginNumberMatchStep.tsx
index f9013fa9e61..a80fc2d71ae 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRLoginNumberMatchStep.tsx
+++ b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/QRLoginNumberMatchStep.tsx
@@ -215,7 +215,7 @@ export const QRLoginNumberMatchStep = ( {
);
// Empty string is treated by the server as a non-matching
// pick — same one-strike rejection path as a wrong tap.
- handleChoose( '' );
+ void handleChoose( '' );
} }
>
{ inFlight && pendingChoice === '' ? (
diff --git a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx
index fe2b63a5e00..cafc0fff9f0 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx
+++ b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useJetpackPluginState.tsx
@@ -63,7 +63,7 @@ export const useJetpackPluginState = () => {
*/
const onClickInstall = useCallback( () => {
const thisUrl = window.location.href;
- installJetpackAndConnect(
+ void installJetpackAndConnect(
createErrorNotice,
() => thisUrl + '&jetpackState=returning'
);
diff --git a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useQRLoginToken.tsx b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useQRLoginToken.tsx
index 392e78f0b95..926f388d1cf 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useQRLoginToken.tsx
+++ b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/components/useQRLoginToken.tsx
@@ -316,7 +316,7 @@ export const useQRLoginToken = ( {
clearPollTimer();
// First tick fires immediately so a fast-scanning merchant gets the
// confirmation panel without waiting a full interval.
- pollStatus();
+ void pollStatus();
pollTimerRef.current = setInterval(
pollStatus,
STATUS_POLL_INTERVAL_MS
diff --git a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/index.tsx b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/index.tsx
index 0199fb7ff93..68e45f3ac50 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/index.tsx
+++ b/plugins/woocommerce/client/admin/client/homescreen/mobile-app-modal/index.tsx
@@ -134,7 +134,7 @@ export const MobileAppModal = () => {
}, [ searchParams ] );
const onFinish = () => {
- updateOptions( {
+ void updateOptions( {
woocommerce_admin_dismissed_mobile_app_modal: 'yes',
} ).then( () =>
invalidateResolutionForStoreSelector( 'getTaskLists' )
diff --git a/plugins/woocommerce/client/admin/client/hooks/use-option-dismiss.ts b/plugins/woocommerce/client/admin/client/hooks/use-option-dismiss.ts
index b8e56592de2..0f92aa40bbe 100644
--- a/plugins/woocommerce/client/admin/client/hooks/use-option-dismiss.ts
+++ b/plugins/woocommerce/client/admin/client/hooks/use-option-dismiss.ts
@@ -49,7 +49,7 @@ export const useOptionDismiss = ( optionName: string ): DismissState => {
const { updateOptions } = useDispatch( optionsStore );
const onDismiss = () => {
- updateOptions( { [ optionName ]: 'yes' } );
+ void updateOptions( { [ optionName ]: 'yes' } );
};
return { isDismissed, hasResolved, onDismiss };
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/index.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/index.tsx
index ed31e73b73b..29e6cbb4ec3 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/index.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/index.tsx
@@ -104,8 +104,8 @@ const LaunchStoreController = () => {
// Invalidate the task lists to ensure they are refreshed
// when the user returns to the main flow.
- invalidateResolutionForStoreSelector( 'getTaskLists' );
- invalidateResolutionForStoreSelector( 'getTaskListsByIds' );
+ void invalidateResolutionForStoreSelector( 'getTaskLists' );
+ void invalidateResolutionForStoreSelector( 'getTaskListsByIds' );
// Navigate back to the main flow
sendToSidebar( { type: 'RETURN_FROM_PAYMENTS' } );
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/payments-content.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/payments-content.tsx
index e93175ae139..234892bdb8a 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/payments-content.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/payments-content.tsx
@@ -149,7 +149,7 @@ const InstallWooPaymentsStep = ( {
wooPaymentsProvider?.onboarding?._links?.preload?.href
) {
// We don't need to await this call or handle its response.
- apiFetch( {
+ void apiFetch( {
url: wooPaymentsProvider?.onboarding?._links
?.preload?.href,
method: 'POST',
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/xstate.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/xstate.tsx
index 7d82068755e..fc4883ed8b9 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/xstate.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/xstate.tsx
@@ -101,7 +101,7 @@ export const mainContentMachine = setup( {
navigateToHome: () => {
const { invalidateResolutionForStoreSelector } =
dispatch( onboardingStore );
- invalidateResolutionForStoreSelector( 'getTaskLists' );
+ void invalidateResolutionForStoreSelector( 'getTaskLists' );
navigateTo( { url: '/' } );
},
},
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/payments-sidebar.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/payments-sidebar.tsx
index 0538e4e70c5..7fba53aa648 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/payments-sidebar.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/payments-sidebar.tsx
@@ -73,7 +73,7 @@ export const PaymentsSidebar = ( props: SidebarComponentProps ) => {
}
};
- fetchPaymentsTask();
+ void fetchPaymentsTask();
// Cleanup function to prevent state updates after unmount.
return () => {
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/tour/use-site-visibility-tour.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/tour/use-site-visibility-tour.tsx
index cbd19d3f46d..a177fca11b8 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/tour/use-site-visibility-tour.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/tour/use-site-visibility-tour.tsx
@@ -40,7 +40,7 @@ export const useSiteVisibilityTour = () => {
} = useUserPreferences();
const onClose = () => {
- updateUserPreferences( {
+ void updateUserPreferences( {
launch_your_store_tour_hidden: 'yes',
} );
};
diff --git a/plugins/woocommerce/client/admin/client/marketing/hooks/useCampaignTypes.ts b/plugins/woocommerce/client/admin/client/marketing/hooks/useCampaignTypes.ts
index e20a4056d00..ff2b3325ff1 100644
--- a/plugins/woocommerce/client/admin/client/marketing/hooks/useCampaignTypes.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/hooks/useCampaignTypes.ts
@@ -37,7 +37,7 @@ export const useCampaignTypes = (): UseCampaignTypes => {
const { invalidateResolution } = useDispatch( STORE_KEY );
const refetch = useCallback( () => {
- invalidateResolution( 'getCampaignTypes', [] );
+ void invalidateResolution( 'getCampaignTypes', [] );
}, [ invalidateResolution ] );
return useSelect(
diff --git a/plugins/woocommerce/client/admin/client/marketing/hooks/useIntroductionBanner.ts b/plugins/woocommerce/client/admin/client/marketing/hooks/useIntroductionBanner.ts
index 1c686bab367..7e363b61cc2 100644
--- a/plugins/woocommerce/client/admin/client/marketing/hooks/useIntroductionBanner.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/hooks/useIntroductionBanner.ts
@@ -19,7 +19,7 @@ export const useIntroductionBanner = (): UseIntroductionBanner => {
const { updateOptions } = useDispatch( optionsStore );
const dismissIntroductionBanner = () => {
- updateOptions( {
+ void updateOptions( {
[ OPTION_NAME_BANNER_DISMISSED ]: OPTION_VALUE_YES,
} );
recordEvent( 'marketing_multichannel_banner_dismissed', {} );
diff --git a/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts b/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
index f636c202c61..766fa112c37 100644
--- a/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
@@ -62,7 +62,7 @@ export const useRegisteredChannels = (): UseRegisteredChannels => {
const { invalidateResolution } = useDispatch( STORE_KEY );
const refetch = useCallback( () => {
- invalidateResolution( 'getRegisteredChannels', [] );
+ void invalidateResolution( 'getRegisteredChannels', [] );
}, [ invalidateResolution ] );
return useSelect(
diff --git a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/PluginsTabPanel.tsx b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/PluginsTabPanel.tsx
index ae562705cc3..803d8c15124 100644
--- a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/PluginsTabPanel.tsx
+++ b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/PluginsTabPanel.tsx
@@ -116,7 +116,7 @@ export const PluginsTabPanel = ( {
isBusy={ currentPlugin === plugin.product }
disabled={ buttonDisabled }
onClick={ () => {
- installAndActivate( plugin );
+ void installAndActivate( plugin );
} }
>
{ __( 'Install extension', 'woocommerce' ) }
diff --git a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/useRecommendedPluginsWithoutChannels.ts b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/useRecommendedPluginsWithoutChannels.ts
index cbe50b20e8e..2d76c12cad0 100644
--- a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/useRecommendedPluginsWithoutChannels.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/DiscoverTools/useRecommendedPluginsWithoutChannels.ts
@@ -79,8 +79,8 @@ export const useRecommendedPluginsWithoutChannels =
);
const installAndActivate = ( slug: string ) => {
- installAndActivateRecommendedPlugin( slug, category );
- invalidateResolution( selector, [ category ] );
+ void installAndActivateRecommendedPlugin( slug, category );
+ void invalidateResolution( selector, [ category ] );
};
return {
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/discover/discover.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/discover/discover.tsx
index 4650f01b44d..f0222e22d58 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/discover/discover.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/discover/discover.tsx
@@ -62,7 +62,7 @@ export default function Discover(): React.JSX.Element | null {
useEffect( () => {
setIsLoading( true );
- fetchDiscoverPageData()
+ void fetchDiscoverPageData()
.then(
( response: Array< ProductGroup > | { success: boolean } ) => {
if ( ! Array.isArray( response ) ) {
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/install-new-product-modal.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/install-new-product-modal.tsx
index c644d42253e..ce9c54eb3de 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/install-new-product-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/install-new-product-modal.tsx
@@ -162,7 +162,7 @@ function InstallNewProductModal( props: { products: Product[] } ) {
throw response;
}
- dispatch( installingStore ).startInstalling(
+ void dispatch( installingStore ).startInstalling(
String( product.id ?? '' )
);
setDocumentationUrl( response.data.documentation_url );
@@ -175,7 +175,7 @@ function InstallNewProductModal( props: { products: Product[] } ) {
response.data.product_type,
response.data.zip_slug
).then( ( downloadResponse ) => {
- dispatch( installingStore ).stopInstalling(
+ void dispatch( installingStore ).stopInstalling(
String( product.id ?? '' )
);
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/my-subscriptions.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/my-subscriptions.tsx
index 8527a765ffc..cd7bec97058 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/my-subscriptions.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/my-subscriptions.tsx
@@ -66,7 +66,7 @@ export default function MySubscriptions(): React.JSX.Element {
notice_id: 'woo-connect-notice',
dismiss_notice_nonce: wccomSettings?.dismissNoticeNonce || '',
};
- apiFetch( {
+ void apiFetch( {
path: `/wc-admin/notice/dismiss`,
method: 'POST',
data,
@@ -88,7 +88,7 @@ export default function MySubscriptions(): React.JSX.Element {
notice_id: 'woo-disconnect-notice',
dismiss_notice_nonce: wccomSettings?.dismissNoticeNonce || '',
};
- apiFetch( {
+ void apiFetch( {
path: `/wc-admin/notice/dismiss`,
method: 'POST',
data,
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/subscriptions-expired-expiring-notice.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/subscriptions-expired-expiring-notice.tsx
index 0b68fb4e381..42f7c97cb18 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/subscriptions-expired-expiring-notice.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/subscriptions-expired-expiring-notice.tsx
@@ -71,7 +71,7 @@ export default function SubscriptionsExpiredExpiringNotice(
const handleClose = () => {
recordEvent( eventKeys[ notice_id ].dismissed );
const data = { notice_id, dismiss_notice_nonce };
- apiFetch( {
+ void apiFetch( {
path: `/wc-admin/notice/dismiss`,
method: 'POST',
data,
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install.tsx
index 7e24b355eb6..80298cbe2c1 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install.tsx
@@ -44,19 +44,19 @@ export default function Install( props: InstallProps ) {
);
const startInstall = () => {
- dispatch( installingStore ).startInstalling(
+ void dispatch( installingStore ).startInstalling(
props.subscription.product_key
);
};
const stopInstall = () => {
- dispatch( installingStore ).stopInstalling(
+ void dispatch( installingStore ).stopInstalling(
props.subscription.product_key
);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleInstallError = ( error: any ) => {
- loadSubscriptions( false ).then( () => {
+ void loadSubscriptions( false ).then( () => {
let errorMessage = sprintf(
// translators: %s is the product name.
__( '%s couldn’t be installed.', 'woocommerce' ),
@@ -110,7 +110,7 @@ export default function Install( props: InstallProps ) {
if ( props.subscription.is_installable ) {
installProduct( props.subscription )
.then( () => {
- loadSubscriptions( false ).then( () => {
+ void loadSubscriptions( false ).then( () => {
addNotice(
props.subscription.product_key,
sprintf(
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/update.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/update.tsx
index 1a957a049c4..72662dadd15 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/update.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/update.tsx
@@ -83,7 +83,7 @@ export default function Update( props: UpdateProps ) {
updateProduct( props.subscription )
.then( () => {
- loadSubscriptions( false ).then( () => {
+ void loadSubscriptions( false ).then( () => {
addNotice(
props.subscription.product_key,
sprintf(
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/product-preview-modal/product-preview-modal.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/product-preview-modal/product-preview-modal.tsx
index fd547b497d9..e24fc2c5128 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/product-preview-modal/product-preview-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/product-preview-modal/product-preview-modal.tsx
@@ -119,7 +119,7 @@ export default function ProductPreviewModal( {
}
};
- loadPreview();
+ void loadPreview();
if ( onOpen ) {
onOpen();
}
diff --git a/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx b/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
index b765cb8eb3a..df7ddd8ce2c 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
@@ -452,7 +452,7 @@ function addNotice(
options?: Partial< NoticeOptions >
) {
if ( status === NoticeStatus.Error ) {
- dispatch( noticeStore ).addNotice(
+ void dispatch( noticeStore ).addNotice(
productKey,
message,
status,
@@ -466,12 +466,15 @@ function addNotice(
};
}
- dispatch( coreNoticesStore ).createSuccessNotice( message, options );
+ void dispatch( coreNoticesStore ).createSuccessNotice(
+ message,
+ options
+ );
}
}
const removeNotice = ( productKey: string ) => {
- dispatch( noticeStore ).removeNotice( productKey );
+ void dispatch( noticeStore ).removeNotice( productKey );
};
const subscriptionToProduct = ( subscription: Subscription ): Product => {
diff --git a/plugins/woocommerce/client/admin/client/payments-welcome/exit-survey-modal.tsx b/plugins/woocommerce/client/admin/client/payments-welcome/exit-survey-modal.tsx
index ae6edb2026c..c6dd9101892 100644
--- a/plugins/woocommerce/client/admin/client/payments-welcome/exit-survey-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/payments-welcome/exit-survey-modal.tsx
@@ -67,7 +67,7 @@ function ExitSurveyModal( {}: {
incentive_id: incentive.id,
} );
- closeModal();
+ void closeModal();
};
const sendFeedback = () => {
@@ -83,12 +83,12 @@ function ExitSurveyModal( {}: {
if ( isMoreInfoChecked ) {
// Record that the user would possibly consider installing WCPay with more information in the future.
- updateOptions( {
+ void updateOptions( {
wcpay_welcome_page_exit_survey_more_info_needed_timestamp:
Math.floor( Date.now() / 1000 ),
} );
}
- closeModal();
+ void closeModal();
};
if ( ! isOpen ) {
diff --git a/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx b/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
index bad8d5f7294..8a1ee30c53e 100644
--- a/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
+++ b/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
@@ -72,7 +72,7 @@ const ConnectAccountPage = () => {
incentive_id: incentive.id,
source: determineTrackingSource(),
} );
- updateOptions( {
+ void updateOptions( {
wcpay_welcome_page_viewed_timestamp: Math.floor(
Date.now() / 1000
),
diff --git a/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-listview.tsx b/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-listview.tsx
index 6ae858544df..ce687efe3ba 100644
--- a/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-listview.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-listview.tsx
@@ -235,7 +235,7 @@ export const ListView = ( { emailTypes }: { emailTypes: EmailType[] } ) => {
isEligible: ( item: EmailType ) =>
item.status === 'enabled' || item.status === 'disabled',
callback: ( items: EmailType[] ) => {
- updateEmailEnabledStatus(
+ void updateEmailEnabledStatus(
items[ 0 ].id,
! items[ 0 ].enabled
);
diff --git a/plugins/woocommerce/client/admin/client/settings-email/settings-email-preview-header.tsx b/plugins/woocommerce/client/admin/client/settings-email/settings-email-preview-header.tsx
index 564eab4406e..43daac21199 100644
--- a/plugins/woocommerce/client/admin/client/settings-email/settings-email-preview-header.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-email/settings-email-preview-header.tsx
@@ -85,7 +85,7 @@ export const EmailPreviewHeader = ( {
}, [] );
useEffect( () => {
- fetchSubject();
+ void fetchSubject();
}, [ fetchSubject ] );
useEffect( () => {
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/enable-gateway-button.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/enable-gateway-button.tsx
index 375e2bfcde6..39645b9c10a 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/enable-gateway-button.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/enable-gateway-button.tsx
@@ -207,11 +207,13 @@ export const EnableGatewayButton = ( {
}
// If no redirect occurred, the data needs to be refreshed.
- invalidateResolutionForStoreSelector( 'getPaymentProviders' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentProviders'
+ );
if ( isOffline ) {
// We need to invalidate both selectors since they share the same data source and resolver chain.
- invalidateResolutionForStoreSelector(
+ void invalidateResolutionForStoreSelector(
'getOfflinePaymentGateways'
);
}
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/reactivate-live-payments-button.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/reactivate-live-payments-button.tsx
index dd9dc9df0b5..51c53813da8 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/reactivate-live-payments-button.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/reactivate-live-payments-button.tsx
@@ -78,7 +78,9 @@ export const ReactivateLivePaymentsButton = ( {
// Note: Switching from test to live payments is tracked on the backend (the `provider_live_payments_enabled` event).
// Force the providers to be refreshed.
- invalidateResolutionForStoreSelector( 'getPaymentProviders' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentProviders'
+ );
setIsUpdating( false );
} )
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/settings-button.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/settings-button.tsx
index efdb63d919c..5abdb44b6c2 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/settings-button.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/buttons/settings-button.tsx
@@ -88,7 +88,9 @@ export const SettingsButton = ( {
// This is necessary to ensure that the page updates correctly with the latest data.
// If it's not a Reactified page, we just navigate to the settingsHref directly.
if ( isReactifiedPage ) {
- invalidateResolutionForStoreSelector( 'getPaymentGateway' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentGateway'
+ );
navigate( removeOriginFromURL( settingsHref ) );
} else {
window.location.href = settingsHref;
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/ellipsis-menu-content/ellipsis-menu-content.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/ellipsis-menu-content/ellipsis-menu-content.tsx
index adcab97131c..1e0cf5ddafe 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/ellipsis-menu-content/ellipsis-menu-content.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/ellipsis-menu-content/ellipsis-menu-content.tsx
@@ -108,7 +108,9 @@ export const EllipsisMenuContent = ( {
'woocommerce'
)
);
- invalidateResolutionForStoreSelector( 'getPaymentProviders' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentProviders'
+ );
setIsDeactivating( false );
onToggle();
} )
@@ -154,7 +156,9 @@ export const EllipsisMenuContent = ( {
gatewayToggleNonce
)
.then( () => {
- invalidateResolutionForStoreSelector( 'getPaymentProviders' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentProviders'
+ );
setIsDisabling( false );
onToggle();
} )
@@ -192,7 +196,9 @@ export const EllipsisMenuContent = ( {
hidePaymentExtensionSuggestion( suggestionHideUrl )
.then( () => {
- invalidateResolutionForStoreSelector( 'getPaymentProviders' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentProviders'
+ );
setIsHidingSuggestion( false );
onToggle();
} )
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/modals/woo-payments-reset-account-modal.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/modals/woo-payments-reset-account-modal.tsx
index b82170b0d2b..3386e0a79a3 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/modals/woo-payments-reset-account-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/modals/woo-payments-reset-account-modal.tsx
@@ -107,9 +107,9 @@ export const WooPaymentsResetAccountModal = ( {
provider_extension_slug: wooPaymentsExtensionSlug,
} );
// Refresh the providers store.
- invalidatePaymentGateways( 'getPaymentProviders' );
+ void invalidatePaymentGateways( 'getPaymentProviders' );
// Refresh the WooPayments in-context onboarding store.
- invalidateWooPaymentsOnboarding( 'getOnboardingData' );
+ void invalidateWooPaymentsOnboarding( 'getOnboardingData' );
} )
.catch( () => {
recordPaymentsEvent( 'provider_reset_onboarding_failed', {
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateways/payment-gateways.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateways/payment-gateways.tsx
index 00ae88afbcd..f4f066ef425 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateways/payment-gateways.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateways/payment-gateways.tsx
@@ -187,7 +187,7 @@ export const PaymentGateways = ( {
options={ countryOptions }
onChange={ ( currentSelectedCountry: string ) => {
// Save selected country and refresh the store by invalidating getPaymentProviders.
- apiFetch( {
+ void apiFetch( {
path:
WC_ADMIN_NAMESPACE +
'/settings/payments/country',
@@ -206,10 +206,11 @@ export const PaymentGateways = ( {
window.wcSettings.admin.woocommerce_payments_nox_profile.business_country_code =
currentSelectedCountry;
}
- invalidateMainStore( 'getPaymentProviders', [
- currentSelectedCountry,
- ] );
- invalidateWooPaymentsOnboardingStore(
+ void invalidateMainStore(
+ 'getPaymentProviders',
+ [ currentSelectedCountry ]
+ );
+ void invalidateWooPaymentsOnboardingStore(
'getOnboardingData',
[]
);
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx
index 531b5491cf3..4551172a21f 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx
@@ -187,8 +187,10 @@ export const SettingsPaymentsBacs = () => {
);
} finally {
setIsSaving( false );
- invalidateResolution( 'getPaymentProviders', [] );
- invalidateResolutionForStoreSelector( 'getOfflinePaymentGateways' );
+ void invalidateResolution( 'getPaymentProviders', [] );
+ void invalidateResolutionForStoreSelector(
+ 'getOfflinePaymentGateways'
+ );
}
};
@@ -198,7 +200,7 @@ export const SettingsPaymentsBacs = () => {
<Settings.Form
onSubmit={ ( e ) => {
e.preventDefault();
- saveSettings();
+ void saveSettings();
} }
>
<Settings.Section
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cheque.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cheque.tsx
index b2a6bd85689..a126c72ddf0 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cheque.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cheque.tsx
@@ -124,7 +124,9 @@ export const SettingsPaymentsCheque = () => {
} )
.then( () => {
setHasChanges( false );
- invalidateResolutionForStoreSelector( 'getPaymentGateway' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentGateway'
+ );
createSuccessNotice(
__( 'Settings updated successfully', 'woocommerce' )
);
@@ -136,8 +138,8 @@ export const SettingsPaymentsCheque = () => {
} )
.finally( () => {
setIsSaving( false );
- invalidateResolution( 'getPaymentProviders', [] );
- invalidateResolutionForPaymentSettings(
+ void invalidateResolution( 'getPaymentProviders', [] );
+ void invalidateResolutionForPaymentSettings(
'getOfflinePaymentGateways'
);
} );
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cod.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cod.tsx
index 6f005994ebf..b71eae7cf63 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cod.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-cod.tsx
@@ -180,7 +180,9 @@ export const SettingsPaymentsCod = () => {
} )
.then( () => {
setHasChanges( false );
- invalidateResolutionForStoreSelector( 'getPaymentGateway' );
+ void invalidateResolutionForStoreSelector(
+ 'getPaymentGateway'
+ );
createSuccessNotice(
__( 'Settings updated successfully', 'woocommerce' )
);
@@ -192,8 +194,8 @@ export const SettingsPaymentsCod = () => {
} )
.finally( () => {
setIsSaving( false );
- invalidateResolution( 'getPaymentProviders', [] );
- invalidateResolutionForPaymentSettings(
+ void invalidateResolution( 'getPaymentProviders', [] );
+ void invalidateResolutionForPaymentSettings(
'getOfflinePaymentGateways'
);
} );
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/data/onboarding-context.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/data/onboarding-context.tsx
index 5cc4bbc7937..da47140d26b 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/data/onboarding-context.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/data/onboarding-context.tsx
@@ -399,7 +399,7 @@ export const OnboardingProvider: React.FC< {
// This is important to ensure that the onboarding data is cleared when the modal is closed.
// This is to avoid stale data when the modal is opened again.
resetLocalState();
- invalidateWooPaymentsOnboarding( 'getOnboardingData' );
+ void invalidateWooPaymentsOnboarding( 'getOnboardingData' );
};
/**
@@ -552,7 +552,7 @@ export const OnboardingProvider: React.FC< {
// Invalidate the getPaymentProviders store selector to ensure the latest data is fetched.
// This is important to ensure that the payment providers buttons are up to date.
- invalidatePaymentProviders( 'getPaymentProviders' );
+ void invalidatePaymentProviders( 'getPaymentProviders' );
},
justCompletedStepId,
setJustCompletedStepId,
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/index.tsx
index 6821bc40118..7a799a9cbc4 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/index.tsx
@@ -163,7 +163,7 @@ const useInitializeStripe = ( onboardingData: OnboardingFields ) => {
}
};
- initializeStripe();
+ void initializeStripe();
}, [ kycSessionUrl, onboardingData, onboardingSource ] );
return { stripeConnectInstance, initializationError, loading };
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx
index bd26678e54c..99912cb8b43 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx
@@ -255,7 +255,7 @@ export default function PaymentMethodsSelection() {
paymentMethodsState
) }
setPaymentMethodsState={ ( state ) => {
- savePaymentMethodsState(
+ void savePaymentMethodsState(
state,
method.id
);
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/wpcom-connection/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/wpcom-connection/index.tsx
index 1759c4474c8..8ded3f320e9 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/wpcom-connection/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/wpcom-connection/index.tsx
@@ -66,7 +66,7 @@ export const JetpackStep: React.FC = () => {
const startUrl = currentStep?.actions?.start?.href;
if ( startUrl ) {
// No need to wait for the response.
- apiFetch( {
+ void apiFetch( {
url: startUrl,
method: 'POST',
data: {
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-main.tsx b/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-main.tsx
index 31b3911ca9d..979a3c8c17d 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-main.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-main.tsx
@@ -157,7 +157,7 @@ export const SettingsPaymentsMain = () => {
const dismissIncentive = useCallback(
( dismissHref: string, context: string, doNotTrack = false ) => {
// The dismissHref is the full URL to dismiss the incentive.
- apiFetch( {
+ void apiFetch( {
url: dismissHref,
method: 'POST',
data: {
@@ -170,7 +170,7 @@ export const SettingsPaymentsMain = () => {
);
const acceptIncentive = useCallback( ( id: string ) => {
- apiFetch( {
+ void apiFetch( {
path: `/wc-analytics/admin/notes/experimental-activate-promo/${ id }`,
method: 'POST',
} );
@@ -195,7 +195,7 @@ export const SettingsPaymentsMain = () => {
orderMap[ provider.id ] = updatedOrderValues[ index ];
} );
- updateProviderOrdering( orderMap );
+ void updateProviderOrdering( orderMap );
// Set the sorted providers to the state to give a real-time update
setSortedProviders( sorted );
@@ -317,7 +317,7 @@ export const SettingsPaymentsMain = () => {
if ( paymentsEntity?.onboarding?._links?.preload?.href ) {
// We are not interested in the response; we just want to trigger the preload.
- apiFetch( {
+ void apiFetch( {
url: paymentsEntity?.onboarding?._links?.preload.href,
method: 'POST',
data: {
@@ -342,11 +342,11 @@ export const SettingsPaymentsMain = () => {
installAndActivatePlugins( [ paymentsEntity.plugin.slug ] )
.then( async ( response ) => {
if ( attachUrl ) {
- attachPaymentExtensionSuggestion( attachUrl );
+ void attachPaymentExtensionSuggestion( attachUrl );
}
createNoticesFromResponse( response );
- invalidateResolutionForStoreSelector(
+ void invalidateResolutionForStoreSelector(
'getPaymentProviders'
);
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-offline.tsx b/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-offline.tsx
index b0599c87936..b2e1a9e4337 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-offline.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/settings-payments-offline.tsx
@@ -59,7 +59,7 @@ export const SettingsPaymentsOffline = () => {
orderMap[ gateway.id ] = updatedOrderValues[ index ];
} );
- updateProviderOrdering( orderMap );
+ void updateProviderOrdering( orderMap );
// Set the sorted providers to the state to give a real-time update.
setSortedOfflinePaymentGateways( sorted );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/components/task-list-item.tsx b/plugins/woocommerce/client/admin/client/task-lists/components/task-list-item.tsx
index 62d7bbd5271..e1d4547256b 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/components/task-list-item.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/components/task-list-item.tsx
@@ -82,7 +82,7 @@ export const TaskListItem = ( {
const hasFills = Boolean( slot?.fills?.length );
const onDismiss = useCallback( () => {
- dismissTask( id );
+ void dismissTask( id );
createNotice( 'success', __( 'Task dismissed', 'woocommerce' ), {
actions: [
{
@@ -94,7 +94,7 @@ export const TaskListItem = ( {
}, [ id ] );
const onSnooze = useCallback( () => {
- snoozeTask( id );
+ void snoozeTask( id );
createNotice(
'success',
__( 'Task postponed until tomorrow', 'woocommerce' ),
@@ -124,7 +124,7 @@ export const TaskListItem = ( {
const trackedStartedTasks =
userPreferences.task_list_tracked_started_tasks || {};
- visitedTask( id );
+ void visitedTask( id );
await userPreferences.updateUserPreferences( {
task_list_tracked_started_tasks: {
...( trackedStartedTasks || {} ),
@@ -169,11 +169,13 @@ export const TaskListItem = ( {
event?: React.MouseEvent | React.KeyboardEvent
) => {
trackTaskListClick?.();
- trackClick().then( () => {
+ void trackClick().then( () => {
if ( ! isComplete ) {
// Invalidate the task list selector cache to force a re-fetch.
// This ensures the task completion status is up-to-date after visiting a task.
- invalidateResolutionForStoreSelector( 'getTaskLists' );
+ void invalidateResolutionForStoreSelector(
+ 'getTaskLists'
+ );
}
} );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/components/task.tsx b/plugins/woocommerce/client/admin/client/task-lists/components/task.tsx
index 49f6200b55e..b407f26745f 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/components/task.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/components/task.tsx
@@ -57,14 +57,14 @@ export const Task = ( { query, task }: TaskProps ) => {
const onComplete = useCallback(
( options: Record< string, unknown > ) => {
- optimisticallyCompleteTask( id );
+ void optimisticallyCompleteTask( id );
getHistory().push(
options && options.redirectPath
? options.redirectPath
: getNewPath( {}, '/', {} )
);
- invalidateResolutionForStoreSelector( 'getTaskLists' );
- updateBadge();
+ void invalidateResolutionForStoreSelector( 'getTaskLists' );
+ void updateBadge();
},
[
id,
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/Marketing/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/Marketing/index.tsx
index 7b029e4f1b0..b8f82b87c1e 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/Marketing/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/Marketing/index.tsx
@@ -148,7 +148,7 @@ const Marketing = ( { onComplete }: MarketingProps ) => {
const installAndActivate = ( slug: string ) => {
setCurrentPlugin( slug );
- actionTask( 'marketing' );
+ void actionTask( 'marketing' );
installAndActivatePlugins( [ slug ] )
.then( ( response: unknown ) => {
recordEvent( 'tasklist_marketing_install', {
@@ -174,7 +174,7 @@ const Marketing = ( { onComplete }: MarketingProps ) => {
};
const onManage = () => {
- actionTask( 'marketing' );
+ void actionTask( 'marketing' );
};
const trackPromoButtonClick = () => {
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/index.tsx
index c38556db155..d167c828aca 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/index.tsx
@@ -99,7 +99,7 @@ export const Products = () => {
} }
onImport={ () => {
setIsConfirmingLoadSampleProducts( false );
- loadSampleProduct();
+ void loadSampleProduct();
} }
/>
)
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts b/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
index 78defe1a018..e672d461a75 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/index.ts
@@ -13,12 +13,12 @@ import './launch-your-store';
const possiblyImportProductTask = async () => {
if ( isImportProduct() ) {
- import( './import-products' );
+ void import( './import-products' );
} else {
- import( './products' );
+ void import( './products' );
}
};
-possiblyImportProductTask();
+void possiblyImportProductTask();
-import( './shipping-recommendation' );
+void import( './shipping-recommendation' );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/products/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/products/index.tsx
index 3b701d1a143..732bad4cc7d 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/products/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/products/index.tsx
@@ -217,7 +217,7 @@ export const Products = () => {
} }
onImport={ () => {
setIsConfirmingLoadSampleProducts( false );
- loadSampleProduct();
+ void loadSampleProduct();
} }
/>
)
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/products/use-product-types-list-items.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/products/use-product-types-list-items.tsx
index 11b28239466..260f232b238 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/products/use-product-types-list-items.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/products/use-product-types-list-items.tsx
@@ -33,7 +33,7 @@ const useProductTypeListItems = (
if ( typeof productType?.onClick === 'function' ) {
productType.onClick();
} else {
- createProductByType( productType.key );
+ void createProductByType( productType.key );
}
recordEvent( 'tasklist_add_product', {
method: 'product_template',
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping-recommendation/components/plugins.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping-recommendation/components/plugins.tsx
index e801f60cfd4..89b23ad75ba 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping-recommendation/components/plugins.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping-recommendation/components/plugins.tsx
@@ -77,7 +77,7 @@ export const Plugins = ( { nextStep, pluginsToActivate }: Props ) => {
install_extensions: true,
}
);
- updateOptions( {
+ void updateOptions( {
woocommerce_setup_jetpack_opted_in: true,
} );
nextStep();
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/index.tsx
index ab463b88215..64a82a344ef 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/index.tsx
@@ -66,7 +66,7 @@ export const Tax = ( { onComplete, query, task }: TaxProps ) => {
const onManual = useCallback( async () => {
setIsPending( true );
if ( generalSettings?.woocommerce_calc_taxes !== 'yes' ) {
- updateAndPersistSettingsForGroup( 'tax', {
+ void updateAndPersistSettingsForGroup( 'tax', {
tax: {
...taxSettings,
wc_connect_taxes_enabled: 'no',
@@ -140,7 +140,7 @@ export const Tax = ( { onComplete, query, task }: TaxProps ) => {
no_tax: true,
} );
- updateOptions( {
+ void updateOptions( {
woocommerce_no_sales_tax: true,
woocommerce_calc_taxes: 'no',
} ).then( () => {
@@ -188,7 +188,7 @@ export const Tax = ( { onComplete, query, task }: TaxProps ) => {
const { auto } = query;
useEffect( () => {
if ( auto === 'true' ) {
- onAutomate();
+ void onAutomate();
}
}, [ auto, onAutomate ] );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/stripe-tax/card.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/stripe-tax/card.tsx
index 73d49735324..b4dae14cb60 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/stripe-tax/card.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/stripe-tax/card.tsx
@@ -77,7 +77,7 @@ export const Card = ( {
} );
const { updateAndPersistSettingsForGroup } =
dispatch( settingsStore );
- updateAndPersistSettingsForGroup( 'general', {
+ void updateAndPersistSettingsForGroup( 'general', {
general: {
woocommerce_calc_taxes: 'yes', // Stripe tax requires tax calculation to be enabled so let's do it here to save the user from doing it manually
},
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx
index 2d96ad42631..2dc70fc890b 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/woocommerce-tax/plugins.tsx
@@ -75,7 +75,7 @@ export const Plugins = ( {
recordEvent( 'tasklist_tax_install_extensions', {
install_extensions: true,
} );
- updateOptions( {
+ void updateOptions( {
woocommerce_setup_jetpack_opted_in: true,
} );
nextStep();
diff --git a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx
index cf538f396c1..4032dd48f3e 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-completed-header.tsx
@@ -120,7 +120,7 @@ export const TaskListCompletedHeader = ( {
comments: comments || '',
store_age: storeAgeInWeeks,
} );
- updateOptions( {
+ void updateOptions( {
[ SHOWN_FOR_ACTIONS_OPTION_NAME ]: [
CUSTOMER_EFFORT_SCORE_ACTION,
...( cesShownForActions || [] ),
diff --git a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-item.tsx b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-item.tsx
index 5d2fbce75d3..ed9c0ef6108 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-item.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-list-item.tsx
@@ -46,7 +46,7 @@ export const TaskListItem = ( {
const hasFills = Boolean( slot?.fills?.length );
const onDismissTask = ( onDismiss?: () => void ) => {
- dismissTask( taskId );
+ void dismissTask( taskId );
createNotice( 'success', __( 'Task dismissed', 'woocommerce' ), {
actions: [
{
diff --git a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/setup-task-list.tsx b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/setup-task-list.tsx
index 8946da89980..d7fbc7ef5e0 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/setup-task-list.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/setup-task-list.tsx
@@ -116,11 +116,11 @@ export const SetupTaskList = ( {
);
const hideTasks = () => {
- hideTaskList( id );
+ void hideTaskList( id );
};
const keepTasks = () => {
- keepCompletedTasks( id );
+ void keepCompletedTasks( id );
};
const renderMenu = () => {
@@ -187,7 +187,7 @@ export const SetupTaskList = ( {
const trackedStartedTasks =
userPreferences.task_list_tracked_started_tasks || {};
- visitedTask( taskId );
+ void visitedTask( taskId );
await userPreferences.updateUserPreferences( {
task_list_tracked_started_tasks: {
...( trackedStartedTasks || {} ),
@@ -212,11 +212,11 @@ export const SetupTaskList = ( {
};
const goToTask = ( task: TaskType ) => {
- trackClick( task ).then( () => {
+ void trackClick( task ).then( () => {
if ( ! isComplete ) {
// Invalidate the task list selector cache to force a re-fetch.
// This ensures the task completion status is up-to-date after visiting a task.
- invalidateResolutionForStoreSelector( 'getTaskLists' );
+ void invalidateResolutionForStoreSelector( 'getTaskLists' );
}
} );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/task-lists.tsx b/plugins/woocommerce/client/admin/client/task-lists/task-lists.tsx
index 65ec2c3332a..21efb55468e 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/task-lists.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/task-lists.tsx
@@ -74,7 +74,7 @@ export const TaskLists = ( { query }: TaskListsProps ) => {
{}
);
- hideTaskList( id );
+ void hideTaskList( id );
};
const currentTask = getCurrentTask();
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-apply-update.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-apply-update.ts
index b55794340fd..2b208922d9d 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-apply-update.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-apply-update.ts
@@ -98,7 +98,7 @@ export function useApplyUpdate(
if ( ! current ) {
return;
}
- receiveEntityRecords(
+ void receiveEntityRecords(
'postType',
'woo_email',
[
@@ -130,15 +130,18 @@ export function useApplyUpdate(
syncEditorState( res.restored_content );
- createSuccessNotice( __( 'Update reverted.', 'woocommerce' ), {
- type: 'snackbar',
- } );
+ void createSuccessNotice(
+ __( 'Update reverted.', 'woocommerce' ),
+ {
+ type: 'snackbar',
+ }
+ );
} catch ( err: unknown ) {
const message =
err && typeof err === 'object' && 'message' in err
? String( err.message )
: __( 'Could not revert the update.', 'woocommerce' );
- createErrorNotice( message, { type: 'snackbar' } );
+ void createErrorNotice( message, { type: 'snackbar' } );
}
},
[ postId, createSuccessNotice, createErrorNotice, syncEditorState ]
@@ -173,7 +176,7 @@ export function useApplyUpdate(
'Update applied · customizations preserved',
'woocommerce'
);
- createSuccessNotice( successMessage, {
+ void createSuccessNotice( successMessage, {
type: 'snackbar',
actions: [
{
@@ -192,7 +195,7 @@ export function useApplyUpdate(
? String( err.message )
: __( 'Could not apply the update.', 'woocommerce' );
if ( ! options.suppressSnackbarOnError ) {
- createErrorNotice( message, { type: 'snackbar' } );
+ void createErrorNotice( message, { type: 'snackbar' } );
}
return null;
} finally {
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts
index 84255c74fcb..aaf5558227d 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts
@@ -115,7 +115,7 @@ if (
'wc_email_review_drawer'
) === '1'
) {
- dispatch( INTEGRATION_STORE_NAME ).openReviewDrawer();
+ void dispatch( INTEGRATION_STORE_NAME ).openReviewDrawer();
// Strip the param from the URL so a refresh doesn't re-trigger the
// drawer auto-open. RSM-141 §5.2.
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx
index de97e11a388..29df32d8e68 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx
@@ -121,7 +121,7 @@ const getResetNotificationEmailContentAction = () => {
| { content?: { raw?: string } }
| undefined;
if ( current ) {
- receiveEntityRecords(
+ void receiveEntityRecords(
'postType',
item.type,
[
@@ -149,7 +149,7 @@ const getResetNotificationEmailContentAction = () => {
getItemTitle( item )
);
- createSuccessNotice( successMessage, {
+ void createSuccessNotice( successMessage, {
type: 'snackbar',
id: 'reset-notification-email-content-action',
} );
@@ -170,7 +170,7 @@ const getResetNotificationEmailContentAction = () => {
error.message as TranslatableText< string >;
}
- createErrorNotice( errorMessage, {
+ void createErrorNotice( errorMessage, {
type: 'snackbar',
} );
} finally {
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/fulfill-items-button.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/fulfill-items-button.tsx
index 62d2890a7ad..08bcc5a5c00 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/fulfill-items-button.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/fulfill-items-button.tsx
@@ -53,7 +53,7 @@ export default function FulfillItemsButton( {
if ( error ) {
setError( error );
} else {
- refreshOrderFulfillmentStatus( order.id );
+ void refreshOrderFulfillmentStatus( order.id );
setIsEditing( false );
}
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/remove-button.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/remove-button.tsx
index cc55d525c13..a359d524a30 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/remove-button.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/remove-button.tsx
@@ -45,7 +45,7 @@ export default function RemoveButton( {
if ( error ) {
setError( error );
} else {
- refreshOrderFulfillmentStatus( order.id );
+ void refreshOrderFulfillmentStatus( order.id );
setOpenSection( 'order' );
setIsEditing( false );
}
@@ -62,7 +62,7 @@ export default function RemoveButton( {
if ( fulfillment.is_fulfilled ) {
openModal();
} else {
- handleDeleteFulfillment();
+ void handleDeleteFulfillment();
}
};
@@ -113,7 +113,7 @@ export default function RemoveButton( {
<Button
variant="primary"
onClick={ () => {
- handleDeleteFulfillment();
+ void handleDeleteFulfillment();
closeModal();
} }
isBusy={ isExecuting }
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/save-draft-button.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/save-draft-button.tsx
index 7dd4df91f11..55cbac92fc2 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/save-draft-button.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/save-draft-button.tsx
@@ -47,7 +47,7 @@ export default function SaveAsDraftButton( {
if ( error ) {
setError( error );
} else {
- refreshOrderFulfillmentStatus( order.id );
+ void refreshOrderFulfillmentStatus( order.id );
setIsEditing( false );
}
setIsExecuting( false );
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/update-button.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/update-button.tsx
index cbf8b5d923d..8616bf49f78 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/update-button.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/action-buttons/update-button.tsx
@@ -66,7 +66,7 @@ export default function UpdateButton( {
setError( error );
} else {
setCustomerNote( '' );
- refreshOrderFulfillmentStatus( order.id );
+ void refreshOrderFulfillmentStatus( order.id );
setIsEditing( false );
}
setIsExecuting( false );
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/shipment-tracking-number-form.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/shipment-tracking-number-form.tsx
index 5464b0b1a25..a1076ae2186 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/shipment-tracking-number-form.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/shipment-tracking-number-form.tsx
@@ -213,7 +213,7 @@ export default function ShipmentTrackingNumberForm() {
! isLoading &&
! isEmpty( trackingNumberTemp.trim() )
) {
- handleTrackingNumberLookup();
+ void handleTrackingNumberLookup();
}
} }
aria-invalid={ !! error }
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/utils/fulfillment-utils.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/utils/fulfillment-utils.ts
index d9d31b2847c..516de53f7fd 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/utils/fulfillment-utils.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/utils/fulfillment-utils.ts
@@ -36,7 +36,7 @@ export function getFulfillmentItems(
}
export async function refreshOrderFulfillmentStatus( orderId: number ) {
- dispatch( FulfillmentStore ).invalidateResolution( 'getOrder', [
+ void dispatch( FulfillmentStore ).invalidateResolution( 'getOrder', [
orderId,
] );
const order: Order | null =
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/payment-method-promotions/payment-promotion-row.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/payment-method-promotions/payment-promotion-row.tsx
index 7864d192d88..c770a6ac677 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/payment-method-promotions/payment-promotion-row.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/payment-method-promotions/payment-promotion-row.tsx
@@ -112,7 +112,7 @@ export const PaymentPromotionRow = ( {
recordEvent( 'settings_payments_promotions_dismiss', {
id: gatewayId,
} );
- updatePaymentGateway( gatewayId, {
+ void updatePaymentGateway( gatewayId, {
settings: {
is_dismissed: 'yes',
},
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-import-tracking/product-import-tracking.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-import-tracking/product-import-tracking.ts
index 9db01727cd7..362cb1eb388 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-import-tracking/product-import-tracking.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-import-tracking/product-import-tracking.ts
@@ -21,5 +21,5 @@ const ACTION_NAME = 'import_products';
return;
}
- addExitPage( ACTION_NAME );
+ void addExitPage( ACTION_NAME );
} )();
diff --git a/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/frontend.ts
index 25e8e0ae32c..3c6774a7f17 100644
--- a/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/button/frontend.ts
@@ -182,7 +182,7 @@ const productButtonStore = {
{},
{ lock: universalLock }
);
- actions.refreshCartItems();
+ void actions.refreshCartItems();
},
handleAnimationEnd( event: AnimationEvent ) {
const context = getContext< Context >();
diff --git a/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/summary/upgrade.tsx b/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/summary/upgrade.tsx
index c53c08b1b51..3d6c072fe46 100644
--- a/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/summary/upgrade.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/atomic/blocks/product-elements/summary/upgrade.tsx
@@ -69,7 +69,7 @@ const UpgradeNotice = ( { clientId }: { clientId: string } ) => {
'woocommerce/product-summary',
restAttributes
);
- replaceBlock( clientId, productSummaryBlock );
+ void replaceBlock( clientId, productSummaryBlock );
}
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/address-autocomplete/address-autocomplete.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/address-autocomplete/address-autocomplete.tsx
index 528909b261f..6227a7a9964 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/address-autocomplete/address-autocomplete.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/address-autocomplete/address-autocomplete.tsx
@@ -377,7 +377,7 @@ export const AddressAutocomplete = ( {
suppressSearchTimeoutRef.current = setTimeout( () => {
suppressSearchTimeoutRef.current = null;
}, 1000 );
- provider
+ void provider
.select( selected.id, country )
.then( ( address ) => {
if ( addressType === 'shipping' ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx
index 29e1ed34f61..901db035224 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/cart-line-item-row.tsx
@@ -343,7 +343,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
) }
onClick={ () => {
onRemove();
- removeItem();
+ void removeItem();
dispatchStoreEvent(
'cart-remove-item',
{
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/form.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/form.tsx
index ff5489b47d8..ec6f2f14028 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/form.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/form.tsx
@@ -111,7 +111,7 @@ const Form = <
if ( hasValidationError ) {
return;
}
- dispatch( validationStore ).setValidationErrors( {
+ void dispatch( validationStore ).setValidationErrors( {
[ `${ addressType }_${ key }` ]: {
message: error,
hidden: !! inputRef?.isFocused(),
@@ -132,7 +132,7 @@ const Form = <
}
} );
if ( errorsToClear.length ) {
- dispatch( validationStore ).clearValidationErrors(
+ void dispatch( validationStore ).clearValidationErrors(
errorsToClear
);
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-country.ts b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-country.ts
index 2abe01b2630..9fabbe8a991 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-country.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-country.ts
@@ -51,17 +51,17 @@ const validateCountry = (
// No errors, so clear from store if needed
if ( hasValidationError ) {
- dispatch( validationStore ).clearValidationError(
+ void dispatch( validationStore ).clearValidationError(
validationErrorId
);
}
} catch ( error ) {
if ( hasValidationError ) {
- dispatch( validationStore ).showValidationError(
+ void dispatch( validationStore ).showValidationError(
validationErrorId
);
} else {
- dispatch( validationStore ).setValidationErrors( {
+ void dispatch( validationStore ).setValidationErrors( {
[ validationErrorId ]: {
message: String( error ),
hidden: false,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-state.ts b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-state.ts
index 5881c376da8..fd2ae74df45 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-state.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/validate-state.ts
@@ -46,12 +46,12 @@ export const validateState = (
if ( hasValidationError ) {
if ( ! isRequired || values.state ) {
// Validation error has been set, but it's no longer required, or the state was provided, clear the error.
- dispatch( validationStore ).clearValidationError(
+ void dispatch( validationStore ).clearValidationError(
validationErrorId
);
} else if ( ! addressChanged ) {
// Validation error has been set, there has not been an address change so show the error.
- dispatch( validationStore ).showValidationError(
+ void dispatch( validationStore ).showValidationError(
validationErrorId
);
}
@@ -62,7 +62,7 @@ export const validateState = (
values.country
) {
// No validation has been set yet, if it's required, there is a country set and no state, set the error.
- dispatch( validationStore ).setValidationErrors( {
+ void dispatch( validationStore ).setValidationErrors( {
[ validationErrorId ]: {
message: sprintf(
/* translators: %s will be the state field label in lowercase e.g. "state" */
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/index.tsx
index bace3b68fbe..6021f0568a3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/index.tsx
@@ -67,7 +67,7 @@ export const TotalsCoupon = ( {
) => {
e.preventDefault();
if ( typeof onSubmit !== 'undefined' ) {
- onSubmit( couponValue )?.then( ( result ) => {
+ void onSubmit( couponValue )?.then( ( result ) => {
if ( result ) {
setCouponValue( '' );
setIsCouponFormVisible( false );
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/select/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/select/index.tsx
index 11148118c7d..c5d5ecd41bd 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/select/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/select/index.tsx
@@ -95,9 +95,9 @@ export const Select = ( props: SelectProps ) => {
useEffect( () => {
if ( ! required || value ) {
- clearValidationError( errorId );
+ void clearValidationError( errorId );
} else {
- setValidationErrors( {
+ void setValidationErrors( {
[ errorId ]: {
message: errorMessage,
hidden: true,
@@ -105,7 +105,7 @@ export const Select = ( props: SelectProps ) => {
} );
}
return () => {
- clearValidationError( errorId );
+ void clearValidationError( errorId );
};
}, [
clearValidationError,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/use-product-attributes.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/use-product-attributes.ts
index be1e5e0f24a..681a977b9a1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/use-product-attributes.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/use-product-attributes.ts
@@ -64,7 +64,7 @@ export default function useProductAttributes( shouldLoadAttributes: boolean ) {
}
}
- fetchAttributesWithTerms();
+ void fetchAttributesWithTerms();
return () => {
hasLoadedAttributes.current = true;
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-events/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-events/index.tsx
index 8a7dda98d32..7e3272d7317 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-events/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-events/index.tsx
@@ -130,7 +130,7 @@ export const CheckoutEventsProvider = ( {
// Set the registered express payment methods
useEffect( () => {
- __internalSetRegisteredExpressPaymentMethods(
+ void __internalSetRegisteredExpressPaymentMethods(
convertToPlainExpressPaymentMethods( registeredMethods )
);
}, [ registeredMethods ] );
@@ -146,7 +146,7 @@ export const CheckoutEventsProvider = ( {
) {
return;
}
- __internalUpdateAvailablePaymentMethods();
+ void __internalUpdateAvailablePaymentMethods();
}, [
isEditor,
paymentMethods,
@@ -185,7 +185,7 @@ export const CheckoutEventsProvider = ( {
} );
if ( redirectUrl && redirectUrl !== checkoutRedirectUrl ) {
- __internalSetRedirectUrl( redirectUrl );
+ void __internalSetRedirectUrl( redirectUrl );
}
const { setValidationErrors } = useDispatch( validationStore );
@@ -295,7 +295,7 @@ export const CheckoutEventsProvider = ( {
// the registered callbacks
useEffect( () => {
if ( isCheckoutBeforeProcessing ) {
- __internalEmitValidateEvent( {
+ void __internalEmitValidateEvent( {
setValidationErrors,
} );
}
@@ -319,7 +319,7 @@ export const CheckoutEventsProvider = ( {
}
if ( isCheckoutAfterProcessing ) {
- __internalEmitAfterProcessingEvents( {
+ void __internalEmitAfterProcessingEvents( {
notices: {
checkoutNotices,
paymentNotices,
@@ -347,7 +347,7 @@ export const CheckoutEventsProvider = ( {
const onSubmit = useCallback( () => {
dispatchCheckoutEvent( 'submit' );
- __internalSetBeforeProcessing();
+ void __internalSetBeforeProcessing();
}, [ dispatchCheckoutEvent, __internalSetBeforeProcessing ] );
const checkoutEventHandlers = {
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-processor.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-processor.ts
index 83777e5eacf..c9e815a3777 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-processor.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/checkout-processor.ts
@@ -145,7 +145,7 @@ const CheckoutProcessor = () => {
( checkoutIsProcessing || checkoutIsBeforeProcessing ) &&
! isExpressPaymentMethodActive
) {
- __internalSetHasError( checkoutWillHaveError );
+ void __internalSetHasError( checkoutWillHaveError );
}
}, [
checkoutWillHaveError,
@@ -293,14 +293,14 @@ const CheckoutProcessor = () => {
return response.json();
} )
.then( ( responseJson: CheckoutResponseSuccess ) => {
- __internalProcessCheckoutResponse( responseJson );
+ void __internalProcessCheckoutResponse( responseJson );
setIsProcessingOrder( false );
} )
.catch( ( errorResponse: ApiResponse< CheckoutResponseError > ) => {
processCheckoutResponseHeaders( errorResponse?.headers );
try {
// This attempts to parse a JSON error response where the status code was 4xx/5xx.
- errorResponse
+ void errorResponse
.json()
.then(
( response ) => response as CheckoutResponseError
@@ -311,7 +311,7 @@ const CheckoutProcessor = () => {
receiveCartContents( response.data.cart );
}
processErrorResponse( response );
- __internalProcessCheckoutResponse( response );
+ void __internalProcessCheckoutResponse( response );
} );
} catch {
let errorMessage = __(
@@ -331,7 +331,7 @@ const CheckoutProcessor = () => {
data: null,
} );
}
- __internalSetHasError( true );
+ void __internalSetHasError( true );
setIsProcessingOrder( false );
} );
}, [
@@ -357,7 +357,7 @@ const CheckoutProcessor = () => {
// Process order if conditions are good.
useEffect( () => {
if ( paidAndWithoutErrors && ! isProcessingOrder ) {
- processOrder();
+ void processOrder();
}
}, [ processOrder, paidAndWithoutErrors, isProcessingOrder ] );
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/payment-events/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/payment-events/index.tsx
index e170f1dc970..52fad90cb32 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/payment-events/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/payment-events/index.tsx
@@ -100,13 +100,13 @@ export const PaymentEventsProvider = ( {
! checkoutHasError &&
! checkoutIsCalculating
) {
- __internalSetPaymentProcessing();
+ void __internalSetPaymentProcessing();
// Note: the nature of this event emitter is that it will bail on any
// observer that returns a response that !== true. However, this still
// allows for other observers that return true for continuing through
// to the next observer (or bailing if there's a problem).
- __internalEmitPaymentProcessingEvent(
+ void __internalEmitPaymentProcessingEvent(
currentObservers.current,
setValidationErrors
);
@@ -123,14 +123,14 @@ export const PaymentEventsProvider = ( {
// When checkout is returned to idle, and the payment setup has not completed, set payment status to idle
useEffect( () => {
if ( checkoutIsIdle && ! isPaymentReady ) {
- __internalSetPaymentIdle();
+ void __internalSetPaymentIdle();
}
}, [ checkoutIsIdle, isPaymentReady, __internalSetPaymentIdle ] );
// if checkout has an error sync payment status back to idle.
useEffect( () => {
if ( checkoutHasError && isPaymentReady ) {
- __internalSetPaymentIdle();
+ void __internalSetPaymentIdle();
}
}, [ checkoutHasError, isPaymentReady, __internalSetPaymentIdle ] );
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/shipping/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/shipping/index.tsx
index 2ccb7a8b346..89833efa07d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/shipping/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/shipping/index.tsx
@@ -75,9 +75,9 @@ export const ShippingDataProvider = ( {
// increment/decrement checkout calculating counts when shipping is loading.
useEffect( () => {
if ( isLoadingRates ) {
- __internalStartCalculation();
+ void __internalStartCalculation();
} else {
- __internalFinishCalculation();
+ void __internalFinishCalculation();
}
}, [
isLoadingRates,
@@ -88,9 +88,9 @@ export const ShippingDataProvider = ( {
// increment/decrement checkout calculating counts when shipping rates are being selected.
useEffect( () => {
if ( isSelectingRate ) {
- __internalStartCalculation();
+ void __internalStartCalculation();
} else {
- __internalFinishCalculation();
+ void __internalFinishCalculation();
}
}, [
__internalStartCalculation,
@@ -128,7 +128,7 @@ export const ShippingDataProvider = ( {
! isLoadingRates &&
( shippingRates.length === 0 || currentErrorStatus.hasError )
) {
- emitEvent(
+ void emitEvent(
currentObservers.current,
EMIT_TYPES.SHIPPING_RATES_FAIL,
{
@@ -150,7 +150,7 @@ export const ShippingDataProvider = ( {
shippingRates.length > 0 &&
! currentErrorStatus.hasError
) {
- emitEvent(
+ void emitEvent(
currentObservers.current,
EMIT_TYPES.SHIPPING_RATES_SUCCESS,
shippingRates
@@ -164,7 +164,7 @@ export const ShippingDataProvider = ( {
return;
}
if ( currentErrorStatus.hasError ) {
- emitEvent(
+ void emitEvent(
currentObservers.current,
EMIT_TYPES.SHIPPING_RATE_SELECT_FAIL,
{
@@ -173,7 +173,7 @@ export const ShippingDataProvider = ( {
}
);
} else {
- emitEvent(
+ void emitEvent(
currentObservers.current,
EMIT_TYPES.SHIPPING_RATE_SELECT_SUCCESS,
selectedRates.current
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/utils.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/utils.ts
index 0a05b8f9234..e5bbcdd93c8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/cart-checkout/utils.ts
@@ -73,7 +73,7 @@ export const processCheckoutResponseHeaders = (
// Update user using headers.
if ( headers?.get( 'User-ID' ) ) {
- __internalSetCustomerId(
+ void __internalSetCustomerId(
parseInt( headers.get( 'User-ID' ) || '0', 10 )
);
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/hocs/with-reviews.tsx b/plugins/woocommerce/client/blocks/assets/js/base/hocs/with-reviews.tsx
index ffab1ef4189..a01bf9f5e6c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/hocs/with-reviews.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/hocs/with-reviews.tsx
@@ -142,7 +142,7 @@ const withReviews = (
const onReviewsReplaced =
this.props.onReviewsReplaced ?? ( () => undefined );
- this.updateListOfReviews().then( onReviewsReplaced );
+ void this.updateListOfReviews().then( onReviewsReplaced );
}
appendReviews() {
@@ -161,7 +161,7 @@ const withReviews = (
return;
}
- this.updateListOfReviews( reviews ).then( onReviewsAppended );
+ void this.updateListOfReviews( reviews ).then( onReviewsAppended );
}
updateListOfReviews( oldReviews: Review[] = [] ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-update-preferred-autocomplete-provider.ts b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-update-preferred-autocomplete-provider.ts
index 8d564474212..e2517a117bc 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-update-preferred-autocomplete-provider.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-update-preferred-autocomplete-provider.ts
@@ -78,7 +78,7 @@ export function useUpdatePreferredAutocompleteProvider(
useEffect( () => {
// Check if window.wc.addressAutocomplete.providers exists
if ( ! window?.wc?.addressAutocomplete?.providers ) {
- setActiveAddressAutocompleteProvider( '', addressType );
+ void setActiveAddressAutocompleteProvider( '', addressType );
if ( window?.wc?.addressAutocomplete?.activeProvider ) {
window.wc.addressAutocomplete.activeProvider[ addressType ] =
null;
@@ -94,7 +94,7 @@ export function useUpdatePreferredAutocompleteProvider(
];
if ( provider && provider.canSearch( country ) ) {
- setActiveAddressAutocompleteProvider(
+ void setActiveAddressAutocompleteProvider(
provider.id,
addressType
);
@@ -107,7 +107,7 @@ export function useUpdatePreferredAutocompleteProvider(
}
// No provider supports this country, clear the active provider
- setActiveAddressAutocompleteProvider( '', addressType );
+ void setActiveAddressAutocompleteProvider( '', addressType );
// Set globally as this is going to be the source of truth where the actual provider objects are stored.
if ( window?.wc?.addressAutocomplete?.activeProvider ) {
window.wc.addressAutocomplete.activeProvider[ addressType ] = null;
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/cart.ts b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/cart.ts
index 7fdcf3f9d70..5799e5add94 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/cart.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/cart.ts
@@ -485,7 +485,7 @@ const { actions } = store< Store >(
);
}
} catch ( error ) {
- actions.showNoticeError( error as Error );
+ void actions.showNoticeError( error as Error );
}
},
@@ -737,7 +737,7 @@ const { actions } = store< Store >(
}
} catch ( error ) {
// Show error notice
- actions.showNoticeError( error as Error );
+ void actions.showNoticeError( error as Error );
}
},
@@ -1000,7 +1000,7 @@ const { actions } = store< Store >(
yield actions.updateNotices( errorNotices );
}
} catch ( error ) {
- actions.showNoticeError( error as Error );
+ void actions.showNoticeError( error as Error );
}
},
@@ -1133,7 +1133,7 @@ const { actions } = store< Store >(
);
// Trigger initial cart refresh.
-actions.refreshCartItems();
+void actions.refreshCartItems();
window.addEventListener(
'wc-blocks_store_sync_required',
@@ -1143,7 +1143,7 @@ window.addEventListener(
id: number;
} >;
if ( customEvent.detail.type === 'from_@wordpress/data' ) {
- actions.refreshCartItems();
+ void actions.refreshCartItems();
}
}
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/mutation-batcher.ts b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/mutation-batcher.ts
index 8164b5c0725..a4facb5abb6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/mutation-batcher.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/mutation-batcher.ts
@@ -144,7 +144,7 @@ export function createMutationQueue< TState >(
// If new requests arrived while in-flight, send them.
if ( pendingIds.length > 0 ) {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
- processRequests();
+ void processRequests();
return;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/shopper-lists.ts b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/shopper-lists.ts
index 523b1ca8944..0de36fc4659 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/shopper-lists.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/shopper-lists.ts
@@ -250,7 +250,7 @@ const { state, actions } = store< Store >(
list.items.push( item );
}
} catch ( error ) {
- actions.showNoticeError( error as Error );
+ void actions.showNoticeError( error as Error );
}
},
@@ -276,7 +276,7 @@ const { state, actions } = store< Store >(
{ method: 'DELETE' }
);
} catch ( error ) {
- actions.showNoticeError( error as Error );
+ void actions.showNoticeError( error as Error );
return;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/utils/create-notice.ts b/plugins/woocommerce/client/blocks/assets/js/base/utils/create-notice.ts
index b264a522521..ee225edbb02 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/utils/create-notice.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/utils/create-notice.ts
@@ -48,7 +48,7 @@ export const createNotice = (
return;
}
- dispatch( noticesStore ).createNotice( status, message, {
+ void dispatch( noticesStore ).createNotice( status, message, {
isDismissible: true,
...options,
context: noticeContext,
@@ -71,7 +71,7 @@ export const removeAllNotices = () => {
containers.forEach( ( container ) => {
getNotices( container ).forEach( ( notice ) => {
- removeNotice( notice.id, container );
+ void removeNotice( notice.id, container );
} );
} );
};
@@ -81,7 +81,7 @@ export const removeNoticesWithContext = ( context: string ) => {
const { getNotices } = select( noticesStore );
getNotices( context ).forEach( ( notice ) => {
- removeNotice( notice.id, context );
+ void removeNotice( notice.id, context );
} );
};
@@ -95,7 +95,7 @@ export const removeNoticesForField = ( id: string, context?: string ) => {
const { removeNotice } = dispatch( noticesStore );
if ( context ) {
- removeNotice( id, context );
+ void removeNotice( id, context );
return;
}
@@ -109,7 +109,7 @@ export const removeNoticesForField = ( id: string, context?: string ) => {
containers.forEach( ( container ) => {
getNotices( container ).forEach( ( notice ) => {
if ( notice.id.startsWith( id ) ) {
- removeNotice( notice.id, container );
+ void removeNotice( notice.id, container );
}
} );
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks-registry/payment-methods/registry.ts b/plugins/woocommerce/client/blocks/assets/js/blocks-registry/payment-methods/registry.ts
index 2eb50a62374..cdbb9bf2dc8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks-registry/payment-methods/registry.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks-registry/payment-methods/registry.ts
@@ -125,7 +125,7 @@ export const __experimentalDeRegisterPaymentMethod = (
}: DispatchReturn< PaymentStoreDescriptor > = dispatch(
PAYMENT_STORE_KEY
) as ActionCreatorsOf< ConfigOf< PaymentStoreDescriptor > >;
- __internalRemoveAvailablePaymentMethod( paymentMethodName );
+ void __internalRemoveAvailablePaymentMethod( paymentMethodName );
};
export const __experimentalDeRegisterExpressPaymentMethod = (
@@ -135,7 +135,7 @@ export const __experimentalDeRegisterExpressPaymentMethod = (
const { __internalRemoveAvailableExpressPaymentMethod } = dispatch(
PAYMENT_STORE_KEY
) as ActionCreatorsOf< ConfigOf< PaymentStoreDescriptor > >;
- __internalRemoveAvailableExpressPaymentMethod( paymentMethodName );
+ void __internalRemoveAvailableExpressPaymentMethod( paymentMethodName );
};
export const getPaymentMethods = (): PaymentMethods => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/product-item/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/product-item/edit.tsx
index 654ebe24a31..758c41c1ce6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/product-item/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/grouped-product-selector/product-item/edit.tsx
@@ -124,7 +124,7 @@ export default function ProductItemTemplateEdit(
return;
}
- resolveSelect( productsStore )
+ void resolveSelect( productsStore )
.getProducts( {
include: groupedProductIds,
per_page: groupedProductIds.length,
@@ -138,23 +138,23 @@ export default function ProductItemTemplateEdit(
if ( ! isLoading && product && productsLength === 0 ) {
if ( isProductResponseItem( product ) ) {
- fetchChildProducts( product.grouped_products );
+ void fetchChildProducts( product.grouped_products );
} else {
// If not editing a specific product, we are editing a template.
// Fetch an existing grouped product so template can be edited.
- resolveSelect( productsStore )
+ void resolveSelect( productsStore )
.getProducts( { type: 'grouped', per_page: 1 } )
.then( ( groupedProduct ) => {
if (
groupedProduct.length > 0 &&
groupedProduct[ 0 ]?.grouped_products?.length > 0
) {
- fetchChildProducts(
+ void fetchChildProducts(
groupedProduct[ 0 ].grouped_products
);
} else {
// If there are no grouped products, query for any three other products.
- resolveSelect( productsStore )
+ void resolveSelect( productsStore )
.getProducts( {
per_page: 3,
_fields: [ 'id' ],
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment-methods.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment-methods.tsx
index 15f3b3ebcd3..fc70ecccec6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment-methods.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment-methods.tsx
@@ -85,8 +85,8 @@ const ExpressPaymentMethods = () => {
( paymentMethodId ) => () => {
previousActivePaymentMethod.current = activePaymentMethod;
previousPaymentMethodData.current = paymentMethodData;
- __internalSetExpressPaymentStarted();
- __internalSetActivePaymentMethod( paymentMethodId );
+ void __internalSetExpressPaymentStarted();
+ void __internalSetActivePaymentMethod( paymentMethodId );
},
[
activePaymentMethod,
@@ -102,8 +102,8 @@ const ExpressPaymentMethods = () => {
* This restores the active method and returns the state to pristine.
*/
const onExpressPaymentClose = useCallback( () => {
- __internalSetPaymentIdle();
- __internalSetActivePaymentMethod(
+ void __internalSetPaymentIdle();
+ void __internalSetActivePaymentMethod(
previousActivePaymentMethod.current,
previousPaymentMethodData.current
);
@@ -116,10 +116,10 @@ const ExpressPaymentMethods = () => {
*/
const onExpressPaymentError = useCallback(
( errorMessage ) => {
- __internalSetPaymentError();
- __internalSetPaymentMethodData( errorMessage );
- __internalSetExpressPaymentError( errorMessage );
- __internalSetActivePaymentMethod(
+ void __internalSetPaymentError();
+ void __internalSetPaymentMethodData( errorMessage );
+ void __internalSetExpressPaymentError( errorMessage );
+ void __internalSetActivePaymentMethod(
previousActivePaymentMethod.current,
previousPaymentMethodData.current
);
@@ -148,7 +148,7 @@ const ExpressPaymentMethods = () => {
if ( errorMessage ) {
onExpressPaymentError( errorMessage );
} else {
- __internalSetExpressPaymentError( '' );
+ void __internalSetExpressPaymentError( '' );
}
},
[ __internalSetExpressPaymentError, onExpressPaymentError ]
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-card.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-card.tsx
index 7d3f910361c..9203b42c1fd 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-card.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-card.tsx
@@ -64,7 +64,7 @@ const PaymentMethodCard = ( {
useEffect( () => {
if ( ! canSavePaymentMethod && shouldSavePaymentMethod ) {
- __internalSetShouldSavePaymentMethod( false );
+ void __internalSetShouldSavePaymentMethod( false );
}
}, [
canSavePaymentMethod,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/saved-payment-method-options.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/saved-payment-method-options.tsx
index c0cfcd79245..972f26cdf5d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/saved-payment-method-options.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/saved-payment-method-options.tsx
@@ -124,12 +124,15 @@ const SavedPaymentMethodOptions = () => {
value: paymentMethod.tokenId.toString(),
onChange: ( token: string ) => {
const savedTokenKey = `wc-${ paymentMethodSlug }-payment-token`;
- __internalSetActivePaymentMethod( paymentMethodSlug, {
- token,
- payment_method: paymentMethodSlug,
- [ savedTokenKey ]: token.toString(),
- isSavedToken: true,
- } );
+ void __internalSetActivePaymentMethod(
+ paymentMethodSlug,
+ {
+ token,
+ payment_method: paymentMethodSlug,
+ [ savedTokenKey ]: token.toString(),
+ isSavedToken: true,
+ }
+ );
removeNotice(
'wc-payment-error',
noticeContexts.PAYMENTS
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts
index bf34414627b..c88721384fa 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/use-forced-layout/index.ts
@@ -113,7 +113,7 @@ export const useForcedLayout = ( {
} );
registry.batch( () => {
- registry
+ void registry
.dispatch( 'core/block-editor' )
.insertBlocks( blockConfig, insertAtPosition, clientId );
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx
index f8c8138107b..7495be9834e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/block.tsx
@@ -90,13 +90,15 @@ const Block = ( {
href={ filteredLink }
disabled={ isCalculating || cartIsLoading }
onClick={ ( e ) => {
- dispatchOnProceedToCheckout().then( ( observerResponses ) => {
- if ( observerResponses.some( isErrorResponse ) ) {
- e.preventDefault();
- return;
+ void dispatchOnProceedToCheckout().then(
+ ( observerResponses ) => {
+ if ( observerResponses.some( isErrorResponse ) ) {
+ e.preventDefault();
+ return;
+ }
+ setShowSpinner( true );
}
- setShowSpinner( true );
- } );
+ );
} }
>
{ showSpinner && <Spinner /> }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/block.tsx
index 33cd7ceb4b1..1d8a76d4e76 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/block.tsx
@@ -121,7 +121,7 @@ const ScrollOnError = ( {
useEffect( () => {
let scrollToTopTimeout: number;
if ( hasErrorsToDisplay ) {
- showAllValidationErrors();
+ void showAllValidationErrors();
// Scroll after a short timeout to allow a re-render. This will allow focusableSelector to match updated components.
scrollToTopTimeout = window.setTimeout( () => {
scrollToTop( {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-additional-information-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-additional-information-block/block.tsx
index e3cd407c388..c74a9a88d50 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-additional-information-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-additional-information-block/block.tsx
@@ -22,7 +22,7 @@ const Block = () => {
const { setAdditionalFields } = useDispatch( checkoutStore );
const onChangeForm = ( additionalValues: OrderFormValues ) => {
- setAdditionalFields( additionalValues );
+ void setAdditionalFields( additionalValues );
};
const additionalFieldValues = {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx
index 4e2f0f74594..47cba2f2a88 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx
@@ -75,8 +75,8 @@ const CreateAccountUI = (): React.ReactElement | null => {
) }
checked={ shouldCreateAccount }
onChange={ ( value ) => {
- __internalSetShouldCreateAccount( value );
- __internalSetCustomerPassword( '' );
+ void __internalSetShouldCreateAccount( value );
+ void __internalSetCustomerPassword( '' );
} }
/>
) }
@@ -104,7 +104,7 @@ const Block = (): JSX.Element => {
const onChangeForm = ( newAddress: ContactFormValues ) => {
const { email, ...additionalValues } = newAddress;
onChangeEmail( email );
- setAdditionalFields( additionalValues );
+ void setAdditionalFields( additionalValues );
};
const contactFormValues = {
email: billingAddress.email,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/create-password.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/create-password.tsx
index c0d28548850..93d5d79b837 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/create-password.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/create-password.tsx
@@ -25,7 +25,7 @@ const CreatePassword = () => {
return;
}
if ( passwordStrength < 2 ) {
- setValidationErrors( {
+ void setValidationErrors( {
'account-password': {
message: __(
'Please create a stronger password',
@@ -36,7 +36,7 @@ const CreatePassword = () => {
} );
return;
}
- clearValidationError( 'account-password' );
+ void clearValidationError( 'account-password' );
}, [
clearValidationError,
customerPassword,
@@ -53,10 +53,10 @@ const CreatePassword = () => {
required={ true }
errorId={ 'account-password' }
onChange={ ( value: string ) => {
- __internalSetCustomerPassword( value );
+ void __internalSetCustomerPassword( value );
if ( ! value ) {
- setValidationErrors( {
+ void setValidationErrors( {
'account-password': {
message: __(
'Please enter a valid password',
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx
index f28f9727df9..41ecc25c1ae 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/block.tsx
@@ -109,11 +109,11 @@ const ShippingSelector = ( {
useDispatch( validationStore );
useEffect( () => {
if ( checked === 'shipping' && ! hasShippingPrices ) {
- setValidationErrors( {
+ void setValidationErrors( {
'shipping-rates-error': SHIPPING_RATE_ERROR,
} );
} else {
- clearValidationError( 'shipping-rates-error' );
+ void clearValidationError( 'shipping-rates-error' );
}
return () => clearValidationError( 'shipping-rates-error' );
}, [
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/edit.tsx
index 8dd1886c51f..fa2eaa175cd 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/edit.tsx
@@ -198,9 +198,9 @@ export const Edit = ( {
const changeView = ( method: string ) => {
if ( method === 'pickup' ) {
- setPrefersCollection( true );
+ void setPrefersCollection( true );
} else {
- setPrefersCollection( false );
+ void setPrefersCollection( false );
}
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/frontend.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/frontend.tsx
index df703ce56f4..6aeeef1ebe1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/frontend.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/frontend.tsx
@@ -72,9 +72,9 @@ const FrontendBlock = ( {
const onChange = ( method: string ) => {
if ( method === 'pickup' ) {
- setPrefersCollection( true );
+ void setPrefersCollection( true );
} else {
- setPrefersCollection( false );
+ void setPrefersCollection( false );
// When switching to Ship, if no non-pickup shipping rates are
// available (hidden because no address entered), clear the pickup
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx
index c4a9a8a8314..74e49859d44 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/frontend.tsx
@@ -59,9 +59,9 @@ const FrontendBlock = ( {
return;
}
if ( checked ) {
- clearValidationError( validationErrorId );
+ void clearValidationError( validationErrorId );
} else {
- setValidationErrors( {
+ void setValidationErrors( {
[ validationErrorId ]: {
message: __(
'Please read and accept the terms and conditions.',
@@ -72,7 +72,7 @@ const FrontendBlock = ( {
} );
}
return () => {
- clearValidationError( validationErrorId );
+ void clearValidationError( validationErrorId );
};
}, [
checkbox,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-shortcode/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-shortcode/index.tsx
index 19f0a2367e3..3015000dbd3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-shortcode/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-shortcode/index.tsx
@@ -83,7 +83,7 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
replaceBlock,
selectBlock,
} );
- createInfoNotice(
+ void createInfoNotice(
__(
'Classic shortcode transformed to blocks.',
'woocommerce'
@@ -109,7 +109,7 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
if ( ! cartCheckoutBlock ) {
return;
}
- replaceBlock(
+ void replaceBlock(
cartCheckoutBlock.clientId,
createBlock(
'woocommerce/classic-shortcode',
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/index.tsx
index 1cbfef3ede7..1d45cd0dc6c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/index.tsx
@@ -96,7 +96,7 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
replaceBlock,
selectBlock,
} );
- createInfoNotice(
+ void createInfoNotice(
__(
'Template transformed into blocks!',
'woocommerce'
@@ -110,7 +110,7 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
getBlocks()
);
- replaceBlocks(
+ void replaceBlocks(
clientIds,
createBlock(
'core/group',
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-update-button-attributes.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-update-button-attributes.tsx
index 4adcd75e33b..5a0dfeafb99 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-update-button-attributes.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-update-button-attributes.tsx
@@ -84,7 +84,7 @@ export const withUpdateButtonAttributes =
url &&
permalink !== url
) {
- updateBlockAttributes( buttonBlockId, {
+ void updateBlockAttributes( buttonBlockId, {
url: permalink,
} );
setDoUrlUpdate( false );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/upgrade.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/upgrade.tsx
index 77a36b83d32..3bfc49b38d8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/upgrade.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/upgrade.tsx
@@ -37,9 +37,9 @@ export const UpgradeNotice = ( { clientId }: { clientId: string } ) => {
const newBlock = createBlock( 'woocommerce/product-filters' );
if ( blockParent.length ) {
- replaceBlock( blockParent[ 0 ], newBlock );
+ void replaceBlock( blockParent[ 0 ], newBlock );
} else {
- replaceBlock( clientId, newBlock );
+ void replaceBlock( clientId, newBlock );
}
const legacyFilterBlockWrapper = getBlocksByName(
@@ -49,13 +49,13 @@ export const UpgradeNotice = ( { clientId }: { clientId: string } ) => {
// We want to remove all the legacy filter blocks on the page.
legacyFilterBlockWrapper.forEach( ( blockId: string ) => {
// We need to disable locked blocks first.
- updateBlockAttributes( blockId, {
+ void updateBlockAttributes( blockId, {
lock: {
remove: false,
},
} );
- removeBlock( blockId );
+ void removeBlock( blockId );
} );
// These are the v1 legacy filters without the wrapper block.
@@ -71,18 +71,18 @@ export const UpgradeNotice = ( { clientId }: { clientId: string } ) => {
if ( block.length ) {
// We need to disable locked blocks first.
- updateBlockAttributes( block[ 0 ], {
+ void updateBlockAttributes( block[ 0 ], {
lock: {
remove: false,
},
} );
- removeBlock( block[ 0 ] );
+ void removeBlock( block[ 0 ] );
}
} );
// Make sure to put the focus on the newly added Product Filters block.
- selectBlock( newBlock.clientId );
+ void selectBlock( newBlock.clientId );
};
return (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/hand-picked-products-control.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/hand-picked-products-control.tsx
index f72e1f9eb43..640e4f3392d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/hand-picked-products-control.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/hand-picked-products-control.tsx
@@ -67,7 +67,7 @@ function useProducts(
per_page: 100,
},
};
- getProducts( query ).then( ( results ) => {
+ void getProducts( query ).then( ( results ) => {
const newProductsMap = new Map();
( results as ProductResponseItem[] ).forEach( ( product ) => {
newProductsMap.set( product.id, product );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/order-by-control/default-query-order-by-control.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/order-by-control/default-query-order-by-control.tsx
index a2565233c6e..0c5ff10955c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/order-by-control/default-query-order-by-control.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/order-by-control/default-query-order-by-control.tsx
@@ -60,9 +60,14 @@ const DefaultQueryOrderByControl = ( {
const onChange = ( newValue: string ) => {
setValue( newValue );
- dispatch( coreStore ).editEntityRecord( 'root', 'site', undefined, {
- [ `woocommerce_default_catalog_orderby` ]: newValue,
- } );
+ void dispatch( coreStore ).editEntityRecord(
+ 'root',
+ 'site',
+ undefined,
+ {
+ [ `woocommerce_default_catalog_orderby` ]: newValue,
+ }
+ );
trackInteraction( CoreFilterNames.DEFAULT_ORDER );
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-heading-adjustments.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-heading-adjustments.ts
index 937f5f39df6..f1e17fd7868 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-heading-adjustments.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-heading-adjustments.ts
@@ -51,7 +51,7 @@ const useEmailHeadingAdjustments = ( clientId: string ) => {
headingBlocks.forEach( ( headingBlock: Block ) => {
if ( headingBlock && headingBlock.clientId ) {
try {
- actions.removeBlock( headingBlock.clientId );
+ void actions.removeBlock( headingBlock.clientId );
} catch ( error ) {
// Silently handle cases where block might already be removed
// or in an inconsistent state during block editor operations
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-pagination-adjustments.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-pagination-adjustments.ts
index ceb22fd67e0..eabef5a5b6f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-pagination-adjustments.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/use-email-pagination-adjustments.ts
@@ -64,7 +64,7 @@ const useEmailPaginationAdjustments = (
paginationBlocks.forEach( ( paginationBlock: Block ) => {
if ( paginationBlock && paginationBlock.clientId ) {
try {
- actions.removeBlock( paginationBlock.clientId );
+ void actions.removeBlock( paginationBlock.clientId );
} catch ( error ) {
// Silently handle cases where block might already be removed
// or in an inconsistent state during block editor operations
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/utils.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/utils.tsx
index 62daf105787..ee48b5339ed 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/utils.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/utils.tsx
@@ -620,7 +620,7 @@ export const useGetProduct = ( productId: number | undefined ) => {
}
};
- fetchProduct();
+ void fetchProduct();
}, [ productId ] );
return { product, isLoading };
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/edit.tsx
index 1c1b22e9a6a..6159620b609 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/edit.tsx
@@ -139,7 +139,7 @@ const Edit = ( {
isAdditionalProductDataEmpty( product ) &&
accordionItemClientId
) {
- removeBlock( accordionItemClientId );
+ void removeBlock( accordionItemClientId );
}
}, [ wasBlockJustInserted, accordionItemClientId, product, removeBlock ] );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/frontend.ts
index 9dc1fce5d4b..7f63f63fe48 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/frontend.ts
@@ -208,7 +208,7 @@ const productFiltersStore = {
} else {
selectFilter( item );
}
- actions.navigate();
+ void actions.navigate();
},
*navigate() {
const context = getServerContext
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/active-filters/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/active-filters/frontend.ts
index 3ed35755697..5d1861f56c7 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/active-filters/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/active-filters/frontend.ts
@@ -46,7 +46,7 @@ const activeFiltersStore = {
removeAll: () => {
const context = getContext< ProductFiltersContext >();
context.activeFilters = [];
- actions.navigate();
+ void actions.navigate();
},
remove: () => {
const { item } = getContext< RemovableItemContext >();
@@ -54,7 +54,7 @@ const activeFiltersStore = {
( filter ) =>
filter.value === item.value && filter.type === item.type
);
- actions.navigate();
+ void actions.navigate();
},
},
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/frontend.ts
index adec56da502..4cbd554059b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-slider/frontend.ts
@@ -57,14 +57,14 @@ const productFilterPriceSliderStore = {
debounceSetMinPrice: debounceWithScope(
( e: HTMLElementEvent< HTMLInputElement > ) => {
actions.setMin( e );
- actions.navigate();
+ void actions.navigate();
},
1000
),
debounceSetMaxPrice: debounceWithScope(
( e: HTMLElementEvent< HTMLInputElement > ) => {
actions.setMax( e );
- actions.navigate();
+ void actions.navigate();
},
1000
),
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/product-selector.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/product-selector.tsx
index ed284a37371..38208c6c103 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/product-selector.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/product-selector.tsx
@@ -24,7 +24,7 @@ function useProductsList() {
);
useEffect( () => {
- getProducts( { selected: [] } ).then( ( results ) => {
+ void getProducts( { selected: [] } ).then( ( results ) => {
setProductsList( results as ProductResponseItem[] );
} );
}, [] );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-form/form.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-form/form.tsx
index b017d44dc7b..97ed6bc71e9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-form/form.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-form/form.tsx
@@ -84,7 +84,7 @@ const CommentsForm = ( {
const setReviewsAllowed = ( allowed: boolean ) => {
if ( ! postId ) return;
- updateProduct( Number( postId ), {
+ void updateProduct( Number( postId ), {
reviews_allowed: allowed,
} );
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/index.tsx
index 442a716920b..4f23a341365 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/index.tsx
@@ -79,7 +79,7 @@ const DeprecatedBlockEdit = ( { clientId }: { clientId: string } ) => {
);
const updateBlock = () => {
- replaceBlocks(
+ void replaceBlocks(
clientId,
createBlock( 'core/search', {
label:
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/use-placeholder-products.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/use-placeholder-products.ts
index 2cde9354617..e60819f6db2 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/use-placeholder-products.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/use-placeholder-products.ts
@@ -186,7 +186,7 @@ export const usePlaceholderProducts = ( {
// Inject into both entity stores.
// Args: kind, name, records, query, invalidateCache, edits, meta.
- storeActions.receiveEntityRecords(
+ void storeActions.receiveEntityRecords(
'postType',
'product',
wpEntities,
@@ -195,7 +195,7 @@ export const usePlaceholderProducts = ( {
null,
null
);
- storeActions.receiveEntityRecords(
+ void storeActions.receiveEntityRecords(
'root',
'product',
wcEntities,
@@ -210,22 +210,22 @@ export const usePlaceholderProducts = ( {
// resolver) and getEditedEntityRecord (checked by useProduct
// hook's hasFinishedResolution) need to be finished.
for ( const id of placeholderIds ) {
- storeActions.finishResolution( 'getEntityRecord', [
+ void storeActions.finishResolution( 'getEntityRecord', [
'root',
'product',
id,
] );
- storeActions.finishResolution( 'getEntityRecord', [
+ void storeActions.finishResolution( 'getEntityRecord', [
'postType',
'product',
id,
] );
- storeActions.finishResolution( 'getEditedEntityRecord', [
+ void storeActions.finishResolution( 'getEditedEntityRecord', [
'root',
'product',
id,
] );
- storeActions.finishResolution( 'getEditedEntityRecord', [
+ void storeActions.finishResolution( 'getEditedEntityRecord', [
'postType',
'product',
id,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/single-product/edit/layout-editor.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/single-product/edit/layout-editor.tsx
index e88d1319411..58b73fe4d50 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/single-product/edit/layout-editor.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/single-product/edit/layout-editor.tsx
@@ -41,7 +41,7 @@ const LayoutEditor = ( {
const { replaceInnerBlocks } = useDispatch( 'core/block-editor' );
const resetInnerBlocks = useCallback( () => {
- replaceInnerBlocks(
+ void replaceInnerBlocks(
clientId,
createBlocksFromInnerBlocksTemplate( DEFAULT_INNER_BLOCKS ),
false
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/cart/index.ts b/plugins/woocommerce/client/blocks/assets/js/data/cart/index.ts
index c6f4bcfe35a..dd636202e85 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/cart/index.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/cart/index.ts
@@ -70,7 +70,7 @@ window.addEventListener( 'load', () => {
! isEditor() // Don't finish resolution in editor,but only for real carts
) {
// Prevent the API request from being made.
- wpDispatch( store ).finishResolution( 'getCartData' );
+ void wpDispatch( store ).finishResolution( 'getCartData' );
}
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/cart/thunks.ts b/plugins/woocommerce/client/blocks/assets/js/data/cart/thunks.ts
index 0b455a53ba7..d77056087d3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/cart/thunks.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/cart/thunks.ts
@@ -150,7 +150,7 @@ const syncPrefersCollectionFromSelectedShippingRates = (
.map( ( rate ) => rate.method_id );
if ( selectedMethodIds?.length ) {
- registry
+ void registry
.dispatch( checkoutStore )
.setPrefersCollection( hasCollectableRate( selectedMethodIds ) );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/checkout/thunks.ts b/plugins/woocommerce/client/blocks/assets/js/data/checkout/thunks.ts
index 30aee31fc96..bdde633af7f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/checkout/thunks.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/checkout/thunks.ts
@@ -56,11 +56,15 @@ export const __internalProcessCheckoutResponse = (
) => {
return ( { dispatch }: CheckoutThunkArgs ) => {
const paymentResult = getPaymentResultFromCheckoutResponse( response );
- dispatch.__internalSetRedirectUrl( paymentResult?.redirectUrl || '' );
+ void dispatch.__internalSetRedirectUrl(
+ paymentResult?.redirectUrl || ''
+ );
// The local `dispatch` here is bound to the actions of the data store. We need to use the global dispatch here
// to dispatch an action on a different store.
- wpDispatch( paymentStore ).__internalSetPaymentResult( paymentResult );
- dispatch.__internalSetAfterProcessing();
+ void wpDispatch( paymentStore ).__internalSetPaymentResult(
+ paymentResult
+ );
+ void dispatch.__internalSetAfterProcessing();
};
};
@@ -74,7 +78,7 @@ export const __internalEmitValidateEvent: emitValidateEventType = ( {
return ( { dispatch, registry }: CheckoutThunkArgs ) => {
const { createErrorNotice } = registry.dispatch( noticesStore );
removeNoticesByStatus( 'error' );
- checkoutEventsEmitter
+ void checkoutEventsEmitter
.emit( CHECKOUT_EVENTS.CHECKOUT_VALIDATION )
.then( ( responses ) => {
// If responses length is 0, then no observer returned a response that wasn't `true` or void, therefore,
@@ -84,7 +88,7 @@ export const __internalEmitValidateEvent: emitValidateEventType = ( {
responses.length === 0 ||
responses.every( isSuccessResponse )
) {
- dispatch.__internalSetProcessing();
+ void dispatch.__internalSetProcessing();
return;
}
// If any observer returned a response, by this point we know that it's either failure or error due to
@@ -103,7 +107,7 @@ export const __internalEmitValidateEvent: emitValidateEventType = ( {
typeof errorMessage === 'string' &&
errorMessage
) {
- createErrorNotice( errorMessage, { context } );
+ void createErrorNotice( errorMessage, { context } );
}
if (
isValidValidationErrorsObject( validationErrors )
@@ -112,8 +116,8 @@ export const __internalEmitValidateEvent: emitValidateEventType = ( {
}
}
);
- dispatch.__internalSetIdle();
- dispatch.__internalSetHasError();
+ void dispatch.__internalSetIdle();
+ void dispatch.__internalSetHasError();
} );
};
};
@@ -137,7 +141,7 @@ export const __internalEmitAfterProcessingEvents: emitAfterProcessingEventsType
if ( select.hasError() ) {
// allow payment methods or other things to customize the error
// with a fallback if nothing customizes it.
- checkoutEventsEmitter
+ void checkoutEventsEmitter
.emitWithAbort( CHECKOUT_EVENTS.CHECKOUT_FAIL, data )
.then( ( observerResponses ) => {
runCheckoutFailObservers( {
@@ -149,7 +153,7 @@ export const __internalEmitAfterProcessingEvents: emitAfterProcessingEventsType
} );
} );
} else {
- checkoutEventsEmitter
+ void checkoutEventsEmitter
.emitWithAbort( CHECKOUT_EVENTS.CHECKOUT_SUCCESS, data )
.then( ( observerResponses ) => {
runCheckoutSuccessObservers( {
@@ -184,13 +188,13 @@ export const updateDraftOrder = ( data: CheckoutPutData ) => {
export const disableCheckoutFor = ( asyncFunc: () => Promise< unknown > ) => {
return async ( { dispatch }: CheckoutThunkArgs ) => {
- dispatch.__internalStartCalculation();
+ void dispatch.__internalStartCalculation();
try {
return await asyncFunc();
// No catch block here as we don't want to swallow any potential errors
// coming from asyncFunc.
} finally {
- dispatch.__internalFinishCalculation();
+ void dispatch.__internalFinishCalculation();
}
};
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/checkout/utils.ts b/plugins/woocommerce/client/blocks/assets/js/data/checkout/utils.ts
index ad272737779..264ada28666 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/checkout/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/checkout/utils.ts
@@ -101,9 +101,9 @@ export const runCheckoutFailObservers = ( {
if ( errorResponse !== null ) {
// irrecoverable error so set complete
if ( ! shouldRetry( errorResponse ) ) {
- dispatch.__internalSetComplete( errorResponse );
+ void dispatch.__internalSetComplete( errorResponse );
} else {
- dispatch.__internalSetIdle();
+ void dispatch.__internalSetIdle();
}
} else {
const hasErrorNotices =
@@ -131,7 +131,7 @@ export const runCheckoutFailObservers = ( {
} );
}
- dispatch.__internalSetIdle();
+ void dispatch.__internalSetIdle();
}
};
@@ -167,7 +167,7 @@ export const runCheckoutSuccessObservers = ( {
} );
if ( successResponse && ! errorResponse ) {
- dispatch.__internalSetComplete( successResponse );
+ void dispatch.__internalSetComplete( successResponse );
} else if ( isObject( errorResponse ) ) {
if ( errorResponse.message && isString( errorResponse.message ) ) {
const errorOptions =
@@ -180,16 +180,16 @@ export const runCheckoutSuccessObservers = ( {
createErrorNotice( errorResponse.message, errorOptions );
}
if ( ! shouldRetry( errorResponse ) ) {
- dispatch.__internalSetComplete( errorResponse );
+ void dispatch.__internalSetComplete( errorResponse );
} else {
// this will set an error which will end up
// triggering the onCheckoutFail emitter.
// and then setting checkout to IDLE state.
- dispatch.__internalSetHasError( true );
+ void dispatch.__internalSetHasError( true );
}
} else {
// nothing hooked in had any response type so let's just consider successful.
- dispatch.__internalSetComplete();
+ void dispatch.__internalSetComplete();
}
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/payment/thunks.ts b/plugins/woocommerce/client/blocks/assets/js/data/payment/thunks.ts
index 84cefbd1055..fde642d480d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/payment/thunks.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/payment/thunks.ts
@@ -50,12 +50,12 @@ export const __internalSetExpressPaymentError = ( message?: string ) => {
const { createErrorNotice, removeNotice } =
registry.dispatch( noticesStore );
if ( message ) {
- createErrorNotice( message, {
+ void createErrorNotice( message, {
id: 'wc-express-payment-error',
context: noticeContexts.EXPRESS_PAYMENTS,
} );
} else {
- removeNotice(
+ void removeNotice(
'wc-express-payment-error',
noticeContexts.EXPRESS_PAYMENTS
);
@@ -74,7 +74,7 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
const { createErrorNotice, removeNotice } =
registry.dispatch( noticesStore );
- removeNotice( 'wc-payment-error', noticeContexts.PAYMENTS );
+ void removeNotice( 'wc-payment-error', noticeContexts.PAYMENTS );
return emitEventWithAbort(
currentObserver,
EMIT_TYPES.PAYMENT_SETUP,
@@ -160,10 +160,10 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
setShippingAddress( shippingAddress );
}
- dispatch.__internalSetPaymentMethodData(
+ void dispatch.__internalSetPaymentMethodData(
isObject( paymentMethodData ) ? paymentMethodData : {}
);
- dispatch.__internalSetPaymentReady();
+ void dispatch.__internalSetPaymentReady();
} else if ( isFailResponse( errorResponse ) ) {
const { paymentMethodData } = errorResponse?.meta || {};
@@ -180,7 +180,7 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
) {
context = errorResponse.messageContext;
}
- createErrorNotice( errorResponse.message, {
+ void createErrorNotice( errorResponse.message, {
id: 'wc-payment-error',
isDismissible: false,
context,
@@ -191,10 +191,10 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
setBillingAddress( billingAddress );
}
- dispatch.__internalSetPaymentMethodData(
+ void dispatch.__internalSetPaymentMethodData(
isObject( paymentMethodData ) ? paymentMethodData : {}
);
- dispatch.__internalSetPaymentError();
+ void dispatch.__internalSetPaymentError();
} else if ( isErrorResponse( errorResponse ) ) {
if (
objectHasProp( errorResponse, 'message' ) &&
@@ -209,14 +209,14 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
) {
context = errorResponse.messageContext;
}
- createErrorNotice( errorResponse.message, {
+ void createErrorNotice( errorResponse.message, {
id: 'wc-payment-error',
isDismissible: false,
context,
} );
}
- dispatch.__internalSetPaymentError();
+ void dispatch.__internalSetPaymentError();
if (
isValidValidationErrorsObject(
@@ -227,7 +227,7 @@ export const __internalEmitPaymentProcessingEvent: emitProcessingEventType = (
}
} else {
// Otherwise there are no payment methods doing anything so just assume payment method is ready.
- dispatch.__internalSetPaymentReady();
+ void dispatch.__internalSetPaymentReady();
}
} );
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/check-payment-methods.ts b/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/check-payment-methods.ts
index 8edc1cb9e2f..d92e0bd9673 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/check-payment-methods.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/check-payment-methods.ts
@@ -287,6 +287,6 @@ export const checkPaymentMethodsCanPay = async ( express = false ) => {
? __internalSetAvailableExpressPaymentMethods
: __internalSetAvailablePaymentMethods;
- setCallback( availablePaymentMethods );
+ void setCallback( availablePaymentMethods );
return true;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/set-default-payment-method.ts b/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/set-default-payment-method.ts
index 2a8433da285..136a76fca48 100644
--- a/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/set-default-payment-method.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/data/payment/utils/set-default-payment-method.ts
@@ -43,7 +43,7 @@ export const setDefaultPaymentMethod = async (
const paymentMethodSlug = savedPaymentMethod.method.gateway;
const savedTokenKey = `wc-${ paymentMethodSlug }-payment-token`;
- dispatch( paymentStore ).__internalSetActivePaymentMethod(
+ void dispatch( paymentStore ).__internalSetActivePaymentMethod(
paymentMethodSlug,
{
token,
@@ -55,8 +55,8 @@ export const setDefaultPaymentMethod = async (
return;
}
- dispatch( paymentStore ).__internalSetPaymentIdle();
- dispatch( paymentStore ).__internalSetActivePaymentMethod(
+ void dispatch( paymentStore ).__internalSetPaymentIdle();
+ void dispatch( paymentStore ).__internalSetActivePaymentMethod(
paymentMethodKeys[ 0 ]
);
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/default-notice/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/default-notice/index.tsx
index 6bea20c78c3..708a4d3f7d8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/default-notice/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/default-notice/index.tsx
@@ -46,7 +46,7 @@ export function DefaultNotice( { block }: { block: string } ) {
const [ settingStatus, setStatus ] = useState( 'pristine' );
const updatePage = useCallback( () => {
setStatus( 'updating' );
- Promise.resolve()
+ void Promise.resolve()
.then( () =>
triggerFetch( {
path: `/wc/v3/settings/advanced/${ settingName }`,
@@ -60,7 +60,7 @@ export function DefaultNotice( { block }: { block: string } ) {
} )
.then( () => {
if ( ! postPublished ) {
- editPost( { status: 'publish' } );
+ void editPost( { status: 'publish' } );
return savePost();
}
} )
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/display-style-switcher/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/display-style-switcher/index.tsx
index 59211fd9475..4bcb172bc78 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/display-style-switcher/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/display-style-switcher/index.tsx
@@ -185,7 +185,7 @@ export const DisplayStyleSwitcher = ( {
setDisplayStyleBlocksAttributes(
nextDisplayStyleBlocksAttributes
);
- replaceBlock(
+ void replaceBlock(
currentStyleBlock.clientId,
createBlock(
value,
@@ -198,7 +198,7 @@ export const DisplayStyleSwitcher = ( {
getFallbackDisplayStyleInsertionPoint
);
- insertBlock(
+ void insertBlock(
createBlock( value ),
insertionPoint.index,
insertionPoint.rootClientId,
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/switch-to-classic-shortcode-button/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/switch-to-classic-shortcode-button/index.tsx
index 5ecaf40858b..b8ad092a75a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/switch-to-classic-shortcode-button/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/switch-to-classic-shortcode-button/index.tsx
@@ -78,7 +78,7 @@ export function SwitchToClassicShortcodeButton( {
} );
if ( classicShortcodeBlock ) {
- selectBlock( classicShortcodeBlock.clientId );
+ void selectBlock( classicShortcodeBlock.clientId );
}
};
@@ -88,12 +88,12 @@ export function SwitchToClassicShortcodeButton( {
};
const handleUndoClick = () => {
- undo();
+ void undo();
recordEvent( 'switch_to_classic_shortcode_undo', eventValue );
};
const handleSwitchClick = () => {
- replaceBlock(
+ void replaceBlock(
clientId,
createBlock( 'woocommerce/classic-shortcode', {
shortcode,
@@ -101,7 +101,7 @@ export function SwitchToClassicShortcodeButton( {
);
recordEvent( 'switch_to_classic_shortcode_confirm', eventValue );
selectClassicShortcodeBlock();
- createInfoNotice( snackbarLabel, {
+ void createInfoNotice( snackbarLabel, {
actions: [
{
label: __( 'Undo', 'woocommerce' ),
diff --git a/plugins/woocommerce/client/blocks/assets/js/entities/register-entities.ts b/plugins/woocommerce/client/blocks/assets/js/entities/register-entities.ts
index a71783f3634..d21acd42cf1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/entities/register-entities.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/entities/register-entities.ts
@@ -17,7 +17,7 @@ export const registerProductEntity = () => {
return;
}
const { addEntities } = dispatch( coreStore );
- addEntities( [ PRODUCT_ENTITY ] );
+ void addEntities( [ PRODUCT_ENTITY ] );
registered.push( PRODUCT_ENTITY.name );
};
@@ -26,6 +26,6 @@ export const registerSettingsEntity = () => {
return;
}
const { addEntities } = dispatch( coreStore );
- addEntities( [ SETTINGS_ENTITY ] );
+ void addEntities( [ SETTINGS_ENTITY ] );
registered.push( SETTINGS_ENTITY.name );
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/settings-context.tsx b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/settings-context.tsx
index 7b3d83c273b..cad4dbd5d23 100644
--- a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/settings-context.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/settings-context.tsx
@@ -156,7 +156,7 @@ export const SettingsProvider = ( {
data,
} )
.then( () => {
- dispatch( noticesStore ).createSuccessNotice(
+ void dispatch( noticesStore ).createSuccessNotice(
__(
'Local Pickup settings have been saved.',
'woocommerce'
@@ -165,7 +165,7 @@ export const SettingsProvider = ( {
} )
.catch( () => {
setIsDirty( true );
- dispatch( noticesStore ).createErrorNotice(
+ void dispatch( noticesStore ).createErrorNotice(
__(
'There was an error saving your Local Pickup settings. Please try again.',
'woocommerce'
diff --git a/plugins/woocommerce/client/blocks/packages/checkout/hooks/use-validate-checkout.ts b/plugins/woocommerce/client/blocks/packages/checkout/hooks/use-validate-checkout.ts
index e9471f77f01..d15761f98c0 100644
--- a/plugins/woocommerce/client/blocks/packages/checkout/hooks/use-validate-checkout.ts
+++ b/plugins/woocommerce/client/blocks/packages/checkout/hooks/use-validate-checkout.ts
@@ -76,13 +76,13 @@ export const useValidateCheckout = (): ( () => Promise< {
isFailResponse( response )
) {
if ( response.validationErrors ) {
- setValidationErrors( response.validationErrors );
+ void setValidationErrors( response.validationErrors );
}
}
} );
// Show all validation errors and scroll to the first one
- showAllValidationErrors();
+ void showAllValidationErrors();
window.setTimeout( scrollToFirstValidationError, 50 );
}
diff --git a/plugins/woocommerce/client/blocks/packages/components/checkbox-control/validated-checkbox-control.tsx b/plugins/woocommerce/client/blocks/packages/components/checkbox-control/validated-checkbox-control.tsx
index 9bfc88b945d..cddb9e4f0c1 100644
--- a/plugins/woocommerce/client/blocks/packages/components/checkbox-control/validated-checkbox-control.tsx
+++ b/plugins/woocommerce/client/blocks/packages/components/checkbox-control/validated-checkbox-control.tsx
@@ -122,11 +122,11 @@ const ValidatedCheckboxControl = forwardRef<
inputObject.checkValidity() &&
customValidationRef.current( inputObject )
) {
- clearValidationError( errorIdString );
+ void clearValidationError( errorIdString );
return;
}
- setValidationErrors( {
+ void setValidationErrors( {
[ errorIdString ]: {
message: getValidityMessageForInput(
label,
@@ -174,7 +174,7 @@ const ValidatedCheckboxControl = forwardRef<
// Remove validation errors when unmounted.
useEffect( () => {
return () => {
- clearValidationError( errorIdString );
+ void clearValidationError( errorIdString );
};
}, [ clearValidationError, errorIdString ] );
diff --git a/plugins/woocommerce/client/blocks/packages/components/text-input/validated-text-input.tsx b/plugins/woocommerce/client/blocks/packages/components/text-input/validated-text-input.tsx
index 56862d1acac..ede8a4602fd 100644
--- a/plugins/woocommerce/client/blocks/packages/components/text-input/validated-text-input.tsx
+++ b/plugins/woocommerce/client/blocks/packages/components/text-input/validated-text-input.tsx
@@ -126,12 +126,12 @@ const ValidatedTextInput = forwardRef<
customValidationRef.current( inputObject ) &&
errorsHidden
) {
- clearValidationError( errorIdString );
+ void clearValidationError( errorIdString );
return;
}
if ( ! errorsHidden ) {
- showValidationError( errorIdString );
+ void showValidationError( errorIdString );
}
const validityMessage = getValidityMessageForInput(
@@ -141,7 +141,7 @@ const ValidatedTextInput = forwardRef<
);
if ( validityMessage ) {
- setValidationErrors( {
+ void setValidationErrors( {
[ errorIdString ]: {
message: validityMessage,
hidden: errorsHidden,
@@ -249,7 +249,7 @@ const ValidatedTextInput = forwardRef<
// Remove validation errors when unmounted.
useEffect( () => {
return () => {
- clearValidationError( errorIdString );
+ void clearValidationError( errorIdString );
};
}, [ clearValidationError, errorIdString ] );
@@ -288,7 +288,7 @@ const ValidatedTextInput = forwardRef<
ref={ inputRef }
onChange={ ( newValue ) => {
// Hide errors while typing.
- hideValidationError( errorIdString );
+ void hideValidationError( errorIdString );
// Validate the input value.
validateInput( true );
diff --git a/plugins/woocommerce/client/blocks/tsconfig.json b/plugins/woocommerce/client/blocks/tsconfig.json
index 2fee74c3d50..3771cbe9813 100644
--- a/plugins/woocommerce/client/blocks/tsconfig.json
+++ b/plugins/woocommerce/client/blocks/tsconfig.json
@@ -6,6 +6,7 @@
"./assets/js/**/*.json",
"./packages/checkout/**/*",
"./packages/components/**/*",
+ "./packages/prices/**/*",
"./assets/js/blocks/**/block.json",
"./assets/js/atomic/blocks/**/block.json",
"./assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/**/block.json",
diff --git a/tools/code-analyzer/tsconfig.json b/tools/code-analyzer/tsconfig.json
index dba65d041b6..86d8e3bdc64 100644
--- a/tools/code-analyzer/tsconfig.json
+++ b/tools/code-analyzer/tsconfig.json
@@ -13,6 +13,7 @@
"files": true,
},
"include": [
+ "index.ts",
"src/**/*"
]
}
diff --git a/tools/eslint-config/index.js b/tools/eslint-config/index.js
index fe893723de5..ba03f2d9564 100644
--- a/tools/eslint-config/index.js
+++ b/tools/eslint-config/index.js
@@ -98,6 +98,22 @@ const RELAXED_TEST_RULES = {
'jest/valid-expect': 'warn',
};
+/*
+ * The project service parse-errors on any linted file its tsconfig omits, so keep
+ * the type-aware block off the files packages exclude from their tsconfigs.
+ */
+const TYPE_AWARE_IGNORES = [
+ '**/test/**',
+ '**/tests/**',
+ '**/__tests__/**',
+ '**/__mocks__/**',
+ '**/*.test.[jt]s?(x)',
+ '**/stories/**',
+ '**/*.stories.[jt]s?(x)',
+ '**/typings/**',
+ '**/*.d.ts',
+];
+
/*
* The monorepo's own ESLint Flat Config layer.
*
@@ -120,4 +136,16 @@ module.exports = [
files: TEST_FILES,
rules: RELAXED_TEST_RULES,
},
+ {
+ files: [ '**/*.ts', '**/*.tsx' ],
+ ignores: TYPE_AWARE_IGNORES,
+ languageOptions: {
+ parserOptions: {
+ projectService: true,
+ },
+ },
+ rules: {
+ '@typescript-eslint/no-floating-promises': 'error',
+ },
+ },
];
diff --git a/tools/monorepo-merge/src/commands/transfer-issues/index.ts b/tools/monorepo-merge/src/commands/transfer-issues/index.ts
index 2d084d04cf0..072b97e1606 100644
--- a/tools/monorepo-merge/src/commands/transfer-issues/index.ts
+++ b/tools/monorepo-merge/src/commands/transfer-issues/index.ts
@@ -162,20 +162,38 @@ export default class TransferIssues extends Command {
CliUx.ux.action.stop();
CliUx.ux.action.start( 'Running post-transfer tasks' );
+ const postTransferFailures: string[] = [];
for ( const issue of issuesToTransfer ) {
if ( ! issue.newID ) {
continue;
}
- this.resetProjectFields( authenticatedGraphQL, issue );
+ /*
+ * These are awaited so failures surface, but one issue failing must
+ * not leave the remaining transferred issues unprocessed.
+ */
+ try {
+ await this.resetProjectFields( authenticatedGraphQL, issue );
+
+ await this.addLabelsToIssue(
+ authenticatedGraphQL,
+ issue.newID,
+ labelsToAdd
+ );
+ } catch ( error ) {
+ postTransferFailures.push(
+ `${ issue.title }: ${ ( error as Error ).message }`
+ );
+ }
+ }
+ CliUx.ux.action.stop();
- this.addLabelsToIssue(
- authenticatedGraphQL,
- issue.newID,
- labelsToAdd
+ if ( postTransferFailures.length > 0 ) {
+ this.log(
+ 'Post-transfer tasks failed for:\n' +
+ postTransferFailures.join( '\n' )
);
}
- CliUx.ux.action.stop();
this.log(
'Successfully transferred ' +
diff --git a/tools/monorepo-utils/src/code-freeze/commands/accelerated-prep/index.ts b/tools/monorepo-utils/src/code-freeze/commands/accelerated-prep/index.ts
index 9b78fcf34be..4aa2357c63e 100644
--- a/tools/monorepo-utils/src/code-freeze/commands/accelerated-prep/index.ts
+++ b/tools/monorepo-utils/src/code-freeze/commands/accelerated-prep/index.ts
@@ -116,8 +116,8 @@ export const acceleratedPrepCommand = new Command( 'accelerated-prep' )
Logger.notice(
`Adding Woo header to main plugin file and creating changelog.txt on ${ workingBranch } branch`
);
- addHeader( tmpRepoPath );
- createChangelog( tmpRepoPath, version, date );
+ await addHeader( tmpRepoPath );
+ await createChangelog( tmpRepoPath, version, date );
if ( dryRun ) {
const diff = await git.diffSummary();
diff --git a/tools/monorepo-utils/src/index.ts b/tools/monorepo-utils/src/index.ts
index ef5ebf89c93..4d8bab14ab3 100755
--- a/tools/monorepo-utils/src/index.ts
+++ b/tools/monorepo-utils/src/index.ts
@@ -59,4 +59,4 @@ const run = async () => {
}
};
-run();
+void run();