Commit c19171bcdd7 for woocommerce
commit c19171bcdd7958fae6f32fd13174ac46afde8bce
Author: Luigi Teschio <gigitux@gmail.com>
Date: Thu Oct 8 10:12:24 2026 +0200
Upgrade `@wordpress/prettier-config` and `wp-prettier` (#69365)
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* update prettier configuration
* update configuration
* refresh pnpm-lock
* restore prettier version
* refresh pnpm-lock
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* update prettier configuration
* update configuration
* refresh pnpm-lock
* restore prettier version
* refresh pnpm-lock
* remove conf
* update conf and prettier version
* format code
* lint code
* format code
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* update conf and prettier version
* format code
* lint code
* format code
* refresh pnpm-lock.yaml
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* fix eslint error
* lint code
* lint code
* refresh pnpm-lock
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* lint code
* lint code
* restore php changes
* fix unit test
* Fix Syncpack workspace discovery and dependency rules
* update syncpackrc
* update configuration
* update dependencies
* format code
* remove parenthesis
* fix: add whitespace in category and tags prefixes for translation consistency
* restore changes
* restore change
* restore trailing whitespace for translation consistency
* refresh pnpm-lock.yaml
* lint new code
diff --git a/package.json b/package.json
index aad69e74990..ce67ebce86e 100644
--- a/package.json
+++ b/package.json
@@ -64,7 +64,7 @@
"moment": "^2.29.4",
"node-stream-zip": "^1.15.0",
"postcss-loader": "4.3.x",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"regenerator-runtime": "^0.13.11",
"rimraf": "5.0.5",
"sass": "^1.69.5",
diff --git a/packages/js/components/src/advanced-filters/attribute-filter.tsx b/packages/js/components/src/advanced-filters/attribute-filter.tsx
index 9781470aee8..9fa377b7e73 100644
--- a/packages/js/components/src/advanced-filters/attribute-filter.tsx
+++ b/packages/js/components/src/advanced-filters/attribute-filter.tsx
@@ -66,7 +66,7 @@ const getScreenReaderText = ( {
const rule: Partial< FilterRule > = Array.isArray( config.rules )
? config.rules.find(
( configRule ) => configRule.value === filter.rule
- ) || {}
+ ) || {}
: {};
const attributeName = selectedAttribute[ 0 ].label;
diff --git a/packages/js/components/src/advanced-filters/number-filter.tsx b/packages/js/components/src/advanced-filters/number-filter.tsx
index 39218e53705..528d2532182 100644
--- a/packages/js/components/src/advanced-filters/number-filter.tsx
+++ b/packages/js/components/src/advanced-filters/number-filter.tsx
@@ -170,17 +170,17 @@ class NumberFilter extends Component< NumberFilterProps > {
const labelFormat =
filter.rule === 'lessthan'
? /* translators: Sentence fragment, "maximum amount" refers to a numeric value the field must be less than. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ */
- _x(
+ _x(
'%(field)s maximum amount',
'maximum value input',
'woocommerce'
- )
+ )
: /* translators: Sentence fragment, "minimum amount" refers to a numeric value the field must be more than. Screenshot for context: https://cloudup.com/cmv5CLyMPNQ */
- _x(
+ _x(
'%(field)s minimum amount',
'minimum value input',
'woocommerce'
- );
+ );
return this.getFormControl( {
type: inputType,
diff --git a/packages/js/components/src/advanced-filters/types.ts b/packages/js/components/src/advanced-filters/types.ts
index f48812d23f5..3e4b1c512f3 100644
--- a/packages/js/components/src/advanced-filters/types.ts
+++ b/packages/js/components/src/advanced-filters/types.ts
@@ -71,10 +71,7 @@ export type AdvancedFilterConfig = {
* Range filters hold `[ start, end ]` while either end may still be unset.
*/
export type ActiveFilterValue =
- | string
- | number
- | Array< string | number | null | undefined >
- | null;
+ string | number | Array< string | number | null | undefined > | null;
export type ActiveFilter = {
key: string;
@@ -92,11 +89,7 @@ export type FilterChange = {
export type OnFilterChange = ( change: FilterChange ) => void;
export type AdvancedFilterAction =
- | 'add'
- | 'remove'
- | 'match'
- | 'filter'
- | 'clear_all';
+ 'add' | 'remove' | 'match' | 'filter' | 'clear_all';
/**
* `getCurrencyConfig()` returns `symbolPosition` as a plain string, so this stays
diff --git a/packages/js/components/src/analytics/error/test/index.test.js b/packages/js/components/src/analytics/error/test/index.test.js
index d01f55c8724..96c08f11d9d 100644
--- a/packages/js/components/src/analytics/error/test/index.test.js
+++ b/packages/js/components/src/analytics/error/test/index.test.js
@@ -41,7 +41,7 @@ describe( 'AnalyticsError', () => {
).toBeInTheDocument();
} );
- it( 'refreshes the page when Reload Page button is clicked', () => {
+ it( 'refreshes the page when Reload Page button is clicked', async () => {
const reloadMock = jest.fn();
Object.defineProperty( window.location, 'reload', {
configurable: true,
@@ -50,7 +50,7 @@ describe( 'AnalyticsError', () => {
render( <AnalyticsError /> );
- userEvent.click( screen.getByText( 'Reload' ) );
+ await userEvent.click( screen.getByText( 'Reload' ) );
expect( reloadMock ).toHaveBeenCalled();
} );
diff --git a/packages/js/components/src/chart/d3chart/chart.js b/packages/js/components/src/chart/d3chart/chart.js
index e3412e6f157..5f84a536959 100644
--- a/packages/js/components/src/chart/d3chart/chart.js
+++ b/packages/js/components/src/chart/d3chart/chart.js
@@ -155,10 +155,10 @@ class D3Chart extends Component {
this.createTooltip( g.node(), params.getColor, params.visibleKeys );
drawAxis( g, params, scales, formats, margin, isRTL() );
- // eslint-disable-next-line no-unused-expressions
+
chartType === 'line' &&
drawLines( g, data, params, scales, formats, this.tooltip );
- // eslint-disable-next-line no-unused-expressions
+
chartType === 'bar' &&
drawBars( g, data, params, scales, formats, this.tooltip );
}
diff --git a/packages/js/components/src/chart/d3chart/d3base/index.js b/packages/js/components/src/chart/d3chart/d3base/index.js
index a6010239132..e80f059d88a 100644
--- a/packages/js/components/src/chart/d3chart/d3base/index.js
+++ b/packages/js/components/src/chart/d3chart/d3base/index.js
@@ -52,7 +52,6 @@ export default class D3Base extends Component {
delayedScroll() {
const { tooltip } = this.props;
return throttle( () => {
- // eslint-disable-next-line no-unused-expressions
tooltip && tooltip.hide();
}, 300 );
}
diff --git a/packages/js/components/src/chart/d3chart/legend.js b/packages/js/components/src/chart/d3chart/legend.js
index 74aa501833a..9ae1d320175 100644
--- a/packages/js/components/src/chart/d3chart/legend.js
+++ b/packages/js/components/src/chart/d3chart/legend.js
@@ -122,7 +122,7 @@ class D3Legend extends Component {
'woocommerce'
),
selectionLimit
- )
+ )
: ''
}
>
@@ -142,7 +142,7 @@ class D3Legend extends Component {
keys,
colorScheme
)( row.key ),
- }
+ }
: null
}
/>
diff --git a/packages/js/components/src/chart/d3chart/utils/axis-x.js b/packages/js/components/src/chart/d3chart/utils/axis-x.js
index 6aa22a6d24d..3abf4669f0c 100644
--- a/packages/js/components/src/chart/d3chart/utils/axis-x.js
+++ b/packages/js/components/src/chart/d3chart/utils/axis-x.js
@@ -90,7 +90,7 @@ const getFactors = ( inputNum ) => {
for ( let i = 1; i <= Math.floor( Math.sqrt( inputNum ) ); i++ ) {
if ( inputNum % i === 0 ) {
numFactors.push( i );
- // eslint-disable-next-line no-unused-expressions
+
inputNum / i !== i && numFactors.push( inputNum / i );
}
}
@@ -195,7 +195,6 @@ export const compareStrings = (
const diff = [];
const long = s1.length > s2.length ? string1 : string2;
for ( let x = 0; x < long.length; x++ ) {
- // eslint-disable-next-line no-unused-expressions
string1[ x ] !== string2[ x ] && diff.push( string2[ x ] );
}
return diff;
@@ -210,7 +209,7 @@ const removeDuplicateDates = ( d, i, ticks, formatter ) => {
? formatter( monthDate )
: compareStrings( formatter( prevMonth ), formatter( monthDate ) ).join(
' '
- );
+ );
};
export const drawXAxis = ( node, params, scales, formats ) => {
@@ -236,7 +235,7 @@ export const drawXAxis = ( node, params, scales, formats ) => {
params.interval === 'hour'
? formats.xFormat(
d instanceof Date ? d : moment( d ).toDate()
- )
+ )
: removeDuplicateDates( d, i, ticks, formats.xFormat )
)
);
diff --git a/packages/js/components/src/chart/d3chart/utils/bar-chart.js b/packages/js/components/src/chart/d3chart/utils/bar-chart.js
index 3479b5cf628..513de0074f1 100644
--- a/packages/js/components/src/chart/d3chart/utils/bar-chart.js
+++ b/packages/js/components/src/chart/d3chart/utils/bar-chart.js
@@ -31,7 +31,7 @@ export const drawBars = ( node, data, params, scales, formats, tooltip ) => {
d.date instanceof Date
? d.date
: moment( d.date ).toDate()
- )
+ )
: null
);
diff --git a/packages/js/components/src/chart/d3chart/utils/color.js b/packages/js/components/src/chart/d3chart/utils/color.js
index 8820d25526a..fd2958faeb3 100644
--- a/packages/js/components/src/chart/d3chart/utils/color.js
+++ b/packages/js/components/src/chart/d3chart/utils/color.js
@@ -33,7 +33,6 @@ export const getColor = ( orderedKeys, colorScheme ) => ( key ) => {
* ];
* return colorScales[ idx ] || false;
* });
- *
*/
const color = applyFilters(
'woocommerce_admin_chart_item_color',
diff --git a/packages/js/components/src/chart/d3chart/utils/line-chart.js b/packages/js/components/src/chart/d3chart/utils/line-chart.js
index 5389f5d3484..001b973cbfb 100644
--- a/packages/js/components/src/chart/d3chart/utils/line-chart.js
+++ b/packages/js/components/src/chart/d3chart/utils/line-chart.js
@@ -43,7 +43,7 @@ export const getDateSpaces = (
? xScale( moment( uniqueDates[ i + 1 ] ).toDate() )
: xScale(
moment( uniqueDates[ uniqueDates.length - 1 ] ).toDate()
- );
+ );
let xWidth = i === 0 ? xNext - xNow : xNow - xPrev;
const xStart = i === 0 ? 0 : xNow - xWidth / 2;
xWidth = i === 0 || i === uniqueDates.length - 1 ? xWidth / 2 : xWidth;
@@ -133,7 +133,6 @@ export const drawLines = ( node, data, params, scales, formats, tooltip ) => {
lineStroke = width <= smallBreak ? 1.25 : lineStroke;
const dotRadius = width <= wideBreak ? 4 : 6;
- // eslint-disable-next-line no-unused-expressions
params.uniqueDates.length > 1 &&
series
.append( 'path' )
@@ -149,7 +148,7 @@ export const drawLines = ( node, data, params, scales, formats, tooltip ) => {
.attr( 'd', ( d ) => line( d.values ) );
const minDataPointSpacing = 36;
- // eslint-disable-next-line no-unused-expressions
+
width / params.uniqueDates.length > minDataPointSpacing &&
series
.selectAll( 'circle' )
diff --git a/packages/js/components/src/chart/index.js b/packages/js/components/src/chart/index.js
index b6ebbef1189..ed07ebb2909 100644
--- a/packages/js/components/src/chart/index.js
+++ b/packages/js/components/src/chart/index.js
@@ -90,11 +90,10 @@ class Chart extends Component {
if ( ! isEqual( uniqueKeys, this.prevDataKeys ) ) {
const dataKeys = this.getDataKeys();
this.prevDataKeys = uniqueKeys;
- /* eslint-disable react/no-did-update-set-state */
+
this.setState( {
visibleKeys: dataKeys.slice( 0, selectionLimit ),
} );
- /* eslint-enable react/no-did-update-set-state */
}
}
diff --git a/packages/js/components/src/date-time-picker-control/date-time-picker-control.tsx b/packages/js/components/src/date-time-picker-control/date-time-picker-control.tsx
index 5d249a868b4..116fe3fe77d 100644
--- a/packages/js/components/src/date-time-picker-control/date-time-picker-control.tsx
+++ b/packages/js/components/src/date-time-picker-control/date-time-picker-control.tsx
@@ -261,8 +261,9 @@ export const DateTimePickerControl = forwardRef(
const maybeForceTime = useCallback(
( momentDate: Moment ) => {
- if ( ! isDateOnlyPicker || ! momentDate.isValid() )
+ if ( ! isDateOnlyPicker || ! momentDate.isValid() ) {
return momentDate;
+ }
// We want to set to the start/end of the local time, so
// we need to put our Moment instance into "local" mode
diff --git a/packages/js/components/src/ellipsis-menu/test/index.js b/packages/js/components/src/ellipsis-menu/test/index.js
index 7af535fafc0..c9cbccbc145 100644
--- a/packages/js/components/src/ellipsis-menu/test/index.js
+++ b/packages/js/components/src/ellipsis-menu/test/index.js
@@ -24,7 +24,7 @@ describe( 'EllipsisMenu', () => {
expect( menu ).toBeInTheDocument();
} );
- it( 'should call onToggle when clicking on the ellipsis', () => {
+ it( 'should call onToggle when clicking on the ellipsis', async () => {
const onClickMock = jest.fn();
const { getByTitle } = render(
<EllipsisMenu
@@ -34,11 +34,11 @@ describe( 'EllipsisMenu', () => {
/>
);
- userEvent.click( getByTitle( 'foo' ) );
+ await userEvent.click( getByTitle( 'foo' ) );
expect( onClickMock ).toHaveBeenCalledTimes( 1 );
} );
- it( 'should render content when clicking on the ellipsis', () => {
+ it( 'should render content when clicking on the ellipsis', async () => {
const { getByTitle, getByText } = render(
<EllipsisMenu
label={ 'foo' }
@@ -46,7 +46,7 @@ describe( 'EllipsisMenu', () => {
/>
);
- userEvent.click( getByTitle( 'foo' ) );
+ await userEvent.click( getByTitle( 'foo' ) );
expect( getByText( 'content' ) ).toBeInTheDocument();
} );
} );
diff --git a/packages/js/components/src/empty-content/index.js b/packages/js/components/src/empty-content/index.js
index 82a580616c4..66206dd2d01 100644
--- a/packages/js/components/src/empty-content/index.js
+++ b/packages/js/components/src/empty-content/index.js
@@ -168,7 +168,6 @@ EmptyContent.propTypes = {
};
EmptyContent.defaultProps = {
- // eslint-disable-next-line max-len
illustration:
'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"%3E%3Cpath d="M226.153073,88.3099993 L355.380187,301.446227 C363.970299,315.614028 359.448689,334.062961 345.280888,342.653073 C340.591108,345.496544 335.21158,347 329.727115,347 L71.2728854,347 C54.7043429,347 41.2728854,333.568542 41.2728854,317 C41.2728854,311.515534 42.7763415,306.136007 45.6198127,301.446227 L174.846927,88.3099993 C183.437039,74.1421985 201.885972,69.6205881 216.053773,78.2106999 C220.184157,80.7150022 223.64877,84.1796157 226.153073,88.3099993 Z M184.370159,153 L186.899684,255.024156 L213.459691,255.024156 L215.989216,153 L184.370159,153 Z M200.179688,307.722584 C209.770801,307.722584 217.359375,300.450201 217.359375,291.175278 C217.359375,281.900355 209.770801,274.627972 200.179688,274.627972 C190.588574,274.627972 183,281.900355 183,291.175278 C183,300.450201 190.588574,307.722584 200.179688,307.722584 Z" id="Combined-Shape" stroke="%23c0c0c0" fill="%23c0c0c0"' +
' fill-rule="nonzero"%3E%3C/path%3E%3C/svg%3E',
diff --git a/packages/js/components/src/experimental-select-control/combo-box.tsx b/packages/js/components/src/experimental-select-control/combo-box.tsx
index 48333a691db..83f7e51978d 100644
--- a/packages/js/components/src/experimental-select-control/combo-box.tsx
+++ b/packages/js/components/src/experimental-select-control/combo-box.tsx
@@ -55,7 +55,7 @@ export const ComboBox = ( {
return (
// Disable reason: The click event is purely for accidental clicks around the input.
// Keyboard users are still able to tab to and interact with elements in the combobox.
- /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
<div
className={ clsx(
'woocommerce-experimental-select-control__combo-box-wrapper',
diff --git a/packages/js/components/src/experimental-select-control/hooks/use-async-filter.tsx b/packages/js/components/src/experimental-select-control/hooks/use-async-filter.tsx
index 8672acfa535..78ccd81578a 100644
--- a/packages/js/components/src/experimental-select-control/hooks/use-async-filter.tsx
+++ b/packages/js/components/src/experimental-select-control/hooks/use-async-filter.tsx
@@ -25,19 +25,22 @@ export default function useAsyncFilter< T >( {
const handleInputChange = useCallback(
function handleInputChangeCallback( value?: string ) {
if ( typeof filter === 'function' ) {
- if ( typeof onFilterStart === 'function' )
+ if ( typeof onFilterStart === 'function' ) {
onFilterStart( value );
+ }
setIsFetching( true );
filter( value )
.then( ( filteredItems ) => {
- if ( typeof onFilterEnd === 'function' )
+ if ( typeof onFilterEnd === 'function' ) {
onFilterEnd( filteredItems, value );
+ }
} )
.catch( ( error: Error ) => {
- if ( typeof onFilterError === 'function' )
+ if ( typeof onFilterError === 'function' ) {
onFilterError( error, value );
+ }
} )
.finally( () => {
setIsFetching( false );
@@ -64,10 +67,10 @@ export default function useAsyncFilter< T >( {
}
export type UseAsyncFilterInput< T > = {
- filter( value?: string ): Promise< T[] >;
- onFilterStart?( value?: string ): void;
- onFilterEnd?( filteredItems: T[], value?: string ): void;
- onFilterError?( error: Error, value?: string ): void;
+ filter: ( value?: string ) => Promise< T[] >;
+ onFilterStart?: ( value?: string ) => void;
+ onFilterEnd?: ( filteredItems: T[], value?: string ) => void;
+ onFilterError?: ( error: Error, value?: string ) => void;
debounceTime?: number;
};
diff --git a/packages/js/components/src/experimental-select-control/menu.tsx b/packages/js/components/src/experimental-select-control/menu.tsx
index 2973734c8e3..88741f552fc 100644
--- a/packages/js/components/src/experimental-select-control/menu.tsx
+++ b/packages/js/components/src/experimental-select-control/menu.tsx
@@ -66,7 +66,7 @@ export const Menu = ( {
}
}, [ isOpen, scrollIntoViewOnOpen ] );
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
/* Disabled because of the onmouseup on the ul element below. */
return (
<div
@@ -106,7 +106,7 @@ export const Menu = ( {
</div>
</div>
);
- /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
+ /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
};
export const MenuSlot = () =>
diff --git a/packages/js/components/src/experimental-select-control/select-control.tsx b/packages/js/components/src/experimental-select-control/select-control.tsx
index 739f6b8c0f5..945bb98d898 100644
--- a/packages/js/components/src/experimental-select-control/select-control.tsx
+++ b/packages/js/components/src/experimental-select-control/select-control.tsx
@@ -299,7 +299,7 @@ function SelectControl< ItemType = DefaultItemType >( {
) }
>
{ /* Downshift's getLabelProps handles the necessary label attributes. */ }
- { /* eslint-disable jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control */ }
+ { /* eslint-disable jsx-a11y/label-has-associated-control */ }
{ label && (
<label
{ ...getLabelProps() }
@@ -308,7 +308,7 @@ function SelectControl< ItemType = DefaultItemType >( {
{ label }
</label>
) }
- { /* eslint-enable jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control */ }
+ { /* eslint-enable jsx-a11y/label-has-associated-control */ }
<ComboBox
comboBoxProps={ getComboboxProps() }
getToggleButtonProps={ getToggleButtonProps }
diff --git a/packages/js/components/src/experimental-select-control/selected-items.tsx b/packages/js/components/src/experimental-select-control/selected-items.tsx
index 309f8ec5b05..3371e4a349e 100644
--- a/packages/js/components/src/experimental-select-control/selected-items.tsx
+++ b/packages/js/components/src/experimental-select-control/selected-items.tsx
@@ -57,13 +57,9 @@ const PrivateSelectedItems = < ItemType, >(
const lastRemoveButtonRef = useRef< HTMLButtonElement >( null );
- useImperativeHandle(
- ref,
- () => {
- return () => lastRemoveButtonRef.current?.focus();
- },
- []
- );
+ useImperativeHandle( ref, () => {
+ return () => lastRemoveButtonRef.current?.focus();
+ }, [] );
if ( isReadOnly ) {
return (
@@ -102,7 +98,7 @@ const PrivateSelectedItems = < ItemType, >(
return (
// Disable reason: We prevent the default action to keep the input focused on click.
// Keyboard users are unaffected by this change.
- /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
<div
key={ `selected-item-${ index }` }
className="woocommerce-experimental-select-control__selected-item"
diff --git a/packages/js/components/src/experimental-select-tree-control/select-tree-menu.tsx b/packages/js/components/src/experimental-select-tree-control/select-tree-menu.tsx
index 9d92d969965..de4b3e484cb 100644
--- a/packages/js/components/src/experimental-select-tree-control/select-tree-menu.tsx
+++ b/packages/js/components/src/experimental-select-tree-control/select-tree-menu.tsx
@@ -75,7 +75,9 @@ export const SelectTreeMenu = ( {
}, [ isOpen, scrollIntoViewOnOpen ] );
const shouldItemBeExpanded = ( item: LinkedTree ): boolean => {
- if ( ! props.createValue || ! item.children?.length ) return false;
+ if ( ! props.createValue || ! item.children?.length ) {
+ return false;
+ }
return item.children.some( ( child ) => {
if (
new RegExp(
@@ -89,7 +91,6 @@ export const SelectTreeMenu = ( {
} );
};
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
/* Disabled because of the onmouseup on the ul element below. */
return (
<div
@@ -154,5 +155,4 @@ export const SelectTreeMenu = ( {
</div>
</div>
);
- /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
};
diff --git a/packages/js/components/src/experimental-select-tree-control/select-tree.tsx b/packages/js/components/src/experimental-select-tree-control/select-tree.tsx
index 8c04671f5b5..b7a7082d073 100644
--- a/packages/js/components/src/experimental-select-tree-control/select-tree.tsx
+++ b/packages/js/components/src/experimental-select-tree-control/select-tree.tsx
@@ -308,7 +308,7 @@ export const SelectTree = function SelectTree( {
( i ) =>
i.label === escapeHTML( inputValue )
)
- )
+ )
: props.selected?.label === escapeHTML( inputValue );
if ( item && ! isAlreadySelected ) {
props.onSelect?.( item );
@@ -380,7 +380,7 @@ export const SelectTree = function SelectTree( {
? __(
'Separate with commas or the Enter key.',
'woocommerce'
- )
+ )
: help
}
>
@@ -456,7 +456,9 @@ export const SelectTree = function SelectTree( {
props.createValue || ''
) }
onChange={ ( value ) => {
- if ( onInputChange ) onInputChange( value );
+ if ( onInputChange ) {
+ onInputChange( value );
+ }
const item = items.find(
( i ) => i.label === escapeHTML( value )
);
diff --git a/packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx b/packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx
index 6fa5cb3c040..2b088db7cde 100644
--- a/packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx
+++ b/packages/js/components/src/experimental-select-tree-control/stories/select-tree-control.story.tsx
@@ -87,10 +87,10 @@ export const MultipleSelectTree = () => {
( { value: removedValue } ) =>
item.value === removedValue
)
- )
+ )
: selected.filter(
( item ) => item.value !== removedItems.value
- );
+ );
setSelected( newValues );
} }
/>
@@ -148,11 +148,11 @@ export const SingleWithinModalUsingBodyDropdownPlacement = () => {
( { value: removedValue } ) =>
item.value === removedValue
)
- )
+ )
: selected.filter(
( item ) =>
item.value !== removedItems.value
- );
+ );
setSelected( newValues );
} }
/>
diff --git a/packages/js/components/src/experimental-tree-control/hooks/use-keyboard.ts b/packages/js/components/src/experimental-tree-control/hooks/use-keyboard.ts
index a4f539f2b41..f0414366d29 100644
--- a/packages/js/components/src/experimental-tree-control/hooks/use-keyboard.ts
+++ b/packages/js/components/src/experimental-tree-control/hooks/use-keyboard.ts
@@ -58,11 +58,15 @@ function getNextFocusableElement(
code: 'ArrowDown' | 'ArrowUp'
): HTMLLabelElement | null {
const headingsNodeList = getAllHeadings( currentHeading );
- if ( ! headingsNodeList ) return null;
+ if ( ! headingsNodeList ) {
+ return null;
+ }
let currentHeadingIndex = 0;
for ( const heading of headingsNodeList.values() ) {
- if ( heading === currentHeading ) break;
+ if ( heading === currentHeading ) {
+ break;
+ }
currentHeadingIndex++;
}
if (
@@ -84,7 +88,9 @@ function getFirstFocusableElement(
currentHeading: HTMLDivElement
): HTMLLabelElement | null {
const headingsNodeList = getAllHeadings( currentHeading );
- if ( ! headingsNodeList ) return null;
+ if ( ! headingsNodeList ) {
+ return null;
+ }
return headingsNodeList
.item( 0 )
.querySelector< HTMLLabelElement >(
@@ -96,7 +102,9 @@ function getLastFocusableElement(
currentHeading: HTMLDivElement
): HTMLLabelElement | null {
const headingsNodeList = getAllHeadings( currentHeading );
- if ( ! headingsNodeList ) return null;
+ if ( ! headingsNodeList ) {
+ return null;
+ }
return headingsNodeList
.item( headingsNodeList.length - 1 )
.querySelector< HTMLLabelElement >(
@@ -115,11 +123,11 @@ export function useKeyboard( {
}: {
item: LinkedTree;
isExpanded: boolean;
- onExpand(): void;
- onCollapse(): void;
- onToggleExpand(): void;
- onLastItemLoop?( event: React.KeyboardEvent< HTMLDivElement > ): void;
- onFirstItemLoop?( event: React.KeyboardEvent< HTMLDivElement > ): void;
+ onExpand: () => void;
+ onCollapse: () => void;
+ onToggleExpand: () => void;
+ onLastItemLoop?: ( event: React.KeyboardEvent< HTMLDivElement > ) => void;
+ onFirstItemLoop?: ( event: React.KeyboardEvent< HTMLDivElement > ) => void;
} ) {
function onKeyDown( event: React.KeyboardEvent< HTMLDivElement > ) {
if ( event.code === 'ArrowRight' ) {
diff --git a/packages/js/components/src/experimental-tree-control/hooks/use-selection.ts b/packages/js/components/src/experimental-tree-control/hooks/use-selection.ts
index 6ad08a558a5..1a941018377 100644
--- a/packages/js/components/src/experimental-tree-control/hooks/use-selection.ts
+++ b/packages/js/components/src/experimental-tree-control/hooks/use-selection.ts
@@ -65,7 +65,9 @@ function hasSelectedSibblingChildren(
) {
return children.some( ( child ) => {
const isChildSelected = child.data.value in selectedItems;
- if ( ! isChildSelected ) return false;
+ if ( ! isChildSelected ) {
+ return false;
+ }
return ! values.some(
( childValue ) => childValue.value === child.data.value
);
@@ -134,7 +136,9 @@ export function useSelection( {
}
function onSelectChildren( value: Item | Item[] ) {
- if ( typeof onSelect !== 'function' ) return;
+ if ( typeof onSelect !== 'function' ) {
+ return;
+ }
if ( multiple && ! shouldNotRecursivelySelect ) {
value = [ item.data, ...( value as Item[] ) ];
@@ -144,7 +148,9 @@ export function useSelection( {
}
function onRemoveChildren( value: Item | Item[] ) {
- if ( typeof onRemove !== 'function' ) return;
+ if ( typeof onRemove !== 'function' ) {
+ return;
+ }
if (
multiple &&
diff --git a/packages/js/components/src/experimental-tree-control/linked-tree-utils.ts b/packages/js/components/src/experimental-tree-control/linked-tree-utils.ts
index 38f33003411..e299143adf5 100644
--- a/packages/js/components/src/experimental-tree-control/linked-tree-utils.ts
+++ b/packages/js/components/src/experimental-tree-control/linked-tree-utils.ts
@@ -11,7 +11,9 @@ const shouldItemBeExpanded = (
item: LinkedTree,
createValue: string | undefined
): boolean => {
- if ( ! createValue || ! item.children?.length ) return false;
+ if ( ! createValue || ! item.children?.length ) {
+ return false;
+ }
return item.children.some( ( child ) => {
if ( new RegExp( createValue || '', 'ig' ).test( child.data.label ) ) {
return true;
@@ -123,7 +125,7 @@ export function toggleNode(
: node.parent.data.isExpanded,
},
},
- }
+ }
: {} ),
};
} );
diff --git a/packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx b/packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx
index 1ac90646113..074ab302d00 100644
--- a/packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx
+++ b/packages/js/components/src/experimental-tree-control/stories/tree-control.story.tsx
@@ -39,7 +39,9 @@ export const SimpleTree = () => {
};
function shouldItemBeExpanded( item: LinkedTree, filter: string ) {
- if ( ! filter || ! item.children?.length ) return false;
+ if ( ! filter || ! item.children?.length ) {
+ return false;
+ }
return item.children.some( ( child ) => {
if ( new RegExp( filter, 'ig' ).test( child.data.label ) ) {
return true;
@@ -115,7 +117,7 @@ function getItemLabel( item: LinkedTree, text: string ) {
components: {
bold: <b />,
},
- } )
+ } )
: item.data.label }
</span>
);
@@ -212,8 +214,12 @@ function getFirstMatchingItem(
text: string,
memo: Record< string, string >
) {
- if ( ! text ) return false;
- if ( memo[ text ] === item.data.value ) return true;
+ if ( ! text ) {
+ return false;
+ }
+ if ( memo[ text ] === item.data.value ) {
+ return true;
+ }
const matcher = new RegExp( text, 'ig' );
if ( matcher.test( item.data.label ) ) {
diff --git a/packages/js/components/src/experimental-tree-control/tree-item.tsx b/packages/js/components/src/experimental-tree-control/tree-item.tsx
index 87a15153d2d..e915168d413 100644
--- a/packages/js/components/src/experimental-tree-control/tree-item.tsx
+++ b/packages/js/components/src/experimental-tree-control/tree-item.tsx
@@ -62,7 +62,7 @@ export const TreeItem = forwardRef( function ForwardedTreeItem(
{ ...headingProps }
className="experimental-woocommerce-tree-item__heading"
>
- { /* eslint-disable-next-line jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control */ }
+ { /* eslint-disable-next-line jsx-a11y/label-has-associated-control */ }
<label className="experimental-woocommerce-tree-item__label">
{ selection.multiple ? (
<CheckboxControl
diff --git a/packages/js/components/src/experimental-tree-control/tree.tsx b/packages/js/components/src/experimental-tree-control/tree.tsx
index b91e8b2de2a..7fc835b31be 100644
--- a/packages/js/components/src/experimental-tree-control/tree.tsx
+++ b/packages/js/components/src/experimental-tree-control/tree.tsx
@@ -123,7 +123,7 @@ export const Tree = forwardRef( function ForwardedTree(
/* translators: %s: create value */
__( 'Create "%s"', 'woocommerce' ),
props.createValue
- )
+ )
: __( 'Create new', 'woocommerce' ) }
</Button>
) }
diff --git a/packages/js/components/src/filter-picker/index.js b/packages/js/components/src/filter-picker/index.js
index 277d208bd51..ababa8ae2e1 100644
--- a/packages/js/components/src/filter-picker/index.js
+++ b/packages/js/components/src/filter-picker/index.js
@@ -100,9 +100,8 @@ class FilterPicker extends Component {
if ( prevQuery[ config.param ] !== nextQuery[ [ config.param ] ] ) {
const selectedFilter = this.getFilter();
if ( selectedFilter && selectedFilter.component === 'Search' ) {
- /* eslint-disable react/no-did-update-set-state */
this.setState( { nav: selectedFilter.path || [] } );
- /* eslint-enable react/no-did-update-set-state */
+
const { param: filterParam, getLabels } =
selectedFilter.settings;
getLabels( nextQuery[ filterParam ], nextQuery ).then(
diff --git a/packages/js/components/src/filter-picker/test/index.js b/packages/js/components/src/filter-picker/test/index.js
index 389fd50f820..c3bac7db0a5 100644
--- a/packages/js/components/src/filter-picker/test/index.js
+++ b/packages/js/components/src/filter-picker/test/index.js
@@ -29,9 +29,9 @@ describe( 'FilterPicker', () => {
describe( "when a config is given with a filter with `component: 'Search'`", () => {
let config;
let warn;
- const openDropdown = ( { queryAllByRole } ) => {
+ const openDropdown = async ( { queryAllByRole } ) => {
// The main dropdown does not have its role defined, so we need to dig deeper into actual internals.
- userEvent.click( queryAllByRole( 'button' )[ 0 ] );
+ await userEvent.click( queryAllByRole( 'button' )[ 0 ] );
};
const getLastSearchProps = () =>
Search.mock.calls.slice( -1 )[ 0 ][ 0 ];
@@ -87,7 +87,7 @@ describe( 'FilterPicker', () => {
// Emulate filter dropdown being opened.
// The main dropdown does not have its role defined, so we need to dig deeper into actual internals.
- userEvent.click( queryAllByRole( 'button' )[ 0 ] );
+ await userEvent.click( queryAllByRole( 'button' )[ 0 ] );
// Check that the given component was rendered, without checking its behavior/internals/implementation details.
//
diff --git a/packages/js/components/src/form/types.ts b/packages/js/components/src/form/types.ts
index 4ada97c3e03..5eb12821d13 100644
--- a/packages/js/components/src/form/types.ts
+++ b/packages/js/components/src/form/types.ts
@@ -129,8 +129,7 @@ export type FormContextType< Values extends Record< string, any > = any > = {
resetForm: (
newInitialValues?: Values,
newTouchedFields?:
- | { [ P in keyof Values ]?: boolean | undefined }
- | undefined,
+ { [ P in keyof Values ]?: boolean | undefined } | undefined,
newErrors?: FormErrors< Values >
) => void;
};
diff --git a/packages/js/components/src/image-gallery/image-gallery-toolbar-dropdown.tsx b/packages/js/components/src/image-gallery/image-gallery-toolbar-dropdown.tsx
index eeee9407950..0467e861663 100644
--- a/packages/js/components/src/image-gallery/image-gallery-toolbar-dropdown.tsx
+++ b/packages/js/components/src/image-gallery/image-gallery-toolbar-dropdown.tsx
@@ -83,7 +83,7 @@ export function ImageGalleryToolbarDropdown( {
child,
{ onClose }
)
- ) }
+ ) }
{ canRemove && (
<MenuGroup>
<MenuItem
diff --git a/packages/js/components/src/list/test/index.js b/packages/js/components/src/list/test/index.js
index a609f94f8b8..63216b56cbd 100644
--- a/packages/js/components/src/list/test/index.js
+++ b/packages/js/components/src/list/test/index.js
@@ -30,7 +30,7 @@ describe( 'List', () => {
expect( screen.getAllByRole( 'menuitem' ) ).toHaveLength( 2 );
} );
- it( 'should support `onClick` for items', () => {
+ it( 'should support `onClick` for items', async () => {
const clickHandler = jest.fn();
const listItems = [
{
@@ -45,7 +45,7 @@ describe( 'List', () => {
render( <List items={ listItems } /> );
- userEvent.click(
+ await userEvent.click(
screen.getByRole( 'menuitem', { name: 'Click me!' } )
);
diff --git a/packages/js/components/src/media-uploader/media-uploader.tsx b/packages/js/components/src/media-uploader/media-uploader.tsx
index 6898b4a266d..c36305e3c94 100644
--- a/packages/js/components/src/media-uploader/media-uploader.tsx
+++ b/packages/js/components/src/media-uploader/media-uploader.tsx
@@ -145,7 +145,7 @@ export const MediaUploader = ( {
? ( files as Attachment[] )
: (
files as Attachment[]
- )[ 0 ]
+ )[ 0 ]
);
},
additionalData,
diff --git a/packages/js/components/src/media-uploader/types.ts b/packages/js/components/src/media-uploader/types.ts
index f1f120c9ca0..18c82510793 100644
--- a/packages/js/components/src/media-uploader/types.ts
+++ b/packages/js/components/src/media-uploader/types.ts
@@ -24,13 +24,15 @@ export interface MediaUploadProps< T extends boolean = false > {
modalClass?: string;
multiple?: T | string;
value?: T extends true ? number[] : number;
+ // eslint-disable-next-line @typescript-eslint/method-signature-style -- Preserve callback parameter bivariance.
onSelect(
value: T extends true
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
- Array< { id: number } & { [ k: string ]: any } >
+ Array< { id: number } & { [ k: string ]: any } >
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
- { id: number } & { [ k: string ]: any }
+ { id: number } & { [ k: string ]: any }
): void;
+ // eslint-disable-next-line @typescript-eslint/method-signature-style -- Preserve callback parameter bivariance.
render( props: { open(): void } ): JSX.Element;
title?: string;
}
diff --git a/packages/js/components/src/phone-number-input/index.tsx b/packages/js/components/src/phone-number-input/index.tsx
index bf718fcf4c1..13e36d01e70 100644
--- a/packages/js/components/src/phone-number-input/index.tsx
+++ b/packages/js/components/src/phone-number-input/index.tsx
@@ -145,7 +145,9 @@ const PhoneNumberInput = ( {
initialSelectedItem: countryKey,
itemToString: ( item ) => countries[ item || '' ].name,
onSelectedItemChange: ( { selectedItem } ) => {
- if ( selectedItem ) handleSelect( selectedItem );
+ if ( selectedItem ) {
+ handleSelect( selectedItem );
+ }
},
stateReducer: ( state, { changes } ) => {
if ( state.isOpen === true && changes.isOpen === false ) {
diff --git a/packages/js/components/src/phone-number-input/utils.ts b/packages/js/components/src/phone-number-input/utils.ts
index bd62fd31838..2b74502f08b 100644
--- a/packages/js/components/src/phone-number-input/utils.ts
+++ b/packages/js/components/src/phone-number-input/utils.ts
@@ -50,7 +50,9 @@ export const guessCountryKey = (
// Match each digit against countryCodes until a match is found
for ( let i = number.length; i > 0; i-- ) {
const match = countryCodes[ number.substring( 0, i ) ];
- if ( match ) return match[ 0 ];
+ if ( match ) {
+ return match[ 0 ];
+ }
}
return 'US';
};
@@ -100,7 +102,9 @@ const pushOrAdd = (
value: string
) => {
if ( acc[ key ] ) {
- if ( ! acc[ key ].includes( value ) ) acc[ key ].push( value );
+ if ( ! acc[ key ].includes( value ) ) {
+ acc[ key ].push( value );
+ }
} else {
acc[ key ] = [ value ];
}
diff --git a/packages/js/components/src/plugins/test/index.js b/packages/js/components/src/plugins/test/index.js
index d7c3cd019ac..48273a3fb2e 100644
--- a/packages/js/components/src/plugins/test/index.js
+++ b/packages/js/components/src/plugins/test/index.js
@@ -114,7 +114,9 @@ describe( 'Installing and activating', () => {
<Plugins pluginSlugs={ [ 'jetpack' ] } onComplete={ onComplete } />
);
- userEvent.click( getByRole( 'button', { name: 'Install & enable' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Install & enable' } )
+ );
// Get the mocked installAndActivatePlugins function.
const { installAndActivatePlugins } = useDispatch();
@@ -153,7 +155,9 @@ describe( 'Installing and activating errors', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: 'Install & enable' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Install & enable' } )
+ );
expect( onComplete ).not.toHaveBeenCalled();
diff --git a/packages/js/components/src/product-image/placeholder.tsx b/packages/js/components/src/product-image/placeholder.tsx
index fd686ea27d7..6734419cdf1 100644
--- a/packages/js/components/src/product-image/placeholder.tsx
+++ b/packages/js/components/src/product-image/placeholder.tsx
@@ -1,7 +1,6 @@
-// eslint-disable-next-line max-len
const placeholderWhiteBackground =
"data:image/svg+xml;utf8,%3Csvg width='421' height='421' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cstyle type='text/css'%3E.st0%7Bfill:url(%23SVGID_1_);stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfill:%23717275;%7D .st3%7Bfill:%23DCDDE0;stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D%3C/style%3E%3CradialGradient cx='105.8248' cy='287.7805' gradientUnits='userSpaceOnUse' id='SVGID_1_' r='372.6935'%3E%3Cstop offset='0.2613' stop-color='%23DCDDE0'/%3E%3Cstop offset='0.633' stop-color='%23D8DADD'/%3E%3Cstop offset='0.9665' stop-color='%23CECFD3'/%3E%3Cstop offset='1' stop-color='%23CCCED2'/%3E%3C/radialGradient%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 2%3C/title%3E%3Crect fill='%23ffffff' height='417.99996' id='svg_7' stroke-dasharray='null' stroke-linecap='null' stroke-linejoin='null' stroke-width='null' width='417.99996' x='1.50002' y='1.5'/%3E%3C/g%3E%3Cg class='layer' display='inline'%3E%3Ctitle%3ELayer 1%3C/title%3E%3Cg id='svg_2'/%3E%3Cg id='svg_6'%3E%3Cpath class='st0' d='m330.44409,336.12693c-0.12194,0.36582 0,0.67068 0.30485,0.79262c1.40232,-0.79262 3.17047,-1.0365 4.63377,-0.48776c0.67068,-1.46329 0.12194,-2.43882 0.06097,-3.90212c-0.91456,-15.66945 -0.73165,-31.9486 -0.73165,-47.73998c0,-16.34012 -0.30485,-32.74121 0.54874,-48.9594c0.79262,-15.9743 1.89009,-31.5218 1.28038,-47.55707c-0.60971,-15.79139 -0.06097,-31.70471 0.73165,-47.37416c0.36582,-8.04812 0.79262,-15.66945 0.36582,-23.77854c-0.48776,-9.08462 -0.36582,-21.88845 -0.36582,-30.97307c0,-1.0365 0.18291,-1.82912 -0.79262,-2.43882c-0.79262,-0.48776 -1.52427,-0.42679 -2.43882,-0.42679c-2.49979,0 -4.87765,-0.36582 -7.37744,-0.36582c-1.52427,0 -2.86562,0 -4.32891,0.30485c-0.79262,0.12194 -1.52427,0.06097 -2.31688,0.06097c-0.85359,0 -1.52427,0.18291 -2.31688,0.36582c-6.88968,1.15844 -15.73042,2.49979 -22.62009,1.76815c-6.88968,-0.73165 -13.71839,-0.67068 -20.54709,-2.01203c-6.46288,-1.28038 -12.92577,-0.42679 -19.38865,-0.42679c-4.146,0 -8.23103,0 -12.37703,0c-3.96309,0 -7.80424,-0.73165 -11.8283,-0.73165c-6.52385,0.06097 -13.10868,0.12194 -19.63253,0.36582c-4.51182,0.18291 -8.84074,0 -13.35256,0.42679c-6.82871,0.60971 -13.77936,1.09747 -20.66903,1.0365c-3.59727,0 -7.07259,0.24388 -10.60889,-0.42679c-3.17047,-0.60971 -6.58483,-0.12194 -9.7553,0.18291c-3.96309,0.36582 -7.86521,1.0365 -11.8283,1.0365c-3.84115,-0.06097 -7.74327,-0.85359 -11.58441,-0.85359c-4.38988,-0.12194 -8.59686,0.42679 -12.98674,0.12194c-5.36541,-0.36582 -10.60889,-0.06097 -15.91333,-0.12194c-0.91456,0 -1.34135,0.24388 -2.13397,0.36582c-0.79262,0.12194 -1.40232,0.36582 -2.19494,0.36582c-0.85359,0 -1.34135,-0.30485 -2.13397,-0.36582c-1.64621,-0.18291 -5.91415,-0.06097 -7.49938,-0.48776c-1.70718,-0.42679 -3.41435,-0.91456 -5.12153,-1.34135c-1.40232,1.34135 -1.52427,3.5363 -1.64621,5.48735c-0.85359,21.58359 -0.73165,43.16719 -0.60971,64.75078c0,4.99959 0.06097,9.99918 0.60971,14.9378c0.42679,3.84115 1.15844,7.6823 1.46329,11.52344c0.48776,6.219 -0.06097,12.49897 -0.36582,18.71798c-0.36582,7.31647 -0.36582,14.63295 0.06097,21.94942c0.97553,18.90089 -0.48776,40.30157 -0.79262,59.20246c-0.36582,18.41312 -0.67068,37.1311 3.90212,54.99549c4.63377,-1.82912 17.13274,1.15844 22.55912,1.40232c5.85318,0.24388 11.8283,0.30485 17.74245,0.30485c6.76774,0 13.59644,-0.36582 20.30321,0c8.47491,0.42679 16.09624,2.31688 24.63212,1.82912c4.146,-0.24388 8.65783,0.36582 12.68189,0.36582c3.29241,0 9.87724,-1.09747 12.25509,0.73165c8.77977,0 20.18127,0.12194 28.90007,-0.73165c9.08462,-0.85359 19.38865,-1.21941 28.47327,-0.36582c7.37744,0.73165 14.45003,1.34135 21.82748,0.36582c4.63377,-0.60971 9.14559,-1.09747 13.9013,-1.09747c4.32891,0 8.292,-1.58524 12.49897,-1.46329c4.63377,0.12194 9.38947,1.40232 14.02324,1.89009c3.04853,0.30485 9.63336,-2.49979 12.49897,-1.21941l-0.00003,-0.00001z' fill='black' id='svg_1'/%3E%3Cpath class='st1' d='m313.79912,275.40021c-1.09747,0 -3.90212,-4.20697 -4.99959,-5.85318c-0.42679,-0.67068 -0.79262,-1.21941 -1.0365,-1.52427c-1.76815,-2.25591 -4.02406,-4.51182 -6.219,-6.6458c-0.67068,-0.67068 -1.40232,-1.40232 -2.073,-2.073c-3.5363,-3.59727 -9.02365,-7.98715 -13.16965,-9.51141c-1.40232,-0.48776 -2.56077,-1.21941 -3.71921,-1.82912c-2.19494,-1.28038 -4.20697,-2.43882 -7.49938,-2.49979c-0.30485,0 -0.67068,0 -0.97553,0c-3.78018,0 -7.49938,0.48776 -11.34053,1.09747c-7.19453,1.09747 -16.82789,7.49938 -21.52262,14.32809c-0.73165,1.09747 -1.15844,2.31688 -1.21941,3.5363c-2.31688,-0.54874 -5.6093,-3.17047 -7.62133,-4.75571c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.74368,-2.13397 -4.75571,-4.5728 -6.95065,-7.2555c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.63377c-7.92618,-8.17006 -16.88886,-15.48653 -25.54668,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.59644,-11.27956c-5.79221,-4.99959 -10.365,-9.81627 -14.45003,-15.12071c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.23144,-4.26794 -5.12153,-6.15803c-0.67068,-0.67068 -2.31688,-1.89009 -4.20697,-3.23144c-2.98756,-2.19494 -7.56035,-5.48735 -7.92618,-6.70677c-0.42679,-1.40232 -3.5363,-3.5363 -3.59727,-3.5363c-0.85359,-0.48776 -1.76815,-1.40232 -1.82912,-2.62174l-0.06097,-0.85359l-0.79262,0.36582c-2.86562,1.34135 -4.93862,3.41435 -7.07259,5.6093c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.49979,2.86562 -5.12153,6.03609 -7.31647,9.38947c-0.60971,0.91456 -1.15844,2.01203 -1.70718,3.17047c-0.91456,1.89009 -1.89009,3.84115 -3.04853,4.99959c-0.36582,-0.54874 -0.73165,-1.64621 -0.91456,-2.13397c-0.06097,-0.18291 -0.12194,-0.42679 -0.18291,-0.54874c-1.28038,-3.17047 -0.79262,-6.52385 -0.30485,-10.06015c0.36582,-2.49979 0.73165,-4.99959 0.48776,-7.62133c-0.12194,-0.97553 -0.30485,-2.01203 -0.48776,-3.04853c-0.60971,-3.47532 -1.21941,-7.01162 -0.73165,-10.24306c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.69433 0.42679,-18.83992 -0.18291,-28.53424c-0.12194,-2.43882 -0.30485,-4.99959 -0.42679,-7.49938c0,-1.0365 -0.06097,-2.13397 -0.06097,-3.17047c-0.12194,-3.17047 -0.24388,-6.219 0.60971,-9.20656c0.18291,-0.12194 0.48776,-0.30485 0.85359,-0.36582l2.37785,1.0365c2.25591,0.91456 5.1825,1.40232 8.90171,1.40232c3.41435,0 7.01162,-0.36582 10.54791,-0.73165c3.23144,-0.30485 6.34094,-0.60971 9.02365,-0.60971c0.67068,0 1.28038,0 1.89009,0.06097c1.52427,0.12194 3.04853,0.30485 4.51182,0.48776c2.13397,0.24388 4.38988,0.54874 6.58483,0.54874c0.54874,0 1.09747,0 1.58524,0c3.90212,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.90171,-0.18291 13.23062,-0.18291c3.1095,0 6.34094,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.81545,-0.97553c6.88968,-0.42679 14.08421,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.80424,-0.06097 11.76733,-0.30485c2.25591,-0.12194 4.5728,-0.36582 6.82871,-0.54874c3.78018,-0.36582 7.74327,-0.67068 11.58441,-0.67068c1.40232,0 2.74368,0.06097 4.02406,0.12194c1.89009,0.12194 3.78018,0.48776 5.79221,0.85359c2.62174,0.48776 5.30444,0.91456 7.92618,0.91456c0.67068,0 1.34135,-0.06097 1.95106,-0.12194c-0.73165,1.40232 -0.73165,3.17047 -0.67068,4.08503c0.12194,2.31688 0.12194,4.81668 0.12194,7.19453c0,9.38947 -0.97553,18.29118 -2.01203,27.74163c-0.36582,3.23144 -0.73165,6.6458 -1.0365,9.99918c-0.60971,13.65742 0,28.10745 0.60971,40.8503l0,4.63377c0.30485,4.146 0,8.23103 -0.30485,12.13315c-0.30485,3.90212 -0.60971,7.92618 -0.30485,11.95024c1.28038,12.07218 1.82912,23.71757 1.64621,34.6313l0.42679,10.60889l0.06097,0.06097c0.48776,1.34135 0.97553,6.95065 -0.24388,8.77977c-0.36582,0.42679 -0.60971,0.48776 -0.79262,0.48776l0,0l-0.00004,0.00002z' id='svg_3'/%3E%3Cpath class='st2' d='m296.54444,101.02428c1.40232,0 2.68271,0.06097 3.96309,0.12194c1.82912,0.12194 3.71921,0.48776 5.73124,0.79262c2.62174,0.48776 5.36541,0.97553 8.04812,0.97553c0.36582,0 0.67068,0 1.0365,0c-0.36582,1.21941 -0.36582,2.49979 -0.36582,3.41435c0.12194,2.31688 0.12194,4.75571 0.12194,7.13356c0,9.38947 -0.97553,18.29118 -2.01203,27.68065c-0.36582,3.29241 -0.73165,6.6458 -1.0365,9.99918l0,0l0,0c-0.60971,13.59644 0,28.10745 0.60971,40.8503l0,4.63377l0,0.06097l0,0.06097c0.30485,4.02406 0,8.10909 -0.30485,12.01121c-0.30485,3.90212 -0.60971,7.98715 -0.30485,12.01121l0,0l0,0c1.28038,12.01121 1.82912,23.65659 1.64621,34.50936l0,0.06097l0,0.06097l0.42679,10.48694l0,0.18291l0.06097,0.18291c0.48776,1.34135 0.85359,6.70677 -0.18291,8.292c-0.06097,0.06097 -0.12194,0.18291 -0.18291,0.18291c-1.0365,-0.36582 -3.65824,-4.26794 -4.51182,-5.54833c-0.48776,-0.67068 -0.79262,-1.21941 -1.09747,-1.58524c-1.82912,-2.31688 -4.08503,-4.51182 -6.219,-6.70677c-0.67068,-0.67068 -1.40232,-1.34135 -2.073,-2.073c-3.59727,-3.65824 -9.14559,-8.04812 -13.41353,-9.63336c-1.34135,-0.48776 -2.49979,-1.15844 -3.59727,-1.82912c-2.13397,-1.21941 -4.32891,-2.49979 -7.80424,-2.62174c-0.30485,0 -0.67068,0 -0.97553,0c-3.84115,0 -7.56035,0.48776 -11.46247,1.09747c-7.37744,1.09747 -17.19371,7.62133 -21.94942,14.57197c-0.67068,0.97553 -1.09747,2.01203 -1.28038,3.1095c-2.13397,-0.79262 -4.93862,-3.04853 -6.70677,-4.45085c-0.30485,-0.24388 -0.60971,-0.48776 -0.85359,-0.67068c-2.68271,-2.073 -4.69474,-4.51182 -6.88968,-7.13356c-1.28038,-1.52427 -2.62174,-3.1095 -4.08503,-4.69474c-7.92618,-8.17006 -16.88886,-15.48653 -25.60765,-22.55912c-4.51182,-3.65824 -9.14559,-7.43841 -13.53547,-11.27956c-5.73124,-4.99959 -10.30403,-9.7553 -14.38906,-15.05974c-0.42679,-0.54874 -0.85359,-1.09747 -1.21941,-1.64621c-1.58524,-2.13397 -3.29241,-4.32891 -5.1825,-6.219c-0.73165,-0.73165 -2.31688,-1.89009 -4.26794,-3.29241c-2.37785,-1.70718 -7.31647,-5.30444 -7.6823,-6.40191c-0.48776,-1.70718 -3.84115,-3.90212 -3.84115,-3.90212c-0.67068,-0.42679 -1.46329,-1.15844 -1.52427,-2.13397l-0.12194,-1.70718l-1.58524,0.73165c-2.98756,1.34135 -5.1825,3.59727 -7.2555,5.73124c-0.36582,0.36582 -0.67068,0.73165 -1.0365,1.0365c-5.67027,5.73124 -11.15762,11.64539 -16.27915,17.49856c-2.56077,2.92659 -5.1825,6.09706 -7.37744,9.45044c-0.60971,0.91456 -1.15844,2.073 -1.76815,3.29241c-0.73165,1.46329 -1.46329,3.04853 -2.37785,4.146c-0.18291,-0.48776 -0.42679,-0.97553 -0.48776,-1.28038c-0.06097,-0.24388 -0.18291,-0.42679 -0.24388,-0.54874c-1.21941,-2.98756 -0.79262,-6.27997 -0.24388,-9.69433c0.36582,-2.49979 0.73165,-5.12153 0.48776,-7.74327l0,0l0,0c-0.12194,-0.97553 -0.30485,-1.95106 -0.48776,-2.98756c-0.60971,-3.41435 -1.15844,-6.95065 -0.73165,-10.06015c1.21941,-9.63336 2.43882,-19.51059 3.04853,-29.32686c0.97553,-9.7553 0.42679,-18.90089 -0.18291,-28.65618c-0.12194,-2.43882 -0.30485,-4.93862 -0.42679,-7.43841c0,-1.09747 -0.06097,-2.13397 -0.06097,-3.23144c-0.12194,-3.04853 -0.18291,-5.97512 0.54874,-8.84074c0.06097,-0.06097 0.18291,-0.06097 0.24388,-0.12194l2.25591,0.97553c2.31688,0.97553 5.30444,1.46329 9.14559,1.46329c3.41435,0 7.07259,-0.36582 10.60889,-0.73165c3.23144,-0.30485 6.27997,-0.60971 8.96268,-0.60971c0.67068,0 1.28038,0 1.82912,0.06097c1.46329,0.12194 2.98756,0.30485 4.45085,0.42679c2.19494,0.24388 4.38988,0.54874 6.6458,0.54874c0.54874,0 1.09747,0 1.58524,0c3.96309,0 7.92618,-0.18291 11.76733,-0.36582c3.17047,-0.12194 6.46288,-0.30485 9.69433,-0.36582c5.48735,-0.06097 11.09665,-0.36582 16.46206,-0.60971c2.25591,-0.12194 4.45085,-0.24388 6.70677,-0.30485c4.38988,-0.18291 8.84074,-0.18291 13.16965,-0.18291c3.1095,0 6.40191,0 9.57238,-0.06097c6.6458,-0.18291 13.35256,-0.54874 19.87642,-0.97553c6.88968,-0.42679 14.02324,-0.85359 21.09583,-0.97553c1.76815,-0.06097 3.5363,-0.06097 5.24347,-0.06097c3.84115,-0.06097 7.86521,-0.06097 11.76733,-0.30485c2.31688,-0.12194 4.63377,-0.36582 6.88968,-0.54874c3.78018,-0.30485 7.74327,-0.67068 11.52344,-0.67068l0,0m0,-1.21941c-6.15803,0 -12.31606,0.85359 -18.47409,1.21941c-5.67027,0.30485 -11.34053,0.24388 -16.94983,0.36582c-13.65742,0.24388 -27.25386,1.58524 -40.97225,1.95106c-7.62133,0.18291 -15.18168,-0.06097 -22.80301,0.30485c-7.74327,0.30485 -15.42556,0.79262 -23.16883,0.91456c-7.13356,0.12194 -14.26712,0.73165 -21.46165,0.73165c-0.54874,0 -1.0365,0 -1.58524,0c-3.71921,-0.06097 -7.37744,-0.73165 -11.03568,-1.0365c-0.60971,-0.06097 -1.21941,-0.06097 -1.89009,-0.06097c-5.6093,0 -13.04771,1.34135 -19.51059,1.34135c-3.23144,0 -6.27997,-0.30485 -8.7188,-1.34135l-2.49979,-1.09747c-0.91456,0 -1.52427,0.60971 -1.52427,0.60971c-1.21941,4.26794 -0.60971,8.53588 -0.60971,12.80383c0.60971,12.19412 1.82912,23.77854 0.60971,35.97266c-0.60971,9.7553 -1.82912,19.51059 -3.04853,29.26589c-0.60971,4.26794 0.60971,9.14559 1.21941,13.41353c0.60971,6.09706 -2.43882,12.19412 -0.12194,17.80342c0.30485,0.73165 0.97553,2.80465 1.64621,3.29241c2.31688,-1.70718 3.65824,-6.15803 5.30444,-8.7188c2.13397,-3.29241 4.75571,-6.46288 7.2555,-9.3285c5.24347,-5.97512 10.66986,-11.8283 16.21818,-17.43759c2.49979,-2.49979 4.69474,-5.06056 7.92618,-6.58483c0.12194,1.34135 1.0365,2.43882 2.13397,3.1095c0.24388,0.12194 2.98756,2.073 3.29241,3.17047c0.60971,2.19494 10.42597,8.35297 12.25509,10.24306c2.37785,2.37785 4.32891,5.12153 6.34094,7.74327c4.38988,5.67027 9.14559,10.54791 14.57197,15.24265c12.98674,11.27956 27.07095,21.40068 39.08216,33.77771c3.90212,4.02406 6.6458,8.47491 11.09665,11.88927c2.31688,1.82912 6.6458,5.48735 9.51141,5.67027c-0.12194,-1.40232 0.36582,-2.74368 1.15844,-3.90212c4.32891,-6.34094 13.65742,-12.92577 21.09583,-14.08421c3.65824,-0.54874 7.49938,-1.09747 11.27956,-1.09747c0.30485,0 0.60971,0 0.97553,0c4.81668,0.12194 6.95065,2.80465 10.97471,4.32891c4.26794,1.58524 9.69433,6.03609 12.98674,9.38947c2.74368,2.80465 5.85318,5.67027 8.17006,8.65783c0.97553,1.28038 4.63377,7.56035 6.52385,7.56035c0,0 0.06097,0 0.06097,0c2.74368,-0.18291 2.073,-8.41394 1.46329,-10.12112l-0.42679,-10.48694c0.18291,-11.52344 -0.42679,-23.10786 -1.64621,-34.69227c-0.60971,-7.92618 1.21941,-15.85236 0.60971,-24.02242l0,-4.69474c-0.60971,-13.35256 -1.21941,-27.3758 -0.60971,-40.78933c1.21941,-12.80383 3.04853,-24.99795 3.04853,-37.80177c0,-2.43882 0,-4.87765 -0.12194,-7.19453c-0.06097,-1.58524 0.12194,-3.84115 1.52427,-4.87765c-1.09747,0.24388 -2.25591,0.30485 -3.41435,0.30485c-4.5728,0 -9.26753,-1.46329 -13.65742,-1.76815c-1.34135,0.12194 -2.68271,0.06097 -4.08503,0.06097l0,0l0.00003,0zm22.80301,1.09747c-0.67068,0 -1.21941,0.18291 -1.64621,0.48776c0.60971,-0.12194 1.21941,-0.30485 1.82912,-0.48776c-0.06097,0 -0.12194,0 -0.18291,0l0,0z' id='svg_4'/%3E%3Cpath class='st3' d='m235.75674,146.69126c-3.1095,3.41435 -4.38988,9.81627 -4.81668,14.20615c-0.60971,6.03609 -1.46329,10.97471 2.74368,15.66945c4.63377,5.12153 12.55994,9.87724 19.20574,11.64539c3.47532,0.97553 7.49938,-0.73165 10.7918,-1.40232c7.92618,-1.70718 11.95024,-6.52385 15.42556,-13.9013c4.20697,-8.77977 0.67068,-15.73042 -2.86562,-23.96145c-3.84115,-8.90171 -15.5475,-12.92577 -24.81504,-11.70636c-3.78018,0.48776 -5.91415,2.80465 -8.90171,4.87765c-1.64621,1.15844 -6.52385,2.80465 -6.76774,4.5728l0.00001,-0.00001z' id='svg_5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E";
-// eslint-disable-next-line max-len
+
const placeholderTransparentBackground =
"data:image/svg+xml;utf8,%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 421 421' style='enable-background:new 0 0 421 421;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:url(%23SVGID_1_);stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D .st1%7Bfill:%23FFFFFF;%7D .st2%7Bfill:%23717275;%7D .st3%7Bfill:%23DCDDE0;stroke:%23717275;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;%7D%0A%3C/style%3E%3CradialGradient id='SVGID_1_' cx='105.8248' cy='287.7805' r='372.6935' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0.2613' style='stop-color:%23DCDDE0'/%3E%3Cstop offset='0.633' style='stop-color:%23D8DADD'/%3E%3Cstop offset='0.9665' style='stop-color:%23CECFD3'/%3E%3Cstop offset='1' style='stop-color:%23CCCED2'/%3E%3C/radialGradient%3E%3Cpath class='st0' d='M407.2,416.7c-0.2,0.6,0,1.1,0.5,1.3c2.3-1.3,5.2-1.7,7.6-0.8c1.1-2.4,0.2-4,0.1-6.4 c-1.5-25.7-1.2-52.4-1.2-78.3c0-26.8-0.5-53.7,0.9-80.3c1.3-26.2,3.1-51.7,2.1-78c-1-25.9-0.1-52,1.2-77.7c0.6-13.2,1.3-25.7,0.6-39 c-0.8-14.9-0.6-35.9-0.6-50.8c0-1.7,0.3-3-1.3-4c-1.3-0.8-2.5-0.7-4-0.7c-4.1,0-8-0.6-12.1-0.6c-2.5,0-4.7,0-7.1,0.5 c-1.3,0.2-2.5,0.1-3.8,0.1c-1.4,0-2.5,0.3-3.8,0.6c-11.3,1.9-25.8,4.1-37.1,2.9c-11.3-1.2-22.5-1.1-33.7-3.3 c-10.6-2.1-21.2-0.7-31.8-0.7c-6.8,0-13.5,0-20.3,0c-6.5,0-12.8-1.2-19.4-1.2c-10.7,0.1-21.5,0.2-32.2,0.6c-7.4,0.3-14.5,0-21.9,0.7 c-11.2,1-22.6,1.8-33.9,1.7c-5.9,0-11.6,0.4-17.4-0.7c-5.2-1-10.8-0.2-16,0.3c-6.5,0.6-12.9,1.7-19.4,1.7c-6.3-0.1-12.7-1.4-19-1.4 C77,3,70.1,3.9,62.9,3.4c-8.8-0.6-17.4-0.1-26.1-0.2c-1.5,0-2.2,0.4-3.5,0.6C32,4,31,4.4,29.7,4.4c-1.4,0-2.2-0.5-3.5-0.6 C23.5,3.5,16.5,3.7,13.9,3c-2.8-0.7-5.6-1.5-8.4-2.2C3.2,3,3,6.6,2.8,9.8C1.4,45.2,1.6,80.6,1.8,116c0,8.2,0.1,16.4,1,24.5 c0.7,6.3,1.9,12.6,2.4,18.9c0.8,10.2-0.1,20.5-0.6,30.7c-0.6,12-0.6,24,0.1,36c1.6,31-0.8,66.1-1.3,97.1 c-0.6,30.2-1.1,60.9,6.4,90.2c7.6-3,28.1,1.9,37,2.3c9.6,0.4,19.4,0.5,29.1,0.5c11.1,0,22.3-0.6,33.3,0c13.9,0.7,26.4,3.8,40.4,3 c6.8-0.4,14.2,0.6,20.8,0.6c5.4,0,16.2-1.8,20.1,1.2c14.4,0,33.1,0.2,47.4-1.2c14.9-1.4,31.8-2,46.7-0.6c12.1,1.2,23.7,2.2,35.8,0.6 c7.6-1,15-1.8,22.8-1.8c7.1,0,13.6-2.6,20.5-2.4c7.6,0.2,15.4,2.3,23,3.1C391.7,419.2,402.5,414.6,407.2,416.7z'/%3E%3Cg%3E%3Cpath class='st1' d='M379.9,317.1c-1.8,0-6.4-6.9-8.2-9.6c-0.7-1.1-1.3-2-1.7-2.5c-2.9-3.7-6.6-7.4-10.2-10.9 c-1.1-1.1-2.3-2.3-3.4-3.4c-5.8-5.9-14.8-13.1-21.6-15.6c-2.3-0.8-4.2-2-6.1-3c-3.6-2.1-6.9-4-12.3-4.1c-0.5,0-1.1,0-1.6,0 c-6.2,0-12.3,0.8-18.6,1.8c-11.8,1.8-27.6,12.3-35.3,23.5c-1.2,1.8-1.9,3.8-2,5.8c-3.8-0.9-9.2-5.2-12.5-7.8 c-0.5-0.4-1-0.8-1.4-1.1c-4.5-3.5-7.8-7.5-11.4-11.9c-2.1-2.5-4.3-5.1-6.7-7.6c-13-13.4-27.7-25.4-41.9-37 c-7.4-6-15-12.2-22.3-18.5c-9.5-8.2-17-16.1-23.7-24.8c-0.7-0.9-1.4-1.8-2-2.7c-2.6-3.5-5.3-7-8.4-10.1c-1.1-1.1-3.8-3.1-6.9-5.3 c-4.9-3.6-12.4-9-13-11c-0.7-2.3-5.8-5.8-5.9-5.8c-1.4-0.8-2.9-2.3-3-4.3l-0.1-1.4l-1.3,0.6c-4.7,2.2-8.1,5.6-11.6,9.2 c-0.6,0.6-1.1,1.2-1.7,1.7c-9.3,9.4-18.3,19.1-26.7,28.7c-4.1,4.7-8.4,9.9-12,15.4c-1,1.5-1.9,3.3-2.8,5.2c-1.5,3.1-3.1,6.3-5,8.2 c-0.6-0.9-1.2-2.7-1.5-3.5c-0.1-0.3-0.2-0.7-0.3-0.9c-2.1-5.2-1.3-10.7-0.5-16.5c0.6-4.1,1.2-8.2,0.8-12.5c-0.2-1.6-0.5-3.3-0.8-5 c-1-5.7-2-11.5-1.2-16.8c2-15.8,4-32,5-48.1c1.6-15.9,0.7-30.9-0.3-46.8c-0.2-4-0.5-8.2-0.7-12.3c0-1.7-0.1-3.5-0.1-5.2 c-0.2-5.2-0.4-10.2,1-15.1c0.3-0.2,0.8-0.5,1.4-0.6l3.9,1.7c3.7,1.5,8.5,2.3,14.6,2.3c5.6,0,11.5-0.6,17.3-1.2 c5.3-0.5,10.4-1,14.8-1c1.1,0,2.1,0,3.1,0.1c2.5,0.2,5,0.5,7.4,0.8c3.5,0.4,7.2,0.9,10.8,0.9c0.9,0,1.8,0,2.6,0 c6.4,0,13-0.3,19.3-0.6c5.2-0.2,10.6-0.5,15.9-0.6c9-0.1,18.2-0.6,27-1c3.7-0.2,7.3-0.4,11-0.5c7.2-0.3,14.6-0.3,21.7-0.3 c5.1,0,10.4,0,15.7-0.1c10.9-0.3,21.9-0.9,32.5-1.6c11.3-0.7,23.1-1.4,34.6-1.6c2.9-0.1,5.8-0.1,8.6-0.1c6.3-0.1,12.8-0.1,19.3-0.5 c3.7-0.2,7.5-0.6,11.2-0.9c6.2-0.6,12.7-1.1,19-1.1c2.3,0,4.5,0.1,6.6,0.2c3.1,0.2,6.2,0.8,9.5,1.4c4.3,0.8,8.7,1.5,13,1.5 c1.1,0,2.2-0.1,3.2-0.2c-1.2,2.3-1.2,5.2-1.1,6.7c0.2,3.8,0.2,7.9,0.2,11.8c0,15.4-1.6,30-3.3,45.5c-0.6,5.3-1.2,10.9-1.7,16.4 c-1,22.4,0,46.1,1,67l0,7.6c0.5,6.8,0,13.5-0.5,19.9c-0.5,6.4-1,13-0.5,19.6c2.1,19.8,3,38.9,2.7,56.8l0.7,17.4l0.1,0.1 c0.8,2.2,1.6,11.4-0.4,14.4C380.6,317,380.2,317.1,379.9,317.1L379.9,317.1z'/%3E%3Cpath class='st2' d='M351.6,31.1c2.3,0,4.4,0.1,6.5,0.2c3,0.2,6.1,0.8,9.4,1.3c4.3,0.8,8.8,1.6,13.2,1.6c0.6,0,1.1,0,1.7,0 c-0.6,2-0.6,4.1-0.6,5.6c0.2,3.8,0.2,7.8,0.2,11.7c0,15.4-1.6,30-3.3,45.4c-0.6,5.4-1.2,10.9-1.7,16.4l0,0l0,0c-1,22.3,0,46.1,1,67 v7.6v0.1l0,0.1c0.5,6.6,0,13.3-0.5,19.7c-0.5,6.4-1,13.1-0.5,19.7l0,0l0,0c2.1,19.7,3,38.8,2.7,56.6l0,0.1l0,0.1l0.7,17.2l0,0.3 l0.1,0.3c0.8,2.2,1.4,11-0.3,13.6c-0.1,0.1-0.2,0.3-0.3,0.3c-1.7-0.6-6-7-7.4-9.1c-0.8-1.1-1.3-2-1.8-2.6c-3-3.8-6.7-7.4-10.2-11 c-1.1-1.1-2.3-2.2-3.4-3.4c-5.9-6-15-13.2-22-15.8c-2.2-0.8-4.1-1.9-5.9-3c-3.5-2-7.1-4.1-12.8-4.3c-0.5,0-1.1,0-1.6,0 c-6.3,0-12.4,0.8-18.8,1.8c-12.1,1.8-28.2,12.5-36,23.9c-1.1,1.6-1.8,3.3-2.1,5.1c-3.5-1.3-8.1-5-11-7.3c-0.5-0.4-1-0.8-1.4-1.1 c-4.4-3.4-7.7-7.4-11.3-11.7c-2.1-2.5-4.3-5.1-6.7-7.7c-13-13.4-27.7-25.4-42-37c-7.4-6-15-12.2-22.2-18.5 c-9.4-8.2-16.9-16-23.6-24.7c-0.7-0.9-1.4-1.8-2-2.7c-2.6-3.5-5.4-7.1-8.5-10.2c-1.2-1.2-3.8-3.1-7-5.4c-3.9-2.8-12-8.7-12.6-10.5 c-0.8-2.8-6.3-6.4-6.3-6.4c-1.1-0.7-2.4-1.9-2.5-3.5l-0.2-2.8l-2.6,1.2c-4.9,2.2-8.5,5.9-11.9,9.4c-0.6,0.6-1.1,1.2-1.7,1.7 c-9.3,9.4-18.3,19.1-26.7,28.7c-4.2,4.8-8.5,10-12.1,15.5c-1,1.5-1.9,3.4-2.9,5.4c-1.2,2.4-2.4,5-3.9,6.8c-0.3-0.8-0.7-1.6-0.8-2.1 c-0.1-0.4-0.3-0.7-0.4-0.9c-2-4.9-1.3-10.3-0.4-15.9c0.6-4.1,1.2-8.4,0.8-12.7l0,0l0,0c-0.2-1.6-0.5-3.2-0.8-4.9 c-1-5.6-1.9-11.4-1.2-16.5c2-15.8,4-32,5-48.1c1.6-16,0.7-31-0.3-47c-0.2-4-0.5-8.1-0.7-12.2c0-1.8-0.1-3.5-0.1-5.3 c-0.2-5-0.3-9.8,0.9-14.5c0.1-0.1,0.3-0.1,0.4-0.2l3.7,1.6c3.8,1.6,8.7,2.4,15,2.4c5.6,0,11.6-0.6,17.4-1.2c5.3-0.5,10.3-1,14.7-1 c1.1,0,2.1,0,3,0.1c2.4,0.2,4.9,0.5,7.3,0.7c3.6,0.4,7.2,0.9,10.9,0.9c0.9,0,1.8,0,2.6,0c6.5,0,13-0.3,19.3-0.6 c5.2-0.2,10.6-0.5,15.9-0.6c9-0.1,18.2-0.6,27-1c3.7-0.2,7.3-0.4,11-0.5c7.2-0.3,14.5-0.3,21.6-0.3c5.1,0,10.5,0,15.7-0.1 c10.9-0.3,21.9-0.9,32.6-1.6c11.3-0.7,23-1.4,34.6-1.6c2.9-0.1,5.8-0.1,8.6-0.1c6.3-0.1,12.9-0.1,19.3-0.5 c3.8-0.2,7.6-0.6,11.3-0.9C338.9,31.7,345.4,31.1,351.6,31.1L351.6,31.1 M351.6,29.1c-10.1,0-20.2,1.4-30.3,2 c-9.3,0.5-18.6,0.4-27.8,0.6c-22.4,0.4-44.7,2.6-67.2,3.2c-12.5,0.3-24.9-0.1-37.4,0.5c-12.7,0.5-25.3,1.3-38,1.5 c-11.7,0.2-23.4,1.2-35.2,1.2c-0.9,0-1.7,0-2.6,0c-6.1-0.1-12.1-1.2-18.1-1.7c-1-0.1-2-0.1-3.1-0.1c-9.2,0-21.4,2.2-32,2.2 c-5.3,0-10.3-0.5-14.3-2.2l-4.1-1.8c-1.5,0-2.5,1-2.5,1c-2,7-1,14-1,21c1,20,3,39,1,59c-1,16-3,32-5,48c-1,7,1,15,2,22 c1,10-4,20-0.2,29.2c0.5,1.2,1.6,4.6,2.7,5.4c3.8-2.8,6-10.1,8.7-14.3c3.5-5.4,7.8-10.6,11.9-15.3c8.6-9.8,17.5-19.4,26.6-28.6 c4.1-4.1,7.7-8.3,13-10.8c0.2,2.2,1.7,4,3.5,5.1c0.4,0.2,4.9,3.4,5.4,5.2c1,3.6,17.1,13.7,20.1,16.8c3.9,3.9,7.1,8.4,10.4,12.7 c7.2,9.3,15,17.3,23.9,25c21.3,18.5,44.4,35.1,64.1,55.4c6.4,6.6,10.9,13.9,18.2,19.5c3.8,3,10.9,9,15.6,9.3 c-0.2-2.3,0.6-4.5,1.9-6.4c7.1-10.4,22.4-21.2,34.6-23.1c6-0.9,12.3-1.8,18.5-1.8c0.5,0,1,0,1.6,0c7.9,0.2,11.4,4.6,18,7.1 c7,2.6,15.9,9.9,21.3,15.4c4.5,4.6,9.6,9.3,13.4,14.2c1.6,2.1,7.6,12.4,10.7,12.4c0,0,0.1,0,0.1,0c4.5-0.3,3.4-13.8,2.4-16.6 l-0.7-17.2c0.3-18.9-0.7-37.9-2.7-56.9c-1-13,2-26,1-39.4v-7.7c-1-21.9-2-44.9-1-66.9c2-21,5-41,5-62c0-4,0-8-0.2-11.8 c-0.1-2.6,0.2-6.3,2.5-8c-1.8,0.4-3.7,0.5-5.6,0.5c-7.5,0-15.2-2.4-22.4-2.9C356.1,29.2,353.9,29.1,351.6,29.1L351.6,29.1z M389,30.9c-1.1,0-2,0.3-2.7,0.8c1-0.2,2-0.5,3-0.8C389.2,30.9,389.1,30.9,389,30.9L389,30.9z'/%3E%3C/g%3E%3Cpath class='st3' d='M251.9,106c-5.1,5.6-7.2,16.1-7.9,23.3c-1,9.9-2.4,18,4.5,25.7c7.6,8.4,20.6,16.2,31.5,19.1 c5.7,1.6,12.3-1.2,17.7-2.3c13-2.8,19.6-10.7,25.3-22.8c6.9-14.4,1.1-25.8-4.7-39.3c-6.3-14.6-25.5-21.2-40.7-19.2 c-6.2,0.8-9.7,4.6-14.6,8C260.3,100.4,252.3,103.1,251.9,106z'/%3E%3C/svg%3E";
export { placeholderWhiteBackground, placeholderTransparentBackground };
diff --git a/packages/js/components/src/search-list-control/index.js b/packages/js/components/src/search-list-control/index.js
index 16507307c5d..3daf363213d 100644
--- a/packages/js/components/src/search-list-control/index.js
+++ b/packages/js/components/src/search-list-control/index.js
@@ -166,7 +166,7 @@ export const SearchListControl = ( props ) => {
<span className="woocommerce-search-list__not-found-text">
{ searchValue
? // eslint-disable-next-line @wordpress/valid-sprintf
- sprintf( messages.noResults || '', searchValue )
+ sprintf( messages.noResults || '', searchValue )
: messages.noItems }
</span>
</div>
diff --git a/packages/js/components/src/search-list-control/test/index.js b/packages/js/components/src/search-list-control/test/index.js
index e364900a710..33d035ae666 100644
--- a/packages/js/components/src/search-list-control/test/index.js
+++ b/packages/js/components/src/search-list-control/test/index.js
@@ -149,7 +149,7 @@ describe( 'SearchListControl', () => {
test( 'should render a search box and list of options, with a custom render callback for each item', () => {
const renderItem = ( { item } ) => (
<div key={ item.id }>{ item.name }!</div>
- ); // eslint-disable-line
+ );
const component = render(
<SearchListControl
instanceId={ 1 }
diff --git a/packages/js/components/src/search/autocompleters/attributes.tsx b/packages/js/components/src/search/autocompleters/attributes.tsx
index 4cec0878fe8..5095f378b1b 100644
--- a/packages/js/components/src/search/autocompleters/attributes.tsx
+++ b/packages/js/components/src/search/autocompleters/attributes.tsx
@@ -22,7 +22,7 @@ const completer: AutoCompleter = {
search,
per_page: 10,
orderby: 'count',
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/products/attributes', query ),
diff --git a/packages/js/components/src/search/autocompleters/categories.tsx b/packages/js/components/src/search/autocompleters/categories.tsx
index 9b022bcb1f6..7770f66a359 100644
--- a/packages/js/components/src/search/autocompleters/categories.tsx
+++ b/packages/js/components/src/search/autocompleters/categories.tsx
@@ -22,7 +22,7 @@ const completer: AutoCompleter = {
search,
per_page: 10,
orderby: 'count',
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/products/categories', query ),
diff --git a/packages/js/components/src/search/autocompleters/coupons.tsx b/packages/js/components/src/search/autocompleters/coupons.tsx
index 4d6dd536157..c276c285c35 100644
--- a/packages/js/components/src/search/autocompleters/coupons.tsx
+++ b/packages/js/components/src/search/autocompleters/coupons.tsx
@@ -21,7 +21,7 @@ const completer: AutoCompleter = {
? {
search,
per_page: 10,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/coupons', query ),
diff --git a/packages/js/components/src/search/autocompleters/customer-names.tsx b/packages/js/components/src/search/autocompleters/customer-names.tsx
index c53e2afa8de..af028399d6d 100644
--- a/packages/js/components/src/search/autocompleters/customer-names.tsx
+++ b/packages/js/components/src/search/autocompleters/customer-names.tsx
@@ -26,7 +26,7 @@ const completer: AutoCompleter = {
search: name,
searchby: 'name',
per_page: 10,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/customers', query ),
diff --git a/packages/js/components/src/search/autocompleters/download-ips.tsx b/packages/js/components/src/search/autocompleters/download-ips.tsx
index 9dcc1862720..ed253675340 100644
--- a/packages/js/components/src/search/autocompleters/download-ips.tsx
+++ b/packages/js/components/src/search/autocompleters/download-ips.tsx
@@ -18,7 +18,7 @@ const completer: AutoCompleter = {
const query = match
? {
match,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/data/download-ips', query ),
diff --git a/packages/js/components/src/search/autocompleters/emails.tsx b/packages/js/components/src/search/autocompleters/emails.tsx
index d2b6e116f9f..0d2930d8869 100644
--- a/packages/js/components/src/search/autocompleters/emails.tsx
+++ b/packages/js/components/src/search/autocompleters/emails.tsx
@@ -20,7 +20,7 @@ const completer: AutoCompleter = {
search,
searchby: 'email',
per_page: 10,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/customers', query ),
diff --git a/packages/js/components/src/search/autocompleters/orders.tsx b/packages/js/components/src/search/autocompleters/orders.tsx
index 3baac31f0c6..aba150d21a8 100644
--- a/packages/js/components/src/search/autocompleters/orders.tsx
+++ b/packages/js/components/src/search/autocompleters/orders.tsx
@@ -19,7 +19,7 @@ const completer: AutoCompleter = {
? {
number: search,
per_page: 10,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/orders', query ),
diff --git a/packages/js/components/src/search/autocompleters/product.tsx b/packages/js/components/src/search/autocompleters/product.tsx
index 89e743cd49d..2e85fb43435 100644
--- a/packages/js/components/src/search/autocompleters/product.tsx
+++ b/packages/js/components/src/search/autocompleters/product.tsx
@@ -23,7 +23,7 @@ const completer: AutoCompleter = {
search,
per_page: 10,
orderby: 'popularity',
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/products', query ),
diff --git a/packages/js/components/src/search/autocompleters/registered-customers.tsx b/packages/js/components/src/search/autocompleters/registered-customers.tsx
index 323b406e1b4..805a198067d 100644
--- a/packages/js/components/src/search/autocompleters/registered-customers.tsx
+++ b/packages/js/components/src/search/autocompleters/registered-customers.tsx
@@ -47,8 +47,8 @@ const getSuggestion = ( customer: Customer, query: string ) => {
return name;
}
- const matched = [ customer.username, customer.email ].find(
- ( field ) => field?.toLocaleLowerCase().includes( search )
+ const matched = [ customer.username, customer.email ].find( ( field ) =>
+ field?.toLocaleLowerCase().includes( search )
);
if ( ! matched ) {
@@ -78,7 +78,7 @@ const completer: AutoCompleter = {
searchby: 'all',
user_type: 'registered',
per_page: 10,
- }
+ }
: { user_type: 'registered' };
return apiFetch( {
path: addQueryArgs( '/wc-analytics/customers', query ),
diff --git a/packages/js/components/src/search/autocompleters/usernames.tsx b/packages/js/components/src/search/autocompleters/usernames.tsx
index a0c2b711c7f..186f2f04eff 100644
--- a/packages/js/components/src/search/autocompleters/usernames.tsx
+++ b/packages/js/components/src/search/autocompleters/usernames.tsx
@@ -20,7 +20,7 @@ const completer: AutoCompleter = {
search,
searchby: 'username',
per_page: 10,
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/customers', query ),
diff --git a/packages/js/components/src/search/autocompleters/variable-product.tsx b/packages/js/components/src/search/autocompleters/variable-product.tsx
index 2e72c92c773..2edb189a020 100644
--- a/packages/js/components/src/search/autocompleters/variable-product.tsx
+++ b/packages/js/components/src/search/autocompleters/variable-product.tsx
@@ -20,7 +20,7 @@ const completer: AutoCompleter = {
per_page: 10,
orderby: 'popularity',
type: 'variable',
- }
+ }
: {};
return apiFetch( {
path: addQueryArgs( '/wc-analytics/products', query ),
diff --git a/packages/js/components/src/search/autocompleters/variations.tsx b/packages/js/components/src/search/autocompleters/variations.tsx
index 2807c924849..947647a4643 100644
--- a/packages/js/components/src/search/autocompleters/variations.tsx
+++ b/packages/js/components/src/search/autocompleters/variations.tsx
@@ -58,7 +58,7 @@ const completer: AutoCompleter = {
'name',
'sku',
],
- }
+ }
: {};
const product = ( getQuery() as Record< string, string > ).products;
diff --git a/packages/js/components/src/search/test/index.js b/packages/js/components/src/search/test/index.js
index 10353bdba38..5273a192a71 100644
--- a/packages/js/components/src/search/test/index.js
+++ b/packages/js/components/src/search/test/index.js
@@ -15,14 +15,14 @@ const delay = ( timeout ) =>
new Promise( ( resolve ) => setTimeout( resolve, timeout ) );
describe( 'Search', () => {
- it( 'shows the free text search option', () => {
+ it( 'shows the free text search option', async () => {
const { getByRole, queryAllByRole } = render(
<Search type="products" allowFreeTextSearch />
);
- userEvent.type( getByRole( 'combobox' ), 'Product Query' );
+ await userEvent.type( getByRole( 'combobox' ), 'Product Query' );
expect( queryAllByRole( 'option' ) ).toHaveLength( 1 );
- userEvent.clear( getByRole( 'combobox' ) );
+ await userEvent.clear( getByRole( 'combobox' ) );
expect( queryAllByRole( 'option' ) ).toHaveLength( 0 );
} );
@@ -56,7 +56,7 @@ describe( 'Search', () => {
/>
);
// Emulate typing to render available options.
- userEvent.type( getByRole( 'combobox' ), 'A' );
+ await userEvent.type( getByRole( 'combobox' ), 'A' );
// Wait for async options processing.
await waitFor( () => {
expect( queryAllByRole( 'option' ) ).toHaveLength( 3 );
@@ -84,7 +84,7 @@ describe( 'Search', () => {
/>
);
// Emulate typing to render available options.
- userEvent.type( getByRole( 'combobox' ), 'A' );
+ await userEvent.type( getByRole( 'combobox' ), 'A' );
// Wait for async options processing.
await waitFor( () => {
expect( optionsSpy ).toHaveBeenCalledWith( 'A' );
@@ -116,7 +116,7 @@ describe( 'Search', () => {
/>
);
// Emulate typing to render available options.
- userEvent.type( getByRole( 'combobox' ), 'A' );
+ await userEvent.type( getByRole( 'combobox' ), 'A' );
// Wait for async options processing.
await waitFor( () => {
expect( optionsSpy ).toHaveBeenCalledWith( 'A' );
diff --git a/packages/js/components/src/segmented-selection/index.js b/packages/js/components/src/segmented-selection/index.js
index 1658fc00d29..8f855facc21 100644
--- a/packages/js/components/src/segmented-selection/index.js
+++ b/packages/js/components/src/segmented-selection/index.js
@@ -33,7 +33,6 @@ class SegmentedSelection extends Component {
className="woocommerce-segmented-selection__item"
key={ value }
>
- { /* eslint-disable jsx-a11y/label-has-for */ }
<input
className="woocommerce-segmented-selection__input"
type="radio"
@@ -49,7 +48,6 @@ class SegmentedSelection extends Component {
{ label }
</span>
</label>
- { /* eslint-enable jsx-a11y/label-has-for */ }
</div>
);
} ) }
diff --git a/packages/js/components/src/select-control/index.tsx b/packages/js/components/src/select-control/index.tsx
index a0996b91d8c..61402b59897 100644
--- a/packages/js/components/src/select-control/index.tsx
+++ b/packages/js/components/src/select-control/index.tsx
@@ -274,7 +274,7 @@ export class SelectControl extends Component< Props, State > {
newState.selectedIndex = ! excludeSelectedOptions
? this.props.options.findIndex(
( i ) => i.key === selected[ 0 ].key
- )
+ )
: null;
}
@@ -344,8 +344,8 @@ export class SelectControl extends Component< Props, State > {
// After selecting option, the list will reset and we'd need to correct selectedIndex.
const newSelectedIndex = this.props.excludeSelectedOptions
? // Since we're excluding the selected option, invalidate selection
- // so re-focusing wont immediately set it to the neighbouring option.
- null
+ // so re-focusing wont immediately set it to the neighbouring option.
+ null
: this.getOptions().findIndex( ( i ) => i.key === option.key );
this.setState( {
diff --git a/packages/js/components/src/sortable/sortable-item.tsx b/packages/js/components/src/sortable/sortable-item.tsx
index 4ea5358eba0..680792bdbb5 100644
--- a/packages/js/components/src/sortable/sortable-item.tsx
+++ b/packages/js/components/src/sortable/sortable-item.tsx
@@ -63,7 +63,7 @@ export const SortableItem = ( {
onDrop={ ( event ) => event.preventDefault() }
ref={ ref }
tabIndex={ isSelected ? 0 : -1 }
- // eslint-disable-next-line jsx-a11y/aria-props
+
aria-description={ __(
'Press spacebar to reorder',
'woocommerce'
diff --git a/packages/js/components/src/summary/number.js b/packages/js/components/src/summary/number.js
index fbd52af4094..dd61d19b916 100644
--- a/packages/js/components/src/summary/number.js
+++ b/packages/js/components/src/summary/number.js
@@ -65,19 +65,19 @@ const SummaryNumber = ( {
let screenReaderLabel =
delta > 0
? // eslint-disable-next-line @wordpress/valid-sprintf -- false positive from %%
- sprintf(
+ sprintf(
/* translators: percentage change upwards */
__( 'Up %f%% from %s', 'woocommerce' ),
delta,
prevLabel
- )
+ )
: // eslint-disable-next-line @wordpress/valid-sprintf -- false positive from %%
- sprintf(
+ sprintf(
/* translators: percentage change downwards */
__( 'Down %f%% from %s', 'woocommerce' ),
Math.abs( delta ),
prevLabel
- );
+ );
if ( ! delta ) {
screenReaderLabel = sprintf(
/* translators: previous value */
@@ -155,12 +155,11 @@ const SummaryNumber = ( {
>
<Text variant="caption" size="12" lineHeight="16px">
{ ! isNil( delta )
- ? // eslint-disable-next-line @wordpress/valid-sprintf -- false positive from %%
- sprintf(
+ ? sprintf(
/* translators: percentage change */
__( '%f%%', 'woocommerce' ),
delta
- )
+ )
: __( 'N/A', 'woocommerce' ) }
</Text>
</div>
diff --git a/packages/js/components/src/table/index.tsx b/packages/js/components/src/table/index.tsx
index 08be0c658c0..7aa5b905e96 100644
--- a/packages/js/components/src/table/index.tsx
+++ b/packages/js/components/src/table/index.tsx
@@ -64,7 +64,6 @@ const TableCard: React.FC< TableCardProps > = ( {
emptyMessage = undefined,
...props
} ) => {
- // eslint-disable-next-line no-console
const getShowCols = ( _headers: TableCardProps[ 'headers' ] = [] ) => {
return _headers
.map( ( { key, visible } ) => {
diff --git a/packages/js/components/src/table/table.tsx b/packages/js/components/src/table/table.tsx
index dd0fce2f0d0..0c5407e2f63 100644
--- a/packages/js/components/src/table/table.tsx
+++ b/packages/js/components/src/table/table.tsx
@@ -267,7 +267,7 @@ const Table: React.FC< TableProps > = ( {
( typeof label === 'string'
? label
: '' )
- )
+ )
: sprintf(
/* translators: %s: column label */
__(
@@ -278,7 +278,7 @@ const Table: React.FC< TableProps > = ( {
( typeof label === 'string'
? label
: '' )
- );
+ );
const textLabel = (
<Fragment>
diff --git a/packages/js/components/src/table/test/index.js b/packages/js/components/src/table/test/index.js
index 90f3acb48d6..741aec6d798 100644
--- a/packages/js/components/src/table/test/index.js
+++ b/packages/js/components/src/table/test/index.js
@@ -64,7 +64,7 @@ describe( 'TableCard', () => {
);
} );
- it( 'should not error with default callback props', () => {
+ it( 'should not error with default callback props', async () => {
render(
<TableCard
title="Revenue"
@@ -78,12 +78,12 @@ describe( 'TableCard', () => {
);
// Trigger a query change (next page).
- userEvent.click(
+ await userEvent.click(
screen.getByLabelText( 'Next Page', { selector: 'button' } )
);
// Trigger a column change.
- userEvent.click(
+ await userEvent.click(
screen.getByTitle( 'Choose which values to display', {
selector: 'button',
} )
diff --git a/packages/js/components/src/tour-kit/components/step-navigation.tsx b/packages/js/components/src/tour-kit/components/step-navigation.tsx
index 12ee2aa4441..e02082a7827 100644
--- a/packages/js/components/src/tour-kit/components/step-navigation.tsx
+++ b/packages/js/components/src/tour-kit/components/step-navigation.tsx
@@ -113,7 +113,7 @@ const StepNavigation = ( {
__( 'Step %1$d of %2$d', 'woocommerce' ),
currentStepIndex + 1,
steps.length
- )
+ )
: null }
</div>
{ renderButtons() }
diff --git a/packages/js/components/src/tree-select-control/control.js b/packages/js/components/src/tree-select-control/control.js
index d0c8c30a0e2..e5ac584dbff 100644
--- a/packages/js/components/src/tree-select-control/control.js
+++ b/packages/js/components/src/tree-select-control/control.js
@@ -63,7 +63,9 @@ const Control = forwardRef(
*/
const handleKeydown = ( event ) => {
if ( BACKSPACE === event.key ) {
- if ( value ) return;
+ if ( value ) {
+ return;
+ }
onTagsChange( tags.slice( 0, -1 ) );
event.preventDefault();
}
diff --git a/packages/js/components/src/tree-select-control/index.js b/packages/js/components/src/tree-select-control/index.js
index c6ead2dc9ae..200524a0ce4 100644
--- a/packages/js/components/src/tree-select-control/index.js
+++ b/packages/js/components/src/tree-select-control/index.js
@@ -121,7 +121,7 @@ const TreeSelectControl = ( {
label: selectAllLabel,
value: ROOT_VALUE,
children: options,
- }
+ }
: null;
const treeOptions = useIsEqualRefValue( root ? [ root ] : options );
@@ -181,7 +181,9 @@ const TreeSelectControl = ( {
const highlightOptionLabel = ( optionLabel, matchPosition ) => {
const matchLength = matchPosition + filter.length;
- if ( ! isSearching ) return optionLabel;
+ if ( ! isSearching ) {
+ return optionLabel;
+ }
return (
<span>
@@ -373,7 +375,9 @@ const TreeSelectControl = ( {
* @param {Event} event The key down event
*/
const onKeyDown = ( event ) => {
- if ( disabled ) return;
+ if ( disabled ) {
+ return;
+ }
if ( ESCAPE === event.key ) {
setTreeVisible( false );
diff --git a/packages/js/components/src/tree-select-control/options.js b/packages/js/components/src/tree-select-control/options.js
index 71bc0a4977d..254c9ef8dca 100644
--- a/packages/js/components/src/tree-select-control/options.js
+++ b/packages/js/components/src/tree-select-control/options.js
@@ -57,8 +57,12 @@ const Options = ( {
const isRoot = option.value === ROOT_VALUE;
const { hasChildren, checked, partialChecked, expanded } = option;
- if ( ! option?.value ) return null;
- if ( ! isRoot && ! option?.isVisible ) return null;
+ if ( ! option?.value ) {
+ return null;
+ }
+ if ( ! isRoot && ! option?.isVisible ) {
+ return null;
+ }
return (
<div
diff --git a/packages/js/components/src/tree-select-control/tags.js b/packages/js/components/src/tree-select-control/tags.js
index ea7019fe719..bfaf990447b 100644
--- a/packages/js/components/src/tree-select-control/tags.js
+++ b/packages/js/components/src/tree-select-control/tags.js
@@ -89,7 +89,7 @@ const Tags = ( {
// translators: %d: The number of extra tags to show
__( '+ %d more', 'woocommerce' ),
tags.length - maxTags
- ) }
+ ) }
</Button>
) }
</div>
diff --git a/packages/js/components/src/tree-select-control/test/control.test.js b/packages/js/components/src/tree-select-control/test/control.test.js
index 566daf8728c..a2987385a7e 100644
--- a/packages/js/components/src/tree-select-control/test/control.test.js
+++ b/packages/js/components/src/tree-select-control/test/control.test.js
@@ -18,7 +18,7 @@ describe( 'TreeSelectControl - Control Component', () => {
},
};
- it( 'Renders the tags and calls onTagsChange when they change', () => {
+ it( 'Renders the tags and calls onTagsChange when they change', async () => {
const { queryByText, queryByLabelText, rerender } = render(
<Control
ref={ ref }
@@ -28,7 +28,7 @@ describe( 'TreeSelectControl - Control Component', () => {
);
expect( queryByText( 'Spain (1 of 1)' ) ).toBeTruthy();
- userEvent.click( queryByLabelText( 'Remove Spain' ) );
+ await userEvent.click( queryByLabelText( 'Remove Spain' ) );
expect( onTagsChange ).toHaveBeenCalledTimes( 1 );
expect( onTagsChange ).toHaveBeenCalledWith( [] );
@@ -42,11 +42,11 @@ describe( 'TreeSelectControl - Control Component', () => {
);
expect( screen.queryByText( 'Spain (1 of 1)' ) ).toBeTruthy();
- userEvent.click( screen.queryByLabelText( 'Remove Spain' ) );
+ await userEvent.click( screen.queryByLabelText( 'Remove Spain' ) );
expect( onTagsChange ).toHaveBeenCalledTimes( 1 );
} );
- it( 'Calls onInputChange when typing', () => {
+ it( 'Calls onInputChange when typing', async () => {
const onInputChange = jest
.fn()
.mockName( 'onInputChange' )
@@ -58,7 +58,7 @@ describe( 'TreeSelectControl - Control Component', () => {
const input = queryByRole( 'combobox' );
expect( input ).toBeTruthy();
expect( input.hasAttribute( 'disabled' ) ).toBeFalsy();
- userEvent.type( input, 'a' );
+ await userEvent.type( input, 'a' );
expect( onInputChange ).toHaveBeenCalledTimes( 1 );
expect( onInputChange ).toHaveNthReturnedWith( 1, 'a' );
fireEvent.change( input, { target: { value: 'test' } } );
@@ -66,7 +66,7 @@ describe( 'TreeSelectControl - Control Component', () => {
expect( onInputChange ).toHaveNthReturnedWith( 2, 'test' );
} );
- it( 'Allows disabled input', () => {
+ it( 'Allows disabled input', async () => {
const onInputChange = jest.fn().mockName( 'onInputChange' );
const { queryByRole } = render(
<Control disabled={ true } onInputChange={ onInputChange } />
@@ -75,16 +75,16 @@ describe( 'TreeSelectControl - Control Component', () => {
const input = queryByRole( 'combobox' );
expect( input ).toBeTruthy();
expect( input.hasAttribute( 'disabled' ) ).toBeTruthy();
- userEvent.type( input, 'a' );
+ await userEvent.type( input, 'a' );
expect( onInputChange ).not.toHaveBeenCalled();
} );
- it( 'Calls onFocus callback when it is focused', () => {
+ it( 'Calls onFocus callback when it is focused', async () => {
const onFocus = jest.fn().mockName( 'onFocus' );
const { queryByRole } = render(
<Control ref={ ref } onFocus={ onFocus } />
);
- userEvent.click( queryByRole( 'combobox' ) );
+ await userEvent.click( queryByRole( 'combobox' ) );
expect( onFocus ).toHaveBeenCalled();
} );
diff --git a/packages/js/create-woo-extension/index.js b/packages/js/create-woo-extension/index.js
index 1371d0c0334..1c8e69b156a 100644
--- a/packages/js/create-woo-extension/index.js
+++ b/packages/js/create-woo-extension/index.js
@@ -23,7 +23,7 @@ const defaultDevDependencies = {
* Without this, `@wordpress/prettier-config`'s `prettier: >=3` peer hoists plain
* prettier over wp-prettier. Pinned to match `@woocommerce/eslint-plugin`.
*/
- prettier: 'npm:wp-prettier@3.0.3',
+ prettier: 'npm:wp-prettier@3.9.6',
};
/*
diff --git a/packages/js/csv-export/src/index.ts b/packages/js/csv-export/src/index.ts
index a48d57a3239..6139f4750cc 100644
--- a/packages/js/csv-export/src/index.ts
+++ b/packages/js/csv-export/src/index.ts
@@ -137,7 +137,6 @@ export function generateCSVFileName(
* @param {string} content Contents of the file to download
*/
export function downloadCSVFile( fileName: string, content: BlobPart ) {
- // eslint-disable-next-line no-undef
const blob = new Blob( [ content ], { type: 'text/csv;charset=utf-8' } );
saveAs( blob, fileName );
diff --git a/packages/js/currency/src/utils.tsx b/packages/js/currency/src/utils.tsx
index 41b7f63e77e..a2db8c7b617 100644
--- a/packages/js/currency/src/utils.tsx
+++ b/packages/js/currency/src/utils.tsx
@@ -154,7 +154,7 @@ const CurrencyFactoryBase = function ( currencySetting?: CurrencyConfig ) {
const { priceFormat, symbol, code } = currency;
// @ts-expect-error priceFormat is dynamic, but is expected to include placeholders for the currency and amount.
- // eslint-disable-next-line @wordpress/valid-sprintf
+
return sprintf( priceFormat, useCode ? code : symbol, formattedNumber );
}
diff --git a/packages/js/customer-effort-score/src/components/customer-feedback-modal/index.tsx b/packages/js/customer-effort-score/src/components/customer-feedback-modal/index.tsx
index dd2bdc8baa1..fe9c1df01f9 100644
--- a/packages/js/customer-effort-score/src/components/customer-feedback-modal/index.tsx
+++ b/packages/js/customer-effort-score/src/components/customer-feedback-modal/index.tsx
@@ -106,7 +106,7 @@ export function CustomerFeedbackModal( {
label: __( 'Strongly Agree', 'woocommerce' ),
value: '5',
},
- ];
+ ];
const [ firstQuestionScore, setFirstQuestionScore ] = useState(
defaultScore || NaN
diff --git a/packages/js/data/src/crud/index.ts b/packages/js/data/src/crud/index.ts
index 6df459118bc..b53333a9589 100644
--- a/packages/js/data/src/crud/index.ts
+++ b/packages/js/data/src/crud/index.ts
@@ -44,10 +44,8 @@ interface CrudStoreParams<
}
export const createCrudDataStore = <
- Actions extends Record<
- string,
- ( ...args: AnyArguments ) => unknown
- > = Record< string, ( ...args: AnyArguments ) => unknown >,
+ Actions extends Record< string, ( ...args: AnyArguments ) => unknown > =
+ Record< string, ( ...args: AnyArguments ) => unknown >,
Selectors = unknown,
>( {
storeName,
diff --git a/packages/js/data/src/crud/selectors.ts b/packages/js/data/src/crud/selectors.ts
index 81894ba631d..507ed7e5a10 100644
--- a/packages/js/data/src/crud/selectors.ts
+++ b/packages/js/data/src/crud/selectors.ts
@@ -168,11 +168,12 @@ export const createSelectors = ( {
const sanitizedArgs = maybeReplaceIdQuery( args, namespace );
const actionName = getGenericActionName( action, resourceName );
const requestId = getRequestIdentifier( actionName, ...sanitizedArgs );
- if ( action )
+ if ( action ) {
return (
state.requesting.hasOwnProperty( requestId ) &&
! state.requesting[ requestId ]
);
+ }
};
const isRequesting = (
diff --git a/packages/js/data/src/crud/test/utils.ts b/packages/js/data/src/crud/test/utils.ts
index 649b5e95256..50b42394b13 100644
--- a/packages/js/data/src/crud/test/utils.ts
+++ b/packages/js/data/src/crud/test/utils.ts
@@ -76,8 +76,8 @@ describe( 'utils', () => {
const wrappedFunction = applyNamespace( mockedCallback, namespace );
wrappedFunction( 'a' );
- expect( mockedCallback ).toBeCalledTimes( 1 );
- expect( mockedCallback ).toBeCalledWith( 'a', 'test/namespace' );
+ expect( mockedCallback ).toHaveBeenCalledTimes( 1 );
+ expect( mockedCallback ).toHaveBeenCalledWith( 'a', 'test/namespace' );
} );
it( 'should get the keys from a namespace', () => {
diff --git a/packages/js/data/src/crud/types.ts b/packages/js/data/src/crud/types.ts
index 7913c90b9ce..e7a912afe43 100644
--- a/packages/js/data/src/crud/types.ts
+++ b/packages/js/data/src/crud/types.ts
@@ -61,7 +61,7 @@ export type CrudActions<
? WithRequiredProperty<
Partial< MutableProperties >,
RequiredFields
- >
+ >
: Partial< MutableProperties >,
options?: CrudActionOptions
) => ItemType;
@@ -137,20 +137,19 @@ export type CrudSelectors<
WPDataSelectors;
export type MapSelectors< Type, ResourceName, ParamType, ReturnType > = {
- [ Property in keyof Type as `get${ Capitalize<
- string & ResourceName
- > }${ Capitalize< string & Property > }` ]: (
- state: unknown,
- x?: ParamType
- ) => ReturnType;
+ [
+ Property in keyof Type as `get${ Capitalize<
+ string & ResourceName
+ > }${ Capitalize< string & Property > }`
+ ]: ( state: unknown, x?: ParamType ) => ReturnType;
};
export type MapActions< Type, ResourceName, ReturnType > = {
- [ Property in keyof Type as `${ Lowercase<
- string & Property
- > }${ Capitalize< string & ResourceName > }` ]: Type[ Property ] extends (
- ...args: infer P
- ) => unknown
+ [
+ Property in keyof Type as `${ Lowercase<
+ string & Property
+ > }${ Capitalize< string & ResourceName > }`
+ ]: Type[ Property ] extends ( ...args: infer P ) => unknown
? ( ...args: P ) => ReturnType
: never;
};
diff --git a/packages/js/data/src/export/selectors.ts b/packages/js/data/src/export/selectors.ts
index 764b449267b..42201dc0630 100644
--- a/packages/js/data/src/export/selectors.ts
+++ b/packages/js/data/src/export/selectors.ts
@@ -11,7 +11,7 @@ export const isExportRequesting = (
) => {
return Boolean(
state.requesting[ selector ] &&
- state.requesting[ selector ][ hashExportArgs( selectorArgs ) ]
+ state.requesting[ selector ][ hashExportArgs( selectorArgs ) ]
);
};
diff --git a/packages/js/data/src/import/types.ts b/packages/js/data/src/import/types.ts
index 5a4d5998991..bdb004d7c94 100644
--- a/packages/js/data/src/import/types.ts
+++ b/packages/js/data/src/import/types.ts
@@ -14,8 +14,7 @@ type SchedulerImportStatus = {
};
export type ImportStatus =
- | isImporting
- | ( isImporting & SchedulerImportStatus );
+ isImporting | ( isImporting & SchedulerImportStatus );
export type ImportStatusQuery = number;
diff --git a/packages/js/data/src/index.ts b/packages/js/data/src/index.ts
index a6765b8535f..1f61597b9a9 100644
--- a/packages/js/data/src/index.ts
+++ b/packages/js/data/src/index.ts
@@ -268,58 +268,58 @@ import { ActivityPanelSelectors } from './activity-panel/types';
export type WCSelectorType< T > = T extends typeof REVIEWS_STORE_NAME
? WPDataSelectors
: T extends typeof SETTINGS_STORE_NAME
- ? WPDataSelectors
- : T extends typeof PLUGINS_STORE_NAME
- ? PluginSelectors
- : T extends typeof ONBOARDING_STORE_NAME
- ? OnboardingSelectors
- : T extends typeof PAYMENT_GATEWAYS_STORE_NAME
- ? PaymentSelectors
- : T extends typeof PAYMENT_SETTINGS_STORE_NAME
- ? PaymentSettingsSelectors
- : T extends typeof WOOPAYMENTS_ONBOARDING_STORE_NAME
- ? WooPaymentsOnboardingSelectors
- : T extends typeof SHIPPING_METHODS_STORE_NAME
- ? ShippingMethodsSelectors
- : T extends typeof USER_STORE_NAME
- ? WPDataSelectors
- : T extends typeof OPTIONS_STORE_NAME
- ? OptionsSelectors
- : T extends typeof NAVIGATION_STORE_NAME
- ? WPDataSelectors
- : T extends typeof NOTES_STORE_NAME
- ? WPDataSelectors
- : T extends typeof REPORTS_STORE_NAME
- ? WPDataSelectors
- : T extends typeof ITEMS_STORE_NAME
- ? WPDataSelectors
- : T extends typeof COUNTRIES_STORE_NAME
- ? WPDataSelectors
- : T extends typeof PRODUCTS_STORE_NAME
- ? ProductsSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_ATTRIBUTES_STORE_NAME
- ? ProductAttributeSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_SHIPPING_CLASSES_STORE_NAME
- ? ProductShippingClassSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_TAGS_STORE_NAME
- ? ProductTagSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME
- ? ProductCategorySelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME
- ? ProductAttributeTermsSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME
- ? ProductVariationSelectors
- : T extends typeof ORDERS_STORE_NAME
- ? OrdersSelectors
- : T extends typeof EXPERIMENTAL_SHIPPING_ZONES_STORE_NAME
- ? ShippingZonesSelectors
- : T extends typeof EXPERIMENTAL_TAX_CLASSES_STORE_NAME
- ? TaxClassSelectors
- : T extends typeof EXPERIMENTAL_PRODUCT_FORM_STORE_NAME
- ? ProductFormSelectors
- : T extends typeof ACTIVITY_PANEL_STORE_NAME
- ? ActivityPanelSelectors
- : never;
+ ? WPDataSelectors
+ : T extends typeof PLUGINS_STORE_NAME
+ ? PluginSelectors
+ : T extends typeof ONBOARDING_STORE_NAME
+ ? OnboardingSelectors
+ : T extends typeof PAYMENT_GATEWAYS_STORE_NAME
+ ? PaymentSelectors
+ : T extends typeof PAYMENT_SETTINGS_STORE_NAME
+ ? PaymentSettingsSelectors
+ : T extends typeof WOOPAYMENTS_ONBOARDING_STORE_NAME
+ ? WooPaymentsOnboardingSelectors
+ : T extends typeof SHIPPING_METHODS_STORE_NAME
+ ? ShippingMethodsSelectors
+ : T extends typeof USER_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof OPTIONS_STORE_NAME
+ ? OptionsSelectors
+ : T extends typeof NAVIGATION_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof NOTES_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof REPORTS_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof ITEMS_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof COUNTRIES_STORE_NAME
+ ? WPDataSelectors
+ : T extends typeof PRODUCTS_STORE_NAME
+ ? ProductsSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_ATTRIBUTES_STORE_NAME
+ ? ProductAttributeSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_SHIPPING_CLASSES_STORE_NAME
+ ? ProductShippingClassSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_TAGS_STORE_NAME
+ ? ProductTagSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_CATEGORIES_STORE_NAME
+ ? ProductCategorySelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_ATTRIBUTE_TERMS_STORE_NAME
+ ? ProductAttributeTermsSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME
+ ? ProductVariationSelectors
+ : T extends typeof ORDERS_STORE_NAME
+ ? OrdersSelectors
+ : T extends typeof EXPERIMENTAL_SHIPPING_ZONES_STORE_NAME
+ ? ShippingZonesSelectors
+ : T extends typeof EXPERIMENTAL_TAX_CLASSES_STORE_NAME
+ ? TaxClassSelectors
+ : T extends typeof EXPERIMENTAL_PRODUCT_FORM_STORE_NAME
+ ? ProductFormSelectors
+ : T extends typeof ACTIVITY_PANEL_STORE_NAME
+ ? ActivityPanelSelectors
+ : never;
export interface WCDataSelector {
< T extends WCDataStoreName >( storeName: T ): WCSelectorType< T >;
diff --git a/packages/js/data/src/items/types.ts b/packages/js/data/src/items/types.ts
index c0bcff1c057..92cd788fc19 100644
--- a/packages/js/data/src/items/types.ts
+++ b/packages/js/data/src/items/types.ts
@@ -209,12 +209,12 @@ export type ItemInfer< T > = Partial<
T extends 'categories'
? CategoryItem
: T extends 'products'
- ? ProductItem
- : T extends 'customers'
- ? CustomerItem
- : T extends 'leaderboards'
- ? LeaderboardItem
- : never
+ ? ProductItem
+ : T extends 'customers'
+ ? CustomerItem
+ : T extends 'leaderboards'
+ ? LeaderboardItem
+ : never
> & {
id: ItemID;
};
diff --git a/packages/js/data/src/notes/types.ts b/packages/js/data/src/notes/types.ts
index 8494970fcbd..f697c895e9b 100644
--- a/packages/js/data/src/notes/types.ts
+++ b/packages/js/data/src/notes/types.ts
@@ -11,20 +11,10 @@ export type NoteAction = {
};
export type NoteStatus =
- | 'pending'
- | 'unactioned'
- | 'actioned'
- | 'snoozed'
- | 'sent';
+ 'pending' | 'unactioned' | 'actioned' | 'snoozed' | 'sent';
export type NoteType =
- | 'error'
- | 'warning'
- | 'update'
- | 'info'
- | 'marketing'
- | 'survey'
- | 'email';
+ 'error' | 'warning' | 'update' | 'info' | 'marketing' | 'survey' | 'email';
// [Notes.php](https://github.com/woocommerce/woocommerce/blob/af97aaf41067bcd0b7ff12df9b6169f97c326c0f/plugins/woocommerce/src/Admin/API/Notes.php#L706-L822)
export type Note = {
diff --git a/packages/js/data/src/onboarding/deprecated-tasks.ts b/packages/js/data/src/onboarding/deprecated-tasks.ts
index e00783d41dd..c2b32263eef 100644
--- a/packages/js/data/src/onboarding/deprecated-tasks.ts
+++ b/packages/js/data/src/onboarding/deprecated-tasks.ts
@@ -78,7 +78,7 @@ export class DeprecatedTasks {
is_dismissable: task.isDismissable,
is_complete: task.completed,
} ) ),
- }
+ }
: null;
}
diff --git a/packages/js/data/src/onboarding/reducer.ts b/packages/js/data/src/onboarding/reducer.ts
index 560cb6618ea..bae64ab33e6 100644
--- a/packages/js/data/src/onboarding/reducer.ts
+++ b/packages/js/data/src/onboarding/reducer.ts
@@ -55,7 +55,7 @@ const getUpdatedTaskLists = (
? Object.keys( taskLists )
: Object.keys( taskLists ).filter(
( taskListId ) => taskListId === scopedTaskListId
- );
+ );
return taskListIds.reduce(
( lists, taskListId ) => {
diff --git a/packages/js/data/src/onboarding/types.ts b/packages/js/data/src/onboarding/types.ts
index d1ee85cd6ae..75831ab0de8 100644
--- a/packages/js/data/src/onboarding/types.ts
+++ b/packages/js/data/src/onboarding/types.ts
@@ -218,8 +218,7 @@ export type OnboardingProductType = {
};
export type OnboardingProductTypes =
- | Record< ProductTypeSlug, OnboardingProductType >
- | Record< string, never >;
+ Record< ProductTypeSlug, OnboardingProductType > | Record< string, never >;
export type ExtensionList = {
key: string;
diff --git a/packages/js/data/src/options/utils.ts b/packages/js/data/src/options/utils.ts
index 4f2c162c2bb..5c500a964c1 100644
--- a/packages/js/data/src/options/utils.ts
+++ b/packages/js/data/src/options/utils.ts
@@ -16,12 +16,18 @@ export const debounce = < T extends ( ...args: any[] ) => any >(
const debounced = ( ( ...args: Parameters< T > ) => {
latestArgs = args;
- if ( timeout ) clearTimeout( timeout );
+ if ( timeout ) {
+ clearTimeout( timeout );
+ }
timeout = setTimeout( () => {
timeout = null;
- if ( ! immediate && latestArgs ) func( ...latestArgs );
+ if ( ! immediate && latestArgs ) {
+ func( ...latestArgs );
+ }
}, wait );
- if ( immediate && ! timeout ) func( ...args );
+ if ( immediate && ! timeout ) {
+ func( ...args );
+ }
} ) as DebouncedFunction< T >;
debounced.flush = () => {
diff --git a/packages/js/data/src/plugins/reducer.ts b/packages/js/data/src/plugins/reducer.ts
index 278e0e30722..8be0c9a7157 100644
--- a/packages/js/data/src/plugins/reducer.ts
+++ b/packages/js/data/src/plugins/reducer.ts
@@ -32,7 +32,7 @@ const reducer: Reducer< PluginsState, Actions > = (
: ( concat(
state.active,
payload.active
- ) as string[] ),
+ ) as string[] ),
requesting: {
...state.requesting,
getActivePlugins: false,
@@ -53,7 +53,7 @@ const reducer: Reducer< PluginsState, Actions > = (
: ( concat(
state.installed,
payload.installed
- ) as string[] ),
+ ) as string[] ),
requesting: {
...state.requesting,
getInstalledPlugins: false,
diff --git a/packages/js/data/src/plugins/test/actions.ts b/packages/js/data/src/plugins/test/actions.ts
index 4612bda96c7..d3e9ee6443b 100644
--- a/packages/js/data/src/plugins/test/actions.ts
+++ b/packages/js/data/src/plugins/test/actions.ts
@@ -168,8 +168,7 @@ function runUntilThrow(
let step = gen.next();
while ( ! step.done ) {
const value = step.value as
- | { type?: string; next?: unknown }
- | undefined;
+ { type?: string; next?: unknown } | undefined;
if ( value?.type === 'API_FETCH' ) {
step = apiThrows
? gen.throw( apiResult )
diff --git a/packages/js/data/src/products/types.ts b/packages/js/data/src/products/types.ts
index 277a76e1068..f87879961bc 100644
--- a/packages/js/data/src/products/types.ts
+++ b/packages/js/data/src/products/types.ts
@@ -18,11 +18,7 @@ declare module '@wordpress/core-data' {
}
export type ProductType =
- | 'simple'
- | 'grouped'
- | 'external'
- | 'variable'
- | 'variation';
+ 'simple' | 'grouped' | 'external' | 'variable' | 'variation';
export type ProductStatus =
| 'auto-draft'
| 'deleted'
@@ -75,10 +71,7 @@ export type ProductDimensions = {
};
export type ProductCatalogVisibility =
- | 'visible'
- | 'catalog'
- | 'search'
- | 'hidden';
+ 'visible' | 'catalog' | 'search' | 'hidden';
export type Product< Status = ProductStatus, Type = ProductType > = Omit<
Post,
diff --git a/packages/js/data/src/reports/types.ts b/packages/js/data/src/reports/types.ts
index 7a387efa5d0..a25051967f4 100644
--- a/packages/js/data/src/reports/types.ts
+++ b/packages/js/data/src/reports/types.ts
@@ -338,24 +338,24 @@ export type ReportItemObjectInfer< T > = {
data: T extends 'customers'
? CustomerReport
: T extends 'products'
- ? ProductReport
- : T extends 'variations'
- ? VariationReport
- : T extends 'orders'
- ? OrderReport
- : T extends 'categories'
- ? CategoriesReport
- : T extends 'taxes'
- ? TaxesReport
- : T extends 'coupons'
- ? CouponReport
- : T extends 'stock'
- ? StockReport
- : T extends 'downloads'
- ? DownloadReport
- : T extends 'performance_indicators'
- ? PerformanceIndicatorReport
- : never;
+ ? ProductReport
+ : T extends 'variations'
+ ? VariationReport
+ : T extends 'orders'
+ ? OrderReport
+ : T extends 'categories'
+ ? CategoriesReport
+ : T extends 'taxes'
+ ? TaxesReport
+ : T extends 'coupons'
+ ? CouponReport
+ : T extends 'stock'
+ ? StockReport
+ : T extends 'downloads'
+ ? DownloadReport
+ : T extends 'performance_indicators'
+ ? PerformanceIndicatorReport
+ : never;
totalResults: number;
totalPages: number;
};
@@ -525,18 +525,18 @@ export type ReportStatObjectInfer< T > = {
data: T extends 'products'
? ProductReportStat
: T extends 'variations'
- ? VariationsReportStat
- : T extends 'revenue'
- ? RevenueReportStat
- : T extends 'orders'
- ? OrderReportStat
- : T extends 'taxes'
- ? TaxesReportStat
- : T extends 'coupons'
- ? CouponsReportStat
- : T extends 'customers'
- ? CustomersReportStat
- : never;
+ ? VariationsReportStat
+ : T extends 'revenue'
+ ? RevenueReportStat
+ : T extends 'orders'
+ ? OrderReportStat
+ : T extends 'taxes'
+ ? TaxesReportStat
+ : T extends 'coupons'
+ ? CouponsReportStat
+ : T extends 'customers'
+ ? CustomersReportStat
+ : never;
totalResults: number;
totalPages: number;
};
diff --git a/packages/js/data/src/reports/utils.ts b/packages/js/data/src/reports/utils.ts
index a0490aaae2f..1d3bcdba96d 100644
--- a/packages/js/data/src/reports/utils.ts
+++ b/packages/js/data/src/reports/utils.ts
@@ -349,7 +349,7 @@ export function getRequestQuery( options: QueryOptions ) {
segmentby: query.segmentby,
fields,
...filterQuery,
- };
+ };
}
/**
diff --git a/packages/js/data/src/reviews/types.ts b/packages/js/data/src/reviews/types.ts
index f03c63c919f..aa10715b566 100644
--- a/packages/js/data/src/reviews/types.ts
+++ b/packages/js/data/src/reviews/types.ts
@@ -59,8 +59,7 @@ export interface ReviewObject {
}
export interface ReviewObjectUpdate
- extends Partial< Omit< ReviewObject, 'id' > >,
- Pick< ReviewObject, 'id' > {}
+ extends Partial< Omit< ReviewObject, 'id' > >, Pick< ReviewObject, 'id' > {}
export interface ReviewsState {
reviews: {
diff --git a/packages/js/data/src/setting-options/actions.ts b/packages/js/data/src/setting-options/actions.ts
index 64a0f493288..ae9d0f4d4fb 100644
--- a/packages/js/data/src/setting-options/actions.ts
+++ b/packages/js/data/src/setting-options/actions.ts
@@ -23,7 +23,7 @@ import { NAMESPACE } from '../constants';
import { STORE_NAME } from './';
type WPDataRegistry = ReturnType< typeof createRegistry >;
-type Selectors = typeof import('./selectors');
+type Selectors = typeof import( './selectors' );
type CurriedState< F > = F extends (
state: SettingsState,
@@ -36,7 +36,7 @@ type CurriedSelectors< T > = {
[ K in keyof T ]: CurriedState< T[ K ] >;
};
-type Resolvers = typeof import('./resolvers');
+type Resolvers = typeof import( './resolvers' );
type CoreDataActions = ReturnType<
ReturnType< typeof coreDataStore.instantiate >[ 'getActions' ]
>;
@@ -156,7 +156,7 @@ export const editSettings =
: Object.entries( updates ).map( ( [ id, value ] ) => ( {
id,
value,
- } ) );
+ } ) );
if ( ! updatesArray.every( validateSettingEdit ) ) {
throw new Error( 'Invalid setting edit payload' );
@@ -354,7 +354,7 @@ export const saveSettingsGroup =
: Object.entries( updates ).map( ( [ id, value ] ) => ( {
id,
value,
- } ) );
+ } ) );
return saveSettingsGroupRequest( groupId, updatesArray, dispatch );
};
diff --git a/packages/js/data/src/types/promiseify-selectors.ts b/packages/js/data/src/types/promiseify-selectors.ts
index fc81e2d2734..dff1c7c8fa4 100644
--- a/packages/js/data/src/types/promiseify-selectors.ts
+++ b/packages/js/data/src/types/promiseify-selectors.ts
@@ -5,7 +5,9 @@
*/
export type PromiseifySelectors< Selectors > = {
- [ SelectorFunction in keyof Selectors ]: Selectors[ SelectorFunction ] extends (
+ [
+ SelectorFunction in keyof Selectors
+ ]: Selectors[ SelectorFunction ] extends (
...args: infer SelectorArgs
) => infer SelectorReturnType
? ( ...args: SelectorArgs ) => Promise< SelectorReturnType >
diff --git a/packages/js/data/src/types/rule-processor.ts b/packages/js/data/src/types/rule-processor.ts
index c4ba88df52d..9f093808f3f 100644
--- a/packages/js/data/src/types/rule-processor.ts
+++ b/packages/js/data/src/types/rule-processor.ts
@@ -35,11 +35,4 @@ export type RuleType =
| 'wca_updated';
export type RuleOperation =
- | '='
- | '<'
- | '<='
- | '>'
- | '>='
- | '!='
- | 'contains'
- | '!contains';
+ '=' | '<' | '<=' | '>' | '>=' | '!=' | 'contains' | '!contains';
diff --git a/packages/js/data/src/types/wp-data.ts b/packages/js/data/src/types/wp-data.ts
index b78d47607a0..0cd261e78b0 100644
--- a/packages/js/data/src/types/wp-data.ts
+++ b/packages/js/data/src/types/wp-data.ts
@@ -77,7 +77,7 @@ type CastToFunction< T > = Cast< T, ( ...args: any[] ) => any >;
* This is useful for typing some @wordpress/data functions that make a leading
* `state` argument implicit.
*/
-// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/no-empty-object-type
+// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
type TailParameters< F extends Function > = F extends (
head: any,
...tail: infer T
diff --git a/packages/js/date/src/test/index.ts b/packages/js/date/src/test/index.ts
index 31afd4c4dd2..5c1cabdcca0 100644
--- a/packages/js/date/src/test/index.ts
+++ b/packages/js/date/src/test/index.ts
@@ -88,7 +88,9 @@ describe( 'toMoment', () => {
it( 'should handle isoFormat dates', () => {
const myMoment = toMoment( 'YYYY', '2018-04-15' );
- if ( myMoment === null ) fail( 'myMoment should not be null' );
+ if ( myMoment === null ) {
+ fail( 'myMoment should not be null' );
+ }
expect( moment.isMoment( myMoment ) ).toBe( true );
expect( myMoment.isValid() ).toBe( true );
@@ -96,7 +98,9 @@ describe( 'toMoment', () => {
it( 'should handle local formats', () => {
const longDate = toMoment( 'MMMM D, YYYY', 'April 15, 2018' );
- if ( longDate === null ) fail( 'longDate should not be null' );
+ if ( longDate === null ) {
+ fail( 'longDate should not be null' );
+ }
expect( moment.isMoment( longDate ) ).toBe( true );
expect( longDate.isValid() ).toBe( true );
@@ -105,7 +109,9 @@ describe( 'toMoment', () => {
expect( longDate.year() ).toBe( 2018 );
const shortDate = toMoment( 'DD/MM/YYYY', '15/04/2018' );
- if ( shortDate === null ) fail( 'shortDate should not be null' );
+ if ( shortDate === null ) {
+ fail( 'shortDate should not be null' );
+ }
expect( moment.isMoment( shortDate ) ).toBe( true );
expect( shortDate.isValid() ).toBe( true );
diff --git a/packages/js/e2e-utils-playwright/src/api-client.ts b/packages/js/e2e-utils-playwright/src/api-client.ts
index 00e2a1b6752..ed00409afc4 100644
--- a/packages/js/e2e-utils-playwright/src/api-client.ts
+++ b/packages/js/e2e-utils-playwright/src/api-client.ts
@@ -114,8 +114,12 @@ export function createClient( baseURL: string, auth: Auth ): ApiClient {
]
): Record< string, unknown > | null | undefined {
const shouldRedact = process.env.CI === 'true';
- if ( ! shouldRedact ) return obj;
- if ( ! obj || typeof obj !== 'object' ) return obj;
+ if ( ! shouldRedact ) {
+ return obj;
+ }
+ if ( ! obj || typeof obj !== 'object' ) {
+ return obj;
+ }
return Object.fromEntries(
Object.entries( obj ).map( ( [ k, v ] ) =>
keys.includes( k.toLowerCase() )
@@ -125,7 +129,7 @@ export function createClient( baseURL: string, auth: Auth ): ApiClient {
typeof v === 'object'
? redact( v as Record< string, unknown >, keys )
: v,
- ]
+ ]
)
);
}
diff --git a/packages/js/e2e-utils-playwright/src/editor.ts b/packages/js/e2e-utils-playwright/src/editor.ts
index 13099b0760f..e7cbfbe4d95 100644
--- a/packages/js/e2e-utils-playwright/src/editor.ts
+++ b/packages/js/e2e-utils-playwright/src/editor.ts
@@ -55,19 +55,17 @@ export const disableWelcomeModal = async ( {
// Further info: https://github.com/woocommerce/woocommerce/pull/45856/
await page.waitForLoadState( 'domcontentloaded' );
- const isWelcomeGuideActive = await page.evaluate(
- () =>
- ( window as unknown as WindowWithWp ).wp?.data
- ?.select( 'core/edit-post' )
- ?.isFeatureActive( 'welcomeGuide' )
+ const isWelcomeGuideActive = await page.evaluate( () =>
+ ( window as unknown as WindowWithWp ).wp?.data
+ ?.select( 'core/edit-post' )
+ ?.isFeatureActive( 'welcomeGuide' )
);
if ( isWelcomeGuideActive ) {
- await page.evaluate(
- () =>
- ( window as unknown as WindowWithWp ).wp?.data
- ?.dispatch( 'core/edit-post' )
- ?.toggleFeature( 'welcomeGuide' )
+ await page.evaluate( () =>
+ ( window as unknown as WindowWithWp ).wp?.data
+ ?.dispatch( 'core/edit-post' )
+ ?.toggleFeature( 'welcomeGuide' )
);
}
};
diff --git a/packages/js/email-editor/package.json b/packages/js/email-editor/package.json
index 9184c5c8810..9f264ed88e2 100644
--- a/packages/js/email-editor/package.json
+++ b/packages/js/email-editor/package.json
@@ -147,7 +147,7 @@
"jest": "29.5.x",
"jest-cli": "29.5.x",
"jest-environment-jsdom": "29.5.x",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"react": "18.3.x",
"react-dom": "18.3.x",
"rimraf": "5.0.5",
diff --git a/packages/js/email-editor/src/blocks/core/buttons.ts b/packages/js/email-editor/src/blocks/core/buttons.ts
index e5b3e9cbdab..fabe9ca9050 100644
--- a/packages/js/email-editor/src/blocks/core/buttons.ts
+++ b/packages/js/email-editor/src/blocks/core/buttons.ts
@@ -14,7 +14,7 @@ function enhanceButtonsBlock() {
...( current.supports ?? {} ),
layout: false, // disable block editor's layouts
// enable email editor's reduced flex email layout
- __experimentalEmailFlexLayout: true, // eslint-disable-line
+ __experimentalEmailFlexLayout: true,
},
} ) );
}
diff --git a/packages/js/email-editor/src/blocks/core/full-width.tsx b/packages/js/email-editor/src/blocks/core/full-width.tsx
index 14a7f68731d..bc2b95fad6e 100644
--- a/packages/js/email-editor/src/blocks/core/full-width.tsx
+++ b/packages/js/email-editor/src/blocks/core/full-width.tsx
@@ -13,8 +13,7 @@ import { addFilterForEmail } from '../../config-tools/filters';
import { unwrapCompressedPresetStyleVariable } from '../../style-variables';
type SpacingPadding =
- | string
- | { top?: string; right?: string; bottom?: string; left?: string };
+ string | { top?: string; right?: string; bottom?: string; left?: string };
// Columns handle their own width, so don't let full-width blocks inside a
// column break out (the renderer doesn't either).
diff --git a/packages/js/email-editor/src/blocks/core/social-links.tsx b/packages/js/email-editor/src/blocks/core/social-links.tsx
index e93ec153965..10415aebc54 100644
--- a/packages/js/email-editor/src/blocks/core/social-links.tsx
+++ b/packages/js/email-editor/src/blocks/core/social-links.tsx
@@ -116,7 +116,7 @@ const disableIconColor =
}
// we are doing this because we don't want to show the icon color picker in the social links block (we can't change png image color)
// and there isn't a great way to remove the icon color from the core block attributes
- // eslint-disable-next-line @wordpress/i18n-text-domain -- using core label.
+
const labelText = __( 'Icon color' );
const customCss = `
.block-editor-tools-panel-color-gradient-settings__item:has([title="${ labelText }"]) {
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 0d4b87ca127..ae4a92e48e0 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
@@ -52,7 +52,7 @@ function getModalTitle(
__i18n_text_domain__
),
items.length
- )
+ )
: sprintf(
// translators: %s: The post's title
__(
@@ -60,7 +60,7 @@ function getModalTitle(
__i18n_text_domain__
),
decodeEntities( getItemTitle( items[ 0 ] ) )
- );
+ );
}
return items.length > 1
@@ -73,7 +73,7 @@ function getModalTitle(
__i18n_text_domain__
),
items.length
- )
+ )
: sprintf(
// translators: %s: The item's title.
__(
@@ -81,7 +81,7 @@ function getModalTitle(
__i18n_text_domain__
),
getItemTitle( items[ 0 ] )
- );
+ );
}
const getTrashEmailPostAction = () => {
@@ -188,7 +188,7 @@ const getTrashEmailPostAction = () => {
__i18n_text_domain__
),
getItemTitle( items[ 0 ] )
- )
+ )
: sprintf(
/* translators: The item's title. */
__(
@@ -196,13 +196,13 @@ const getTrashEmailPostAction = () => {
__i18n_text_domain__
),
getItemTitle( items[ 0 ] )
- );
+ );
} else {
successMessage = shouldPermanentlyDelete
? __(
'The items were permanently deleted.',
__i18n_text_domain__
- )
+ )
: sprintf(
/* translators: The number of items. */
_n(
@@ -212,7 +212,7 @@ const getTrashEmailPostAction = () => {
__i18n_text_domain__
),
items.length
- );
+ );
}
void createSuccessNotice( successMessage, {
type: 'snackbar',
@@ -305,7 +305,7 @@ const getTrashEmailPostAction = () => {
? __(
'Delete permanently',
__i18n_text_domain__
- )
+ )
: __( 'Move to trash', __i18n_text_domain__ ) }
</Button>
</HStack>
diff --git a/packages/js/email-editor/src/components/notices/validation-notices.tsx b/packages/js/email-editor/src/components/notices/validation-notices.tsx
index 96dcb3f532f..cabb861007b 100644
--- a/packages/js/email-editor/src/components/notices/validation-notices.tsx
+++ b/packages/js/email-editor/src/components/notices/validation-notices.tsx
@@ -39,7 +39,7 @@ export function ValidationNotices() {
>
{ label }
</Button>
- ) )
+ ) )
: null }
</li>
) ) }
diff --git a/packages/js/email-editor/src/components/preview/send-preview-email.tsx b/packages/js/email-editor/src/components/preview/send-preview-email.tsx
index 3a965460bf5..cfee021ceb0 100644
--- a/packages/js/email-editor/src/components/preview/send-preview-email.tsx
+++ b/packages/js/email-editor/src/components/preview/send-preview-email.tsx
@@ -111,7 +111,7 @@ function RawSendPreviewEmail() {
),
{
link: (
- // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/control-has-associated-label
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href={
sendingMethodConfigurationLink
@@ -136,7 +136,7 @@ function RawSendPreviewEmail() {
),
{
link: (
- // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/control-has-associated-label
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href={ `https://account.mailpoet.com/?s=1&g=1&utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${ postType }` }
key="sign-up-for-free"
diff --git a/packages/js/email-editor/src/components/preview/test/send-preview-email.spec.tsx b/packages/js/email-editor/src/components/preview/test/send-preview-email.spec.tsx
index 0c290e98502..80c604f0c99 100644
--- a/packages/js/email-editor/src/components/preview/test/send-preview-email.spec.tsx
+++ b/packages/js/email-editor/src/components/preview/test/send-preview-email.spec.tsx
@@ -59,7 +59,7 @@ jest.mock( '@wordpress/components', () => {
React.InputHTMLAttributes< HTMLInputElement > & {
__next40pxDefaultSize?: boolean;
__nextHasNoMarginBottom?: boolean;
- onChange?: ( value: string ) => void; // eslint-disable-line @typescript-eslint/no-unused-vars
+ onChange?: ( value: string ) => void;
}
>( ( props, ref ) => {
const {
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 e0caa5b9221..324e283e935 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
@@ -58,9 +58,9 @@ const getResetEmailTemplateAction = () => {
if ( item.source !== 'custom' ) {
return false;
}
- if (
- ! ( Boolean( item.plugin ) || Boolean( item.has_theme_file ) )
- ) {
+ if ( ! (
+ Boolean( item.plugin ) || Boolean( item.has_theme_file )
+ ) ) {
return false;
}
const { permissions } = item;
diff --git a/packages/js/email-editor/src/components/styles-sidebar/navigator.ts b/packages/js/email-editor/src/components/styles-sidebar/navigator.ts
index 3957d49583c..e386f45fca8 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/navigator.ts
+++ b/packages/js/email-editor/src/components/styles-sidebar/navigator.ts
@@ -9,7 +9,7 @@ import {
Navigator as WPNavigator,
__experimentalNavigatorProvider as NavigatorProvider,
__experimentalNavigatorScreen as NavigatorScreen,
- __experimentalNavigatorBackButton as NavigatorBackButton, // eslint-disable-line
+ __experimentalNavigatorBackButton as NavigatorBackButton,
} from '@wordpress/components';
type NavigatorWithCompound = typeof WPNavigator & {
diff --git a/packages/js/email-editor/src/components/styles-sidebar/panels/color-dropdown-item.tsx b/packages/js/email-editor/src/components/styles-sidebar/panels/color-dropdown-item.tsx
index e4e62b6e577..323585bbfaa 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/panels/color-dropdown-item.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/panels/color-dropdown-item.tsx
@@ -10,14 +10,14 @@ import {
ColorIndicator,
Dropdown,
FlexItem,
- __experimentalDropdownContentWrapper as DropdownContentWrapper, // eslint-disable-line
- __experimentalHStack as HStack, // eslint-disable-line
- __experimentalToolsPanelItem as ToolsPanelItem, // eslint-disable-line
+ __experimentalDropdownContentWrapper as DropdownContentWrapper,
+ __experimentalHStack as HStack,
+ __experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
-// eslint-disable-next-line
+
import {
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalColorGradientControl as ColorGradientControl, // eslint-disable-line
+ __experimentalColorGradientControl as ColorGradientControl,
} from '@wordpress/block-editor';
const popoverProps = {
diff --git a/packages/js/email-editor/src/components/styles-sidebar/panels/dimensions-panel.tsx b/packages/js/email-editor/src/components/styles-sidebar/panels/dimensions-panel.tsx
index a6e6b281578..264a8698a6f 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/panels/dimensions-panel.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/panels/dimensions-panel.tsx
@@ -6,14 +6,14 @@ import { isEqual } from 'lodash';
import {
// We can remove the ts-expect-error comments once the types are available.
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalSpacingSizesControl as SpacingSizesControl, // eslint-disable-line
+ __experimentalSpacingSizesControl as SpacingSizesControl,
useSettings,
} from '@wordpress/block-editor';
-// eslint-disable-next-line
+
import {
- __experimentalToolsPanel as ToolsPanel, // eslint-disable-line
- __experimentalToolsPanelItem as ToolsPanelItem, // eslint-disable-line
- __experimentalUseCustomUnits as useCustomUnits, // eslint-disable-line
+ __experimentalToolsPanel as ToolsPanel,
+ __experimentalToolsPanelItem as ToolsPanelItem,
+ __experimentalUseCustomUnits as useCustomUnits,
} from '@wordpress/components';
/**
diff --git a/packages/js/email-editor/src/components/styles-sidebar/panels/typography-element-panel.tsx b/packages/js/email-editor/src/components/styles-sidebar/panels/typography-element-panel.tsx
index 70ead9d22d3..e3d92d55734 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/panels/typography-element-panel.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/panels/typography-element-panel.tsx
@@ -10,28 +10,28 @@ import {
} from '@wordpress/global-styles-engine';
import {
FontSizePicker,
- __experimentalToolsPanel as ToolsPanel, // eslint-disable-line
- __experimentalToolsPanelItem as ToolsPanelItem, // eslint-disable-line
+ __experimentalToolsPanel as ToolsPanel,
+ __experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
-// eslint-disable-next-line
+
import {
useSettings,
// We can remove the ts-expect-error comments once the types are available.
// @see packages/block-editor/src/components/index.js
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalFontAppearanceControl as FontAppearanceControl, // eslint-disable-line
+ __experimentalFontAppearanceControl as FontAppearanceControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalLetterSpacingControl as LetterSpacingControl, // eslint-disable-line
+ __experimentalLetterSpacingControl as LetterSpacingControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalFontFamilyControl as FontFamilyControl, // eslint-disable-line
+ __experimentalFontFamilyControl as FontFamilyControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
LineHeightControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalTextDecorationControl as TextDecorationControl, // eslint-disable-line
+ __experimentalTextDecorationControl as TextDecorationControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalTextTransformControl as TextTransformControl, // eslint-disable-line
+ __experimentalTextTransformControl as TextTransformControl,
// @ts-expect-error TS7016: Could not find a declaration file for module '@wordpress/block-editor'.
- __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, // eslint-disable-line
+ __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
} from '@wordpress/block-editor';
/**
@@ -124,7 +124,7 @@ export function TypographyElementPanel( {
{ settings: theme?.settings },
'',
userTextColor
- )
+ )
: undefined;
const hasTextColor = () => !! userTextColor;
@@ -166,7 +166,7 @@ export function TypographyElementPanel( {
undefined,
'color.text',
newValue
- );
+ );
updateElementStyleProp( [ 'color', 'text' ], encodedValue );
debouncedRecordEvent(
'styles_sidebar_screen_typography_element_panel_set_text_color',
diff --git a/packages/js/email-editor/src/components/styles-sidebar/panels/typography-panel.tsx b/packages/js/email-editor/src/components/styles-sidebar/panels/typography-panel.tsx
index 00c947d60ad..f4c76ae42fc 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/panels/typography-panel.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/panels/typography-panel.tsx
@@ -3,12 +3,12 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import {
- __experimentalItemGroup as ItemGroup, // eslint-disable-line
- __experimentalItem as Item, // eslint-disable-line
- __experimentalVStack as VStack, // eslint-disable-line
- __experimentalHStack as HStack, // eslint-disable-line
- __experimentalHeading as Heading, // eslint-disable-line
- __experimentalNavigatorButton as NavigatorButton, // eslint-disable-line
+ __experimentalItemGroup as ItemGroup,
+ __experimentalItem as Item,
+ __experimentalVStack as VStack,
+ __experimentalHStack as HStack,
+ __experimentalHeading as Heading,
+ __experimentalNavigatorButton as NavigatorButton,
FlexItem,
Card,
CardBody,
diff --git a/packages/js/email-editor/src/components/styles-sidebar/previews/typography-preview.tsx b/packages/js/email-editor/src/components/styles-sidebar/previews/typography-preview.tsx
index cd1728cb050..1569cbd8acd 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/previews/typography-preview.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/previews/typography-preview.tsx
@@ -37,7 +37,7 @@ export default function TypographyPreview( {
element === 'link'
? {
textDecoration: textDecoration ?? 'underline',
- }
+ }
: {};
return (
diff --git a/packages/js/email-editor/src/components/styles-sidebar/screens/preview.tsx b/packages/js/email-editor/src/components/styles-sidebar/screens/preview.tsx
index 7f6f18fb260..c7d760563f2 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/screens/preview.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/screens/preview.tsx
@@ -4,9 +4,9 @@
import { useSelect } from '@wordpress/data';
import { useState, useMemo } from '@wordpress/element';
import {
- __experimentalHStack as HStack, // eslint-disable-line
- __experimentalVStack as VStack, // eslint-disable-line
- __unstableMotion as motion, // eslint-disable-line
+ __experimentalHStack as HStack,
+ __experimentalVStack as VStack,
+ __unstableMotion as motion,
} from '@wordpress/components';
/**
diff --git a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-header.tsx b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-header.tsx
index d0ee118be9d..6fcbf429c47 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-header.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-header.tsx
@@ -4,11 +4,11 @@
import { __ } from '@wordpress/i18n';
import { chevronLeft } from '@wordpress/icons';
import {
- __experimentalHStack as HStack, // eslint-disable-line
- __experimentalVStack as VStack, // eslint-disable-line
- __experimentalSpacer as Spacer, // eslint-disable-line
- __experimentalHeading as Heading, // eslint-disable-line
- __experimentalView as View, // eslint-disable-line
+ __experimentalHStack as HStack,
+ __experimentalVStack as VStack,
+ __experimentalSpacer as Spacer,
+ __experimentalHeading as Heading,
+ __experimentalView as View,
} from '@wordpress/components';
/**
diff --git a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-root.tsx b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-root.tsx
index d317a1c0b7b..e6b68b2be7f 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-root.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-root.tsx
@@ -4,14 +4,14 @@
import { __ } from '@wordpress/i18n';
import { typography, color, background, layout } from '@wordpress/icons';
import {
- __experimentalVStack as VStack, // eslint-disable-line
+ __experimentalVStack as VStack,
Card,
CardBody,
CardMedia,
- __experimentalItemGroup as ItemGroup, // eslint-disable-line
- __experimentalItem as Item, // eslint-disable-line
- __experimentalHStack as HStack, // eslint-disable-line
- __experimentalNavigatorButton as NavigatorButton, // eslint-disable-line
+ __experimentalItemGroup as ItemGroup,
+ __experimentalItem as Item,
+ __experimentalHStack as HStack,
+ __experimentalNavigatorButton as NavigatorButton,
Icon,
FlexItem,
} from '@wordpress/components';
diff --git a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-typography-element.tsx b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-typography-element.tsx
index 57804391e75..7ea8e4e25bb 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-typography-element.tsx
+++ b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-typography-element.tsx
@@ -4,9 +4,9 @@
import { __, _x } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import {
- __experimentalToggleGroupControl as ToggleGroupControl, // eslint-disable-line
- __experimentalToggleGroupControlOption as ToggleGroupControlOption, // eslint-disable-line
- __experimentalSpacer as Spacer, // eslint-disable-line
+ __experimentalToggleGroupControl as ToggleGroupControl,
+ __experimentalToggleGroupControlOption as ToggleGroupControlOption,
+ __experimentalSpacer as Spacer,
} from '@wordpress/components';
/**
diff --git a/packages/js/email-editor/src/components/styles-sidebar/utils.ts b/packages/js/email-editor/src/components/styles-sidebar/utils.ts
index bd11f49520b..e67b4334435 100644
--- a/packages/js/email-editor/src/components/styles-sidebar/utils.ts
+++ b/packages/js/email-editor/src/components/styles-sidebar/utils.ts
@@ -34,12 +34,12 @@ export const getHeadingElementStyles = (
defaultStyleObject,
styles.elements?.heading || {},
styles.elements?.[ headingLevel ] || {},
- ] ) as EmailStyles )
+ ] ) as EmailStyles )
: ( {
...defaultStyleObject,
...( styles.elements?.heading || {} ),
...( styles.elements?.[ headingLevel ] || {} ),
- } as EmailStyles );
+ } as EmailStyles );
export const getElementStyles = (
styles: EmailStyles,
diff --git a/packages/js/email-editor/src/components/template-canvas-affordance/template-canvas-affordance.tsx b/packages/js/email-editor/src/components/template-canvas-affordance/template-canvas-affordance.tsx
index f560ebfe052..9a25f877085 100644
--- a/packages/js/email-editor/src/components/template-canvas-affordance/template-canvas-affordance.tsx
+++ b/packages/js/email-editor/src/components/template-canvas-affordance/template-canvas-affordance.tsx
@@ -215,8 +215,7 @@ export function TemplateCanvasAffordance() {
onNavigateToEntityRecord:
// @ts-expect-error onNavigateToEntityRecord is provided through email editor settings.
editorSettings?.onNavigateToEntityRecord as
- | NavigateToEntityRecord
- | undefined,
+ NavigateToEntityRecord | undefined,
template: select( storeName ).getCurrentTemplate(),
};
}, [] );
diff --git a/packages/js/email-editor/src/components/template-select/async.ts b/packages/js/email-editor/src/components/template-select/async.ts
index 2a0dd23d10c..d28137d3bf1 100644
--- a/packages/js/email-editor/src/components/template-select/async.ts
+++ b/packages/js/email-editor/src/components/template-select/async.ts
@@ -37,10 +37,8 @@ export function Async( { children, placeholder } ) {
}, [] );
if ( ! shouldRender ) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return placeholder;
}
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return children;
}
diff --git a/packages/js/email-editor/src/components/template-select/select-modal.tsx b/packages/js/email-editor/src/components/template-select/select-modal.tsx
index 515717c1f7f..cd4364a3a94 100644
--- a/packages/js/email-editor/src/components/template-select/select-modal.tsx
+++ b/packages/js/email-editor/src/components/template-select/select-modal.tsx
@@ -74,8 +74,12 @@ function SelectTemplateBody( {
// Put 'recent' category first
return allCategories.sort( ( a, b ) => {
- if ( a.name === 'recent' ) return -1;
- if ( b.name === 'recent' ) return 1;
+ if ( a.name === 'recent' ) {
+ return -1;
+ }
+ if ( b.name === 'recent' ) {
+ return 1;
+ }
return 0;
} );
}, [ templates, patternCategories, hideRecentCategory ] );
diff --git a/packages/js/email-editor/src/components/template-select/template-list.tsx b/packages/js/email-editor/src/components/template-select/template-list.tsx
index cf40f04d125..c3670a065cf 100644
--- a/packages/js/email-editor/src/components/template-select/template-list.tsx
+++ b/packages/js/email-editor/src/components/template-select/template-list.tsx
@@ -8,7 +8,7 @@ import { blockDefault } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { EmptyState, Notice, Stack } from '@wordpress/ui';
// @ts-expect-error No types available for this component
-// eslint-disable-next-line
+
import { BlockPreview } from '@wordpress/block-editor';
/**
@@ -51,7 +51,7 @@ function TemplateListBox( {
const editorSettings = getEditorSettings();
return {
// @ts-expect-error There are no types for the experimental features settings.
- // eslint-disable-next-line no-underscore-dangle
+
layout: editorSettings?.__experimentalFeatures?.layout,
};
} );
@@ -143,7 +143,7 @@ export function TemplateList( {
selectedCategory !== null && selectedCategory !== undefined
? templates.filter(
( template ) => template.category === selectedCategory
- )
+ )
: templates,
[ selectedCategory, templates ]
);
diff --git a/packages/js/email-editor/src/config-tools/block-config.ts b/packages/js/email-editor/src/config-tools/block-config.ts
index 661e24cae1e..492ac342486 100644
--- a/packages/js/email-editor/src/config-tools/block-config.ts
+++ b/packages/js/email-editor/src/config-tools/block-config.ts
@@ -26,7 +26,9 @@ export function updateBlockSettings<
| BlockConfiguration< TAttributes >
): boolean {
const type = getBlockType< TAttributes >( name );
- if ( ! type ) return false;
+ if ( ! type ) {
+ return false;
+ }
const { name: blockName, ...currentSettings } = type as unknown as {
name: string;
diff --git a/packages/js/email-editor/src/events/dom-tracking.ts b/packages/js/email-editor/src/events/dom-tracking.ts
index a1884e7c3f8..c3795ec9d72 100644
--- a/packages/js/email-editor/src/events/dom-tracking.ts
+++ b/packages/js/email-editor/src/events/dom-tracking.ts
@@ -76,7 +76,7 @@ export function initDomTracking() {
isOpened,
} );
},
- // eslint-disable-next-line @wordpress/i18n-text-domain
+
selector: `.components-dropdown-menu__toggle[aria-label="${ __(
'Options'
) }"]`,
@@ -85,10 +85,8 @@ export function initDomTracking() {
{
track: ( target ) => {
if (
- // eslint-disable-next-line @wordpress/i18n-text-domain
( target.textContent === __( 'Save' ) &&
target.getAttribute( 'aria-disabled' ) === 'false' ) ||
- // eslint-disable-next-line @wordpress/i18n-text-domain
target.textContent === __( 'Saving…' )
) {
recordEvent( 'header_save_button_clicked' );
diff --git a/packages/js/email-editor/src/events/store-tracking.ts b/packages/js/email-editor/src/events/store-tracking.ts
index 8f39b919e7d..911138462f2 100644
--- a/packages/js/email-editor/src/events/store-tracking.ts
+++ b/packages/js/email-editor/src/events/store-tracking.ts
@@ -75,7 +75,6 @@ const trackSetRenderingMode = ( renderingMode: string ) => {
return;
}
const isPreviewDropdownOpened = !! document.querySelector(
- // eslint-disable-next-line @wordpress/i18n-text-domain
`[aria-label="${ __( 'View options' ) }"]`
);
// We want to track the event only from the dropdown.
diff --git a/packages/js/email-editor/src/hooks/test/use-notice-overrides.spec.ts b/packages/js/email-editor/src/hooks/test/use-notice-overrides.spec.ts
index 8c25568bf6c..ed11cf09ff3 100644
--- a/packages/js/email-editor/src/hooks/test/use-notice-overrides.spec.ts
+++ b/packages/js/email-editor/src/hooks/test/use-notice-overrides.spec.ts
@@ -18,7 +18,7 @@ let capturedPlugin: ( registry: {
jest.mock( '@wordpress/data', () => {
const actual =
- jest.requireActual< typeof import('@wordpress/data') >(
+ jest.requireActual< typeof import( '@wordpress/data' ) >(
'@wordpress/data'
);
diff --git a/packages/js/email-editor/src/hooks/test/use-user-theme.spec.ts b/packages/js/email-editor/src/hooks/test/use-user-theme.spec.ts
index 8083d8ecc02..a51b059e685 100644
--- a/packages/js/email-editor/src/hooks/test/use-user-theme.spec.ts
+++ b/packages/js/email-editor/src/hooks/test/use-user-theme.spec.ts
@@ -12,7 +12,7 @@ import { storeName } from '../../store/constants';
jest.mock( '@wordpress/data', () => {
const actual =
- jest.requireActual< typeof import('@wordpress/data') >(
+ jest.requireActual< typeof import( '@wordpress/data' ) >(
'@wordpress/data'
);
@@ -30,7 +30,7 @@ jest.mock( '@wordpress/core-data', () => ( { store: { name: 'core' } } ) );
// which Jest cannot transform. Re-export the real constant so the store name
// stays linked to `src/store/constants.ts`.
jest.mock( '../../store', () => ( {
- storeName: jest.requireActual< typeof import('../../store/constants') >(
+ storeName: jest.requireActual< typeof import( '../../store/constants' ) >(
'../../store/constants'
).storeName,
} ) );
diff --git a/packages/js/email-editor/src/hooks/use-email-css.ts b/packages/js/email-editor/src/hooks/use-email-css.ts
index e28c1e3159a..6de8105878a 100644
--- a/packages/js/email-editor/src/hooks/use-email-css.ts
+++ b/packages/js/email-editor/src/hooks/use-email-css.ts
@@ -33,7 +33,7 @@ export function useEmailCss() {
return {
editorTheme: select( storeName ).getTheme(),
// @ts-expect-error There are no types for the experimental features settings.
- // eslint-disable-next-line no-underscore-dangle
+
layout: editorSettings?.__experimentalFeatures?.layout,
deviceType: getDeviceType(),
initialEditorSettingsStyles: initialSettings?.styles,
@@ -82,6 +82,5 @@ export function useEmailCss() {
];
}, [ styles, initialEditorSettingsStyles, rootContainerStyles ] );
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return [ finalStyles || EMPTY_ARRAY ];
}
diff --git a/packages/js/email-editor/src/hooks/use-notice-overrides.ts b/packages/js/email-editor/src/hooks/use-notice-overrides.ts
index 9eb44d676cc..60266644f00 100644
--- a/packages/js/email-editor/src/hooks/use-notice-overrides.ts
+++ b/packages/js/email-editor/src/hooks/use-notice-overrides.ts
@@ -147,7 +147,7 @@ function transformNotice(
candidates,
override.labelKeys,
notice.content
- )
+ )
: undefined;
const rewriteText = ! override.labelKeys || !! matchedCandidate;
@@ -275,7 +275,7 @@ export function useNoticeOverrides(): void {
};
}
| undefined
- )?.getPostType( postType )?.labels
+ )?.getPostType( postType )?.labels
: undefined;
// The post type currently being edited: navigating
@@ -287,8 +287,7 @@ export function useNoticeOverrides(): void {
originalSelect( CORE_EDITOR_STORE ) as
| {
getCurrentPostType?: () =>
- | string
- | undefined;
+ string | undefined;
}
| undefined
)?.getCurrentPostType?.();
@@ -305,8 +304,7 @@ export function useNoticeOverrides(): void {
originalSelect( emailEditorStoreName ) as
| {
getEmailPostType?: () =>
- | string
- | undefined;
+ string | undefined;
}
| undefined
)?.getEmailPostType?.();
diff --git a/packages/js/email-editor/src/hooks/use-preview-templates.ts b/packages/js/email-editor/src/hooks/use-preview-templates.ts
index de75d54d8a9..585f047ce3e 100644
--- a/packages/js/email-editor/src/hooks/use-preview-templates.ts
+++ b/packages/js/email-editor/src/hooks/use-preview-templates.ts
@@ -152,7 +152,7 @@ export function usePreviewTemplates(
templateToPreview.push( {
id: template.id,
slug: template.slug,
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
+
previewContentParsed: parsedTemplate,
emailParsed:
contentPattern.emailBlocks ?? contentPattern.blocks,
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 0db73556b84..d75ab5575bf 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
@@ -14,7 +14,7 @@ export const useRemoveSavingFailedNotices = () => {
// Create a regular expression that escapes special characters and matches the beginning of the string
const savingFailedRegex = useMemo( () => {
// Get the translated "Saving failed" message once
- // eslint-disable-next-line @wordpress/i18n-text-domain -- We want to match WordPress translation here.
+
const savingFailedMessage = __( 'Saving failed.' );
return new RegExp(
'^' + savingFailedMessage.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' )
diff --git a/packages/js/email-editor/src/layouts/flex-email.tsx b/packages/js/email-editor/src/layouts/flex-email.tsx
index 761381970a9..2613f291993 100644
--- a/packages/js/email-editor/src/layouts/flex-email.tsx
+++ b/packages/js/email-editor/src/layouts/flex-email.tsx
@@ -99,7 +99,6 @@ function JustificationControls( {
function LayoutControls( { setAttributes, attributes, name: blockName } ) {
const layoutBlockSupport = getBlockSupport(
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
blockName,
// @ts-expect-error No types for this exist yet.
layoutBlockSupportKey,
@@ -195,7 +194,6 @@ export function addAttribute() {
*/
export const withLayoutControls = createHigherOrderComponent(
( BlockEdit ) => ( props ) => {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const supportLayout = hasLayoutBlockSupport( props.name );
return [
diff --git a/packages/js/email-editor/src/store/selectors.ts b/packages/js/email-editor/src/store/selectors.ts
index c5d50d0af7d..18a06932dcf 100644
--- a/packages/js/email-editor/src/store/selectors.ts
+++ b/packages/js/email-editor/src/store/selectors.ts
@@ -175,8 +175,7 @@ export const getEditedEmailContent = createRegistrySelector(
postType,
postId
) as unknown as
- | { content: string | unknown; blocks: BlockInstance[] }
- | undefined;
+ { content: string | unknown; blocks: BlockInstance[] } | undefined;
if ( record ) {
return getContentFromEntity( record );
@@ -332,7 +331,7 @@ export const getCurrentTemplate = createRegistrySelector( ( select ) => () => {
return select( coreDataStore ).getEditedEntityRecord(
'postType',
'wp_template',
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
+
templateId
) as unknown as EmailTemplate;
}
@@ -436,7 +435,6 @@ export function getInitialEditorSettings(
export function getPaletteColors(
state: State
): State[ 'editorSettings' ][ '__experimentalFeatures' ][ 'color' ][ 'palette' ] {
- // eslint-disable-next-line no-underscore-dangle
return state.editorSettings?.__experimentalFeatures?.color?.palette;
}
diff --git a/packages/js/email-editor/src/store/types.ts b/packages/js/email-editor/src/store/types.ts
index e77e85e315f..602bf6e89b3 100644
--- a/packages/js/email-editor/src/store/types.ts
+++ b/packages/js/email-editor/src/store/types.ts
@@ -185,10 +185,7 @@ export type RecentEmailsQuery = {
};
export type Feature =
- | 'fullscreenMode'
- | 'showIconLabels'
- | 'fixedToolbar'
- | 'focusMode';
+ 'fullscreenMode' | 'showIconLabels' | 'fixedToolbar' | 'focusMode';
export type EmailEditorPostType = Omit< Post, 'type' > & {
type: string;
diff --git a/packages/js/email-editor/src/style-variables.ts b/packages/js/email-editor/src/style-variables.ts
index 6eaf3d84ab7..c1b98ca2f9f 100644
--- a/packages/js/email-editor/src/style-variables.ts
+++ b/packages/js/email-editor/src/style-variables.ts
@@ -8,7 +8,9 @@
export function unwrapCompressedPresetStyleVariableName(
value: string
): string | null {
- if ( typeof value !== 'string' ) return null;
+ if ( typeof value !== 'string' ) {
+ return null;
+ }
const match = value.match(
/^var:preset\|([a-zA-Z0-9-]+)\|([a-zA-Z0-9-]+)$/
);
@@ -24,9 +26,13 @@ export function unwrapCompressedPresetStyleVariable( value: string ): string {
// Get the raw value of a compressed variable read from the root element
export function getCompressedVariableValue( value: string ): string {
const variableName = unwrapCompressedPresetStyleVariableName( value );
- if ( ! variableName ) return value;
+ if ( ! variableName ) {
+ return value;
+ }
const root = document.querySelector( ':root' );
- if ( ! root ) return value;
+ if ( ! root ) {
+ return value;
+ }
const computedStyle = getComputedStyle( root );
return computedStyle.getPropertyValue( variableName ).trim() || value;
}
diff --git a/packages/js/email-editor/src/types/index.ts b/packages/js/email-editor/src/types/index.ts
index 724db666b2c..9ddeb3d0c54 100644
--- a/packages/js/email-editor/src/types/index.ts
+++ b/packages/js/email-editor/src/types/index.ts
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/naming-convention -- we have no control over 3rd-party naming conventions */
-
export type FontFamily = {
name: string;
slug: string;
diff --git a/packages/js/eslint-plugin/package.json b/packages/js/eslint-plugin/package.json
index e287f0a6251..c9daf796b40 100644
--- a/packages/js/eslint-plugin/package.json
+++ b/packages/js/eslint-plugin/package.json
@@ -30,7 +30,7 @@
"dependencies": {
"@wordpress/eslint-plugin": "25.6.0",
"eslint-plugin-testing-library": "^7.16.2",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"typescript-eslint": "^8.63.0"
},
"peerDependencies": {
diff --git a/packages/js/experimental/src/experimental-list/experimental-list-item.tsx b/packages/js/experimental/src/experimental-list/experimental-list-item.tsx
index eea21e8307c..83b94535ffd 100644
--- a/packages/js/experimental/src/experimental-list/experimental-list-item.tsx
+++ b/packages/js/experimental/src/experimental-list/experimental-list-item.tsx
@@ -60,7 +60,7 @@ export const ExperimentalListItem = ( {
onKeyDown: ( e: React.KeyboardEvent< HTMLElement > ) =>
handleKeyDown( e, otherProps.onClick ),
tabIndex: 0,
- }
+ }
: {};
const tagClasses = clsx( {
diff --git a/packages/js/experimental/src/experimental-list/test/index.tsx b/packages/js/experimental/src/experimental-list/test/index.tsx
index 7e9b4b81b6c..db16725a217 100644
--- a/packages/js/experimental/src/experimental-list/test/index.tsx
+++ b/packages/js/experimental/src/experimental-list/test/index.tsx
@@ -125,7 +125,7 @@ describe( 'Experimental List', () => {
).not.toBeInTheDocument();
} );
- it( 'supports onClick on the list item, and handles keyboard events', () => {
+ it( 'supports onClick on the list item, and handles keyboard events', async () => {
const dummyOnClick = jest.fn();
const { container, queryByRole } = render(
@@ -139,10 +139,10 @@ describe( 'Experimental List', () => {
);
if ( listItem ) {
- userEvent.click( listItem );
+ await userEvent.click( listItem );
// it doesn't actually matter what key you hit here while handleKeyDown is mocked.
- userEvent.type( listItem, '{enter}' );
+ await userEvent.type( listItem, '{enter}' );
}
// TODO check that the button role was added.
@@ -180,7 +180,7 @@ describe( 'Experimental List', () => {
expect( container ).toHaveTextContent( 'Show more items' );
} );
- it( 'should render list items when footer is clicked and trigger onExpand', () => {
+ it( 'should render list items when footer is clicked and trigger onExpand', async () => {
const onExpand = jest.fn();
const onCollapse = jest.fn();
const { container } = render(
@@ -198,7 +198,7 @@ describe( 'Experimental List', () => {
const listItem = container.querySelector( '.list-item-collapse' );
if ( listItem ) {
- userEvent.click( listItem );
+ await userEvent.click( listItem );
}
expect( container ).toHaveTextContent( 'Test' );
expect( container ).toHaveTextContent( 'Test 2' );
@@ -208,7 +208,7 @@ describe( 'Experimental List', () => {
expect( onCollapse ).not.toHaveBeenCalled();
} );
- it( 'should render minimum children if minChildrenToShow is set and show the rest on expand', () => {
+ it( 'should render minimum children if minChildrenToShow is set and show the rest on expand', async () => {
const onExpand = jest.fn();
const onCollapse = jest.fn();
const { container } = render(
@@ -233,7 +233,7 @@ describe( 'Experimental List', () => {
const listItem = container.querySelector( '.list-item-collapse' );
if ( listItem ) {
- userEvent.click( listItem );
+ await userEvent.click( listItem );
}
expect( container ).toHaveTextContent( 'Test' );
expect( container ).toHaveTextContent( 'Test 2' );
@@ -263,7 +263,7 @@ describe( 'Experimental List', () => {
let listItem = container.querySelector( '.list-item-collapse' );
if ( listItem ) {
- userEvent.click( listItem );
+ await userEvent.click( listItem );
}
expect( container ).toHaveTextContent( 'Test' );
expect( container ).toHaveTextContent( 'Test 2' );
@@ -273,7 +273,7 @@ describe( 'Experimental List', () => {
listItem = container.querySelector( '.list-item-collapse' );
if ( listItem ) {
- userEvent.click( listItem );
+ await userEvent.click( listItem );
}
expect( container ).toHaveTextContent( 'Show more items' );
expect( container ).not.toHaveTextContent( 'Show less' );
diff --git a/packages/js/experimental/src/inbox-note/test/inbox-dismiss-confirmation-modal.tsx b/packages/js/experimental/src/inbox-note/test/inbox-dismiss-confirmation-modal.tsx
index 01ef4d1cdda..fd81bb0cf19 100644
--- a/packages/js/experimental/src/inbox-note/test/inbox-dismiss-confirmation-modal.tsx
+++ b/packages/js/experimental/src/inbox-note/test/inbox-dismiss-confirmation-modal.tsx
@@ -32,7 +32,7 @@ describe( 'InboxDismissConfirmationModal', () => {
expect( queryByText( 'Custom button' ) ).toBeInTheDocument();
} );
- it( 'should call onClose if Cancel is clicked', () => {
+ it( 'should call onClose if Cancel is clicked', async () => {
const onClose = jest.fn();
const { getByText } = render(
<InboxDismissConfirmationModal
@@ -40,11 +40,11 @@ describe( 'InboxDismissConfirmationModal', () => {
onDismiss={ jest.fn() }
/>
);
- userEvent.click( getByText( 'Cancel' ) );
+ await userEvent.click( getByText( 'Cancel' ) );
expect( onClose ).toHaveBeenCalled();
} );
- it( 'should call onDismiss if dismiss button is clicked', () => {
+ it( 'should call onDismiss if dismiss button is clicked', async () => {
const onDismiss = jest.fn();
const { getByText } = render(
<InboxDismissConfirmationModal
@@ -52,7 +52,7 @@ describe( 'InboxDismissConfirmationModal', () => {
onDismiss={ onDismiss }
/>
);
- userEvent.click( getByText( "Yes, I'm sure" ) );
+ await userEvent.click( getByText( "Yes, I'm sure" ) );
expect( onDismiss ).toHaveBeenCalled();
} );
} );
diff --git a/packages/js/experimental/src/inbox-note/test/inbox-note.tsx b/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
index 9e9b707c76b..32379bfb8a6 100644
--- a/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
+++ b/packages/js/experimental/src/inbox-note/test/inbox-note.tsx
@@ -190,7 +190,7 @@ describe( 'InboxNoteCard', () => {
} );
describe( 'callbacks', () => {
- it( 'should call onDismiss with note when "Dismiss this message" is clicked', () => {
+ it( 'should call onDismiss with note when "Dismiss this message" is clicked', async () => {
const onDismiss = jest.fn();
const { getByText } = render(
<InboxNoteCard
@@ -199,11 +199,11 @@ describe( 'InboxNoteCard', () => {
onDismiss={ onDismiss }
/>
);
- userEvent.click( getByText( 'Dismiss' ) );
+ await userEvent.click( getByText( 'Dismiss' ) );
expect( onDismiss ).toHaveBeenCalledWith( note );
} );
- it( 'should call onNoteActionClick with specific action when action is clicked', () => {
+ it( 'should call onNoteActionClick with specific action when action is clicked', async () => {
const onNoteActionClick = jest.fn();
const { getByText } = render(
<InboxNoteCard
@@ -212,14 +212,14 @@ describe( 'InboxNoteCard', () => {
onNoteActionClick={ onNoteActionClick }
/>
);
- userEvent.click( getByText( 'Learn More' ) );
+ await userEvent.click( getByText( 'Learn More' ) );
expect( onNoteActionClick ).toHaveBeenCalledWith(
note,
note.actions[ 1 ]
);
} );
- it( 'should call onBodyLinkClick with innerLink if link within content is clicked', () => {
+ it( 'should call onBodyLinkClick with innerLink if link within content is clicked', async () => {
const onBodyLinkClick = jest.fn();
const noteWithInnerLink = {
...note,
@@ -234,7 +234,7 @@ describe( 'InboxNoteCard', () => {
onBodyLinkClick={ onBodyLinkClick }
/>
);
- userEvent.click( getByText( 'Somewhere' ) );
+ await userEvent.click( getByText( 'Somewhere' ) );
expect( onBodyLinkClick ).toHaveBeenCalledWith(
noteWithInnerLink,
'http://somewhere.com/'
diff --git a/packages/js/experimental/src/inbox-note/test/use-callback-on-link-click.tsx b/packages/js/experimental/src/inbox-note/test/use-callback-on-link-click.tsx
index 2efcb221b98..c09fc83b2a0 100644
--- a/packages/js/experimental/src/inbox-note/test/use-callback-on-link-click.tsx
+++ b/packages/js/experimental/src/inbox-note/test/use-callback-on-link-click.tsx
@@ -29,17 +29,17 @@ const TestComp = ( { callback }: { callback: ( link: string ) => void } ) => {
};
describe( 'useCallbackOnLinkClick hook', () => {
- it( 'should call callback with link when inner anchor element is clicked', () => {
+ it( 'should call callback with link when inner anchor element is clicked', async () => {
const callback = jest.fn();
const { getByText } = render( <TestComp callback={ callback } /> );
- userEvent.click( getByText( 'Link' ) );
+ await userEvent.click( getByText( 'Link' ) );
expect( callback ).toHaveBeenCalledWith( 'http://tosomewhere.com/' );
} );
- it( 'should not call callback if click event target does not have an href', () => {
+ it( 'should not call callback if click event target does not have an href', async () => {
const callback = jest.fn();
const { getByText } = render( <TestComp callback={ callback } /> );
- userEvent.click( getByText( 'Button' ) );
+ await userEvent.click( getByText( 'Button' ) );
expect( callback ).not.toHaveBeenCalled();
} );
diff --git a/packages/js/experimental/src/inbox-note/use-callback-on-link-click.ts b/packages/js/experimental/src/inbox-note/use-callback-on-link-click.ts
index 537c08e0467..89a8c02b9b5 100644
--- a/packages/js/experimental/src/inbox-note/use-callback-on-link-click.ts
+++ b/packages/js/experimental/src/inbox-note/use-callback-on-link-click.ts
@@ -7,9 +7,7 @@ export function useCallbackOnLinkClick( onClick: ( link: string ) => void ) {
const onNodeClick = useCallback(
( event: MouseEvent ): void => {
const target = event.target as
- | EventTarget
- | HTMLAnchorElement
- | null;
+ EventTarget | HTMLAnchorElement | null;
if ( target && 'href' in target ) {
const innerLink = target.href;
if ( innerLink && onClick ) {
diff --git a/packages/js/expression-evaluation/src/test/index.test.ts b/packages/js/expression-evaluation/src/test/index.test.ts
index d13d9ee4ff1..1699bb11448 100644
--- a/packages/js/expression-evaluation/src/test/index.test.ts
+++ b/packages/js/expression-evaluation/src/test/index.test.ts
@@ -84,7 +84,6 @@ describe( 'evaluate', () => {
} );
it( 'should evaluate a string literal with double quotes and escaped backslashes', () => {
- // eslint-disable-next-line prettier/prettier
const result = evaluate( '"foo \\\\\\"bar\\\\\\""' );
expect( result ).toEqual( 'foo \\"bar\\"' );
@@ -97,7 +96,6 @@ describe( 'evaluate', () => {
} );
it( 'should evaluate a string literal with single quotes and double quotes', () => {
- // eslint-disable-next-line prettier/prettier
const result = evaluate( '\'foo "bar"\'' );
expect( result ).toEqual( 'foo "bar"' );
@@ -110,7 +108,6 @@ describe( 'evaluate', () => {
} );
it( 'should evaluate a string literal with single quotes and escaped backslashes', () => {
- // eslint-disable-next-line prettier/prettier
const result = evaluate( "'foo \\\\\\'bar\\\\\\''" );
expect( result ).toEqual( "foo \\'bar\\'" );
diff --git a/packages/js/internal-build/src/composer/index.ts b/packages/js/internal-build/src/composer/index.ts
index 37ee3a7887e..b290db9ce79 100644
--- a/packages/js/internal-build/src/composer/index.ts
+++ b/packages/js/internal-build/src/composer/index.ts
@@ -122,23 +122,33 @@ async function resolvePackages(
const wanted = new Set< string >();
for ( const key of Object.keys( composer.require ?? {} ) ) {
- if ( ! isPlatformReq( key ) ) wanted.add( key );
+ if ( ! isPlatformReq( key ) ) {
+ wanted.add( key );
+ }
}
for ( const key of Object.keys( composer[ 'require-dev' ] ?? {} ) ) {
- if ( ! isPlatformReq( key ) ) wanted.add( key );
+ if ( ! isPlatformReq( key ) ) {
+ wanted.add( key );
+ }
}
const packages: WatchedPackage[] = [];
for ( const repo of composer.repositories ?? [] ) {
- if ( repo.type !== 'path' || ! repo.url ) continue;
+ if ( repo.type !== 'path' || ! repo.url ) {
+ continue;
+ }
const sourceDir = path.resolve( projectDir, repo.url );
const pkgJsonPath = path.join( sourceDir, 'composer.json' );
- if ( ! existsSync( pkgJsonPath ) ) continue;
+ if ( ! existsSync( pkgJsonPath ) ) {
+ continue;
+ }
const pkgJson = await readJson< ComposerJson >( pkgJsonPath );
- if ( ! pkgJson.name || ! wanted.has( pkgJson.name ) ) continue;
+ if ( ! pkgJson.name || ! wanted.has( pkgJson.name ) ) {
+ continue;
+ }
// Composer's default for path repositories is "symlink if possible,
// copy otherwise" — so the only safe signal that Composer will copy
@@ -156,14 +166,18 @@ async function resolvePackages(
// host filesystem. Warn and skip — mirroring on top of a symlink
// would just duplicate state.
if ( repo.options?.symlink === true ) {
- if ( ignoredPackages.has( pkgJson.name ) ) continue;
+ if ( ignoredPackages.has( pkgJson.name ) ) {
+ continue;
+ }
throw new Error(
`path repository '${ pkgJson.name }' has symlink: true but the consuming project depends on it. ` +
`Set 'options: { symlink: false }' so Composer copies the package, or add it to ignoredPackages if the symlink is intentional.`
);
}
if ( repo.options?.symlink !== false ) {
- if ( ignoredPackages.has( pkgJson.name ) ) continue;
+ if ( ignoredPackages.has( pkgJson.name ) ) {
+ continue;
+ }
log.warn(
'warn',
`path repository '${ pkgJson.name }' has no explicit symlink option; skipping. Set 'options: { symlink: false }' to enable mirroring, or add it to ignoredPackages to silence this warning.`
@@ -204,7 +218,9 @@ function debounce( fn: () => Promise< void >, wait: number ): () => void {
let running = false;
function schedule(): void {
- if ( timer ) clearTimeout( timer );
+ if ( timer ) {
+ clearTimeout( timer );
+ }
timer = setTimeout( () => {
if ( running ) {
pending = true;
@@ -240,7 +256,7 @@ function runComposer( args: string[], projectDir: string ): Promise< void > {
new Error(
`composer ${ args.join( ' ' ) } exited ${ code }`
)
- )
+ )
);
child.on( 'error', reject );
} );
@@ -329,7 +345,9 @@ export async function watchComposerPackages(
let composerInstallRunning = false;
const onComposerJsonChange = async (): Promise< void > => {
- if ( composerInstallRunning ) return;
+ if ( composerInstallRunning ) {
+ return;
+ }
composerInstallRunning = true;
log.info( 'watch', 'composer.json changed; composer install' );
try {
@@ -363,13 +381,16 @@ export async function watchComposerPackages(
): Promise< void > => {
// Consuming project's composer.json is its own path; not in any pkg.
if ( absPath === composerJsonPath ) {
- if ( event === 'change' || event === 'add' )
+ if ( event === 'change' || event === 'add' ) {
void onComposerJsonChange();
+ }
return;
}
const pkg = findPackageFor( absPath );
- if ( ! pkg ) return;
+ if ( ! pkg ) {
+ return;
+ }
// A watched package's own composer.json changing means its autoload
// spec may have changed. Mirror it and treat as a project-level
diff --git a/packages/js/internal-build/src/esbuild/index.ts b/packages/js/internal-build/src/esbuild/index.ts
index 5892cf73c72..1df409dd530 100644
--- a/packages/js/internal-build/src/esbuild/index.ts
+++ b/packages/js/internal-build/src/esbuild/index.ts
@@ -41,10 +41,12 @@ async function resolveEntryPoints(
function summarize( result: BuildResult ): string {
const parts: string[] = [];
- if ( result.errors.length )
+ if ( result.errors.length ) {
parts.push( `${ result.errors.length } error(s)` );
- if ( result.warnings.length )
+ }
+ if ( result.warnings.length ) {
parts.push( `${ result.warnings.length } warning(s)` );
+ }
return parts.length ? ` — ${ parts.join( ', ' ) }` : '';
}
@@ -63,15 +65,18 @@ export async function buildPackage( options: BuildOptions ): Promise< void > {
const entryPoints = await resolveEntryPoints( options.entryPoints, ignore );
log.debug( 'build', `format: ${ format }, outdir: ${ outdir }` );
- for ( const entry of entryPoints )
+ for ( const entry of entryPoints ) {
log.debug( 'build', `entry: ${ entry }` );
+ }
const t0 = Date.now();
log.info( 'build', `${ entryPoints.length } entry point(s)...` );
const result = await build(
prepareEsbuildOptions( format, entryPoints, options.esbuild )
);
- if ( options.assets?.length ) await copyAssets( options.assets, outdir );
+ if ( options.assets?.length ) {
+ await copyAssets( options.assets, outdir );
+ }
log.info( 'ok', `done in ${ Date.now() - t0 }ms${ summarize( result ) }` );
}
@@ -97,12 +102,15 @@ export async function watchPackage( options: BuildOptions ): Promise< void > {
log.debug( 'watch', `format: ${ format }, outdir: ${ outdir }` );
log.debug( 'watch', `watching: ${ watchedPatterns.join( ', ' ) }` );
- for ( const entry of entryPoints )
+ for ( const entry of entryPoints ) {
log.debug( 'watch', `entry: ${ entry }` );
+ }
try {
const initial = await ctx.rebuild();
- if ( assets.length ) await copyAssets( assets, outdir );
+ if ( assets.length ) {
+ await copyAssets( assets, outdir );
+ }
log.info(
'watch',
`ready in ${ Date.now() - startupT0 }ms — ${
@@ -127,7 +135,9 @@ export async function watchPackage( options: BuildOptions ): Promise< void > {
const restart = ( path: string, kind: string ): void => {
pendingChanges.add( `${ path } (${ kind })` );
log.debug( 'watch', `${ kind }: ${ path }` );
- if ( pending ) clearTimeout( pending );
+ if ( pending ) {
+ clearTimeout( pending );
+ }
pending = setTimeout( () => {
void ( async () => {
const changes = [ ...pendingChanges ];
@@ -152,7 +162,9 @@ export async function watchPackage( options: BuildOptions ): Promise< void > {
)
);
const result = await ctx.rebuild();
- if ( assets.length ) await copyAssets( assets, outdir );
+ if ( assets.length ) {
+ await copyAssets( assets, outdir );
+ }
log.info(
'ok',
`rebuilt in ${ Date.now() - t0 }ms — ${
diff --git a/packages/js/internal-build/src/utils/logger.ts b/packages/js/internal-build/src/utils/logger.ts
index bbe9eaf2b64..6e27756339a 100644
--- a/packages/js/internal-build/src/utils/logger.ts
+++ b/packages/js/internal-build/src/utils/logger.ts
@@ -44,8 +44,9 @@ export const log = {
console.log( format( prefix, message ) );
},
debug( context: string, message: string ): void {
- if ( debugEnabled )
+ if ( debugEnabled ) {
console.log( format( 'debug', `${ context }: ${ message }` ) );
+ }
},
warn( prefix: LoggerPrefix, message: string ): void {
console.warn( format( prefix, message ) );
diff --git a/packages/js/navigation/src/index.js b/packages/js/navigation/src/index.js
index 7d86f68269e..9074c4def0c 100644
--- a/packages/js/navigation/src/index.js
+++ b/packages/js/navigation/src/index.js
@@ -90,7 +90,8 @@ export const getScreenFromPath = ( path = getPath() ) => {
* @return {Set<number>} List of IDs converted to a set of integers.
*/
export function getSetOfIdsFromQuery( queryString = '' ) {
- return new Set( // Return only unique ids.
+ return new Set(
+ // Return only unique ids.
queryString
.split( ',' )
.map( ( id ) => parseInt( id, 10 ) )
diff --git a/packages/js/notices/src/store/selectors.ts b/packages/js/notices/src/store/selectors.ts
index dcc7a751443..d0da4013698 100644
--- a/packages/js/notices/src/store/selectors.ts
+++ b/packages/js/notices/src/store/selectors.ts
@@ -40,7 +40,6 @@ const DEFAULT_NOTICES: [] = [];
* announced to screen readers. Defaults to
* `true`.
* @property {WPNoticeAction[]} actions User actions to present with notice.
- *
*/
/**
diff --git a/packages/js/onboarding/src/utils/countries/test/utils/index.test.ts b/packages/js/onboarding/src/utils/countries/test/utils/index.test.ts
index 6b8a4833d8c..8edbc9ec967 100644
--- a/packages/js/onboarding/src/utils/countries/test/utils/index.test.ts
+++ b/packages/js/onboarding/src/utils/countries/test/utils/index.test.ts
@@ -1,6 +1,3 @@
-/* eslint-disable camelcase */
-/* eslint-disable no-undef */
-
/**
* Internal dependencies
*/
diff --git a/packages/js/onboarding/src/utils/countries/test/utils/location-mapping.test.ts b/packages/js/onboarding/src/utils/countries/test/utils/location-mapping.test.ts
index bca1ea20330..bd34a197a4d 100644
--- a/packages/js/onboarding/src/utils/countries/test/utils/location-mapping.test.ts
+++ b/packages/js/onboarding/src/utils/countries/test/utils/location-mapping.test.ts
@@ -1,5 +1,3 @@
-/* eslint-disable camelcase */
-
/**
* Internal dependencies
*/
diff --git a/packages/js/remote-logging/src/remote-logger.ts b/packages/js/remote-logging/src/remote-logger.ts
index c35024a7110..8e7f1d5db51 100644
--- a/packages/js/remote-logging/src/remote-logger.ts
+++ b/packages/js/remote-logging/src/remote-logger.ts
@@ -393,7 +393,6 @@ export class RemoteLogger {
* @param {boolean} shouldSendError Whether the error should be sent.
* @param {Error} error The error object.
* @param {TraceKit.StackFrame[]} stackFrames The stack frames of the error.
- *
*/
return applyFilters(
REMOTE_LOGGING_SHOULD_SEND_ERROR_FILTER,
@@ -442,7 +441,6 @@ function canLog( _logger: RemoteLogger | null ): _logger is RemoteLogger {
* This function should be called once at the start of the application.
*
* @param config - Configuration object for the RemoteLogger.
- *
*/
export function init( config: RemoteLoggerConfig ) {
if ( ! window.wcSettings?.isRemoteLoggingEnabled ) {
@@ -473,7 +471,6 @@ export function init( config: RemoteLoggerConfig ) {
* @param severity - The severity of the log.
* @param message - The message to log.
* @param extraData - Optional additional data to include in the log.
- *
*/
export async function log(
severity: Exclude< LogData[ 'severity' ], undefined >,
diff --git a/packages/js/sanitize/src/sanitize.ts b/packages/js/sanitize/src/sanitize.ts
index 995f3005dc8..6e43e6a9bf8 100644
--- a/packages/js/sanitize/src/sanitize.ts
+++ b/packages/js/sanitize/src/sanitize.ts
@@ -39,9 +39,7 @@ export const DEFAULT_ALLOWED_ATTR = [
* These are the configuration values you can pass via `returnType`.
*/
export type SanitizeReturnKind =
- | 'string'
- | 'HTMLBodyElement'
- | 'DocumentFragment';
+ 'string' | 'HTMLBodyElement' | 'DocumentFragment';
/**
* Mapping between `SanitizeReturnKind` and the actual returned value types.
diff --git a/packages/js/sanitize/src/test/trusted-types-policy.test.ts b/packages/js/sanitize/src/test/trusted-types-policy.test.ts
index f2964bf62a1..19896dc1772 100644
--- a/packages/js/sanitize/src/test/trusted-types-policy.test.ts
+++ b/packages/js/sanitize/src/test/trusted-types-policy.test.ts
@@ -24,9 +24,8 @@ describe( 'getTrustedTypesPolicy', () => {
};
mockCreatePolicy.mockReturnValue( mockPolicy );
- const { getTrustedTypesPolicy } = await import(
- '../trusted-types-policy'
- );
+ const { getTrustedTypesPolicy } =
+ await import( '../trusted-types-policy' );
const policy = getTrustedTypesPolicy();
expect( policy ).toBe( mockPolicy );
@@ -45,9 +44,8 @@ describe( 'getTrustedTypesPolicy', () => {
};
mockCreatePolicy.mockReturnValue( mockPolicy );
- const { getTrustedTypesPolicy } = await import(
- '../trusted-types-policy'
- );
+ const { getTrustedTypesPolicy } =
+ await import( '../trusted-types-policy' );
const policy1 = getTrustedTypesPolicy();
const policy2 = getTrustedTypesPolicy();
@@ -58,9 +56,8 @@ describe( 'getTrustedTypesPolicy', () => {
test( 'should handle case when window.trustedTypes is not available', async () => {
delete ( window as unknown as { trustedTypes?: unknown } ).trustedTypes;
- const { getTrustedTypesPolicy } = await import(
- '../trusted-types-policy'
- );
+ const { getTrustedTypesPolicy } =
+ await import( '../trusted-types-policy' );
const policy = getTrustedTypesPolicy();
expect( policy ).toBeNull();
@@ -71,9 +68,8 @@ describe( 'getTrustedTypesPolicy', () => {
throw new Error( 'Creation failed' );
} );
- const { getTrustedTypesPolicy } = await import(
- '../trusted-types-policy'
- );
+ const { getTrustedTypesPolicy } =
+ await import( '../trusted-types-policy' );
const policy = getTrustedTypesPolicy();
expect( policy ).toBeNull();
@@ -102,9 +98,8 @@ describe( 'getTrustedTypesPolicy', () => {
sanitizeHTML: mockSanitizeHTML,
} ) );
- const { getTrustedTypesPolicy } = await import(
- '../trusted-types-policy'
- );
+ const { getTrustedTypesPolicy } =
+ await import( '../trusted-types-policy' );
const policy = getTrustedTypesPolicy();
// Now call createHTML on the policy
diff --git a/packages/js/settings-ui/src/dataform-adapter.tsx b/packages/js/settings-ui/src/dataform-adapter.tsx
index bb55c8ad1ac..95259e71622 100644
--- a/packages/js/settings-ui/src/dataform-adapter.tsx
+++ b/packages/js/settings-ui/src/dataform-adapter.tsx
@@ -149,7 +149,7 @@ const createIsVisible = (
? valueMatchesVisibilityRule(
item[ visibility.controller ],
visibility.value
- )
+ )
: true;
};
};
@@ -286,7 +286,7 @@ export const buildDataFormField = (
help,
help ? ' ' : null,
disabledTooltip
- )
+ )
: help;
const field: Field< SettingsValues > = {
diff --git a/packages/js/settings-ui/src/html.ts b/packages/js/settings-ui/src/html.ts
index 3d838b9c4fe..26a490e0d7b 100644
--- a/packages/js/settings-ui/src/html.ts
+++ b/packages/js/settings-ui/src/html.ts
@@ -14,5 +14,5 @@ export const createSettingsHelpElement = ( html?: string ) =>
dangerouslySetInnerHTML: {
__html: sanitizeSettingsHtml( html ),
},
- } )
+ } )
: undefined;
diff --git a/packages/js/settings-ui/src/registry.ts b/packages/js/settings-ui/src/registry.ts
index 0f4f75a6534..316885f1f59 100644
--- a/packages/js/settings-ui/src/registry.ts
+++ b/packages/js/settings-ui/src/registry.ts
@@ -179,7 +179,7 @@ export const resolveFieldComponent = (
? findInMatchingRegistrations(
context,
( registration ) => registration.components?.[ componentName ]
- )
+ )
: undefined;
const resolvedComponent =
@@ -196,7 +196,7 @@ export const resolveFieldComponent = (
? findInMatchingRegistrations(
context,
( registration ) => registration.typeRenderers?.number
- )
+ )
: undefined );
if ( resolvedComponent ) {
diff --git a/packages/js/settings-ui/src/settings-ui-page.tsx b/packages/js/settings-ui/src/settings-ui-page.tsx
index 22ed00a02f5..bf2252c72e0 100644
--- a/packages/js/settings-ui/src/settings-ui-page.tsx
+++ b/packages/js/settings-ui/src/settings-ui-page.tsx
@@ -321,8 +321,8 @@ const ShellHeader = ( {
: undefined;
const hasNavigation = Boolean(
( shell.navigation && shell.navigation.length > 0 ) ||
- ( shell.sectionNavigation && shell.sectionNavigation.length > 0 ) ||
- NavigationComponent
+ ( shell.sectionNavigation && shell.sectionNavigation.length > 0 ) ||
+ NavigationComponent
);
const breadcrumbs =
@@ -356,7 +356,7 @@ const ShellHeader = ( {
>
{ badge.label }
</span>
- ) )
+ ) )
: undefined;
return (
diff --git a/packages/js/settings-ui/src/types.ts b/packages/js/settings-ui/src/types.ts
index 9dffb815dd4..e94e95c8a9d 100644
--- a/packages/js/settings-ui/src/types.ts
+++ b/packages/js/settings-ui/src/types.ts
@@ -8,9 +8,7 @@ export type SettingsUIOption = {
};
export type SettingsUISaveAdapter =
- | 'form_post'
- | 'none'
- | ( string & NonNullable< unknown > );
+ 'form_post' | 'none' | ( string & NonNullable< unknown > );
export type SettingsUISaveSchema = {
adapter: SettingsUISaveAdapter;
@@ -74,11 +72,7 @@ export type SettingsUIShellNavigationItem = {
* screen-reader and color-blind users.
*/
export type SettingsUIShellBadgeIntent =
- | 'default'
- | 'info'
- | 'success'
- | 'warning'
- | 'error';
+ 'default' | 'info' | 'success' | 'warning' | 'error';
export type SettingsUIShellBadge = {
label: string;
@@ -127,6 +121,7 @@ export type SettingsEditControlField = {
getValue: ( args: { item: SettingsValues } ) => SettingsValue;
// Method syntax keeps this assignable from DataForm's signature, which
// also receives the normalized field.
+ // eslint-disable-next-line @typescript-eslint/method-signature-style -- Preserve callback parameter bivariance.
isDisabled( args: { item: SettingsValues } ): boolean;
};
diff --git a/packages/js/tracks/src/test/stats.ts b/packages/js/tracks/src/test/stats.ts
index e4cecde9b80..e0969b273ef 100644
--- a/packages/js/tracks/src/test/stats.ts
+++ b/packages/js/tracks/src/test/stats.ts
@@ -45,7 +45,7 @@ describe( 'bumpStat', () => {
jest.doMock( '../utils', () => ( {
isDevelopmentMode: true,
} ) );
- // eslint-disable-next-line @typescript-eslint/no-var-requires
+
const { bumpStat: bumpStatDev } = require( '../stats' );
const result = bumpStatDev( 'group', 'name' );
diff --git a/plugins/woocommerce-beta-tester/package.json b/plugins/woocommerce-beta-tester/package.json
index 26c7e5d6abb..2c499e8d53e 100644
--- a/plugins/woocommerce-beta-tester/package.json
+++ b/plugins/woocommerce-beta-tester/package.json
@@ -21,7 +21,7 @@
"@wordpress/scripts": "^32.6.0",
"eslint": "^10.0.0",
"globals": "^16.5.0",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"react": "18.3.x",
"react-dom": "18.3.x",
"ts-loader": "9.5.x",
diff --git a/plugins/woocommerce-beta-tester/src/experiments/data/reducer.js b/plugins/woocommerce-beta-tester/src/experiments/data/reducer.js
index 3f34bd0a8ef..32f11511939 100644
--- a/plugins/woocommerce-beta-tester/src/experiments/data/reducer.js
+++ b/plugins/woocommerce-beta-tester/src/experiments/data/reducer.js
@@ -42,7 +42,7 @@ const reducer = ( state = DEFAULT_STATE, action ) => {
name: action.experimentName,
variation: action.variation,
},
- ];
+ ];
return {
...state,
diff --git a/plugins/woocommerce-beta-tester/src/remote-inbox-notifications/data/actions.js b/plugins/woocommerce-beta-tester/src/remote-inbox-notifications/data/actions.js
index 31fe6d2d76f..81e4ffc1c1d 100644
--- a/plugins/woocommerce-beta-tester/src/remote-inbox-notifications/data/actions.js
+++ b/plugins/woocommerce-beta-tester/src/remote-inbox-notifications/data/actions.js
@@ -103,7 +103,7 @@ export function* testNotification( name ) {
typeof response.message === 'string'
? response.message
: 'The following rules have failed.\n\n' +
- JSON.stringify( response.message, null, 2 ),
+ JSON.stringify( response.message, null, 2 ),
status: response.success ? 'success' : 'error',
} );
} catch ( e ) {
diff --git a/plugins/woocommerce-beta-tester/src/tools/commands/load-template-version.js b/plugins/woocommerce-beta-tester/src/tools/commands/load-template-version.js
index 5941f731306..efa20e791dc 100644
--- a/plugins/woocommerce-beta-tester/src/tools/commands/load-template-version.js
+++ b/plugins/woocommerce-beta-tester/src/tools/commands/load-template-version.js
@@ -173,7 +173,7 @@ export const LoadTemplateVersion = () => {
value: '',
label: 'No versions available',
},
- ]
+ ]
}
onChange={ handleVersionChange }
disabled={ isLoadingVersions || versions.length === 0 }
diff --git a/plugins/woocommerce/client/admin/client/activity-panel/activity-panel.js b/plugins/woocommerce/client/admin/client/activity-panel/activity-panel.js
index c905b18afb7..9e1c8c5d655 100644
--- a/plugins/woocommerce/client/admin/client/activity-panel/activity-panel.js
+++ b/plugins/woocommerce/client/admin/client/activity-panel/activity-panel.js
@@ -37,14 +37,16 @@ import { useLaunchYourStore } from '~/launch-your-store';
import { useTaskListsState } from '~/hooks/use-tasklists-state';
import HeaderAccount from '../marketplace/components/header-account/header-account';
-const HelpPanel = lazy( () =>
- import( /* webpackChunkName: "activity-panels-help" */ './panels/help' )
+const HelpPanel = lazy(
+ () =>
+ import( /* webpackChunkName: "activity-panels-help" */ './panels/help' )
);
-const SetupTasksPanel = lazy( () =>
- import(
- /* webpackChunkName: "activity-panels-setup" */ './panels/setup-tasks/setup-tasks-panel.tsx'
- )
+const SetupTasksPanel = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "activity-panels-setup" */ './panels/setup-tasks/setup-tasks-panel.tsx'
+ )
);
export const ActivityPanel = ( { isEmbedded, query } ) => {
diff --git a/plugins/woocommerce/client/admin/client/activity-panel/panels/help.js b/plugins/woocommerce/client/admin/client/activity-panel/panels/help.js
index 745489b492b..7195c941a63 100644
--- a/plugins/woocommerce/client/admin/client/activity-panel/panels/help.js
+++ b/plugins/woocommerce/client/admin/client/activity-panel/panels/help.js
@@ -328,7 +328,7 @@ function getListItems( props ) {
let validatedItems = Array.isArray( filteredItems )
? filteredItems.filter(
( item ) => item instanceof Object && item.title && item.link
- )
+ )
: [];
// Default empty array to the generic docs link.
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/import-status-bar.tsx b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/import-status-bar.tsx
index 667e59fcdc3..ee7a641a760 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/import-status-bar.tsx
+++ b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/import-status-bar.tsx
@@ -96,7 +96,7 @@ export function ImportStatusBar(): JSX.Element | null {
: __(
'Failed to trigger analytics update.',
'woocommerce'
- ),
+ ),
{
isDismissible: true,
}
@@ -159,11 +159,11 @@ export function ImportStatusBar(): JSX.Element | null {
? __(
'Analytics data import in progress',
'woocommerce'
- )
+ )
: __(
'Manually trigger analytics data import',
'woocommerce'
- )
+ )
}
>
{ isBusy ? (
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/test/import-status-bar.test.tsx b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/test/import-status-bar.test.tsx
index ad005f4fd2e..8756a248a15 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/test/import-status-bar.test.tsx
+++ b/plugins/woocommerce/client/admin/client/analytics/components/import-status-bar/test/import-status-bar.test.tsx
@@ -24,7 +24,9 @@ jest.mock( '@wordpress/date', () => ( {
...jest.requireActual( '@wordpress/date' ),
dateI18n: jest.fn( ( format, date ) => {
// Simple mock that returns a date-like string
- if ( ! date ) return 'Never';
+ if ( ! date ) {
+ return 'Never';
+ }
return 'Nov 21 00:00';
} ),
} ) );
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/report-chart/index.js b/plugins/woocommerce/client/admin/client/analytics/components/report-chart/index.js
index 6cd97d28831..9d785b60bb4 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/report-chart/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/components/report-chart/index.js
@@ -62,9 +62,9 @@ export class ReportChart extends Component {
if ( segment.segment_label ) {
const label = intervalData[ segment.segment_label ]
? segment.segment_label +
- ' (#' +
- segment.segment_id +
- ')'
+ ' (#' +
+ segment.segment_id +
+ ')'
: segment.segment_label;
intervalData[ segment.segment_id ] = {
label,
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/report-chart/utils.js b/plugins/woocommerce/client/admin/client/analytics/components/report-chart/utils.js
index f9b04253d7d..c4683397348 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/report-chart/utils.js
+++ b/plugins/woocommerce/client/admin/client/analytics/components/report-chart/utils.js
@@ -109,7 +109,7 @@ export function buildChartData(
'YYYY-MM-DD'
),
secondaryInterval,
- ] )
+ ] )
: []
);
@@ -177,7 +177,7 @@ export function buildChartData(
dayAfter.month() === 1 && dayAfter.date() === 29
? secondaryIntervalsByDate.get(
dayAfter.format( 'YYYY-MM-DD' )
- )
+ )
: undefined;
if ( leapDayInterval ) {
secondaryValue +=
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/report-filters/test/index.js b/plugins/woocommerce/client/admin/client/analytics/components/report-filters/test/index.js
index cf31e44ddf6..c30cfc8268c 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/report-filters/test/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/components/report-filters/test/index.js
@@ -40,8 +40,8 @@ describe( 'ReportFilters', () => {
] }
/>
);
- userEvent.click( getByText( 'All products' ) );
- userEvent.click( getByText( 'Some products' ) );
+ await userEvent.click( getByText( 'All products' ) );
+ await userEvent.click( getByText( 'Some products' ) );
expect( recordEvent ).toHaveBeenCalledWith( 'analytics_filter', {
filter: 'some',
report: 'test-report',
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/report-summary/test/index.js b/plugins/woocommerce/client/admin/client/analytics/components/report-summary/test/index.js
index a3bd2d6e859..897e6a4dbec 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/report-summary/test/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/components/report-summary/test/index.js
@@ -76,7 +76,7 @@ describe( 'ReportSummary', () => {
expect( delta ).toBeInTheDocument();
expectTooltipToBeHidden();
- userEvent.hover( delta );
+ await userEvent.hover( delta );
await waitExpectTooltipToShow();
const tooltip = await screen.findByText( 'Previous year: 500.25' );
@@ -97,7 +97,7 @@ describe( 'ReportSummary', () => {
expect( delta ).toBeInTheDocument();
expectTooltipToBeHidden();
- userEvent.hover( delta );
+ await userEvent.hover( delta );
const tooltip = await screen.findByText( 'Previous year: $500.25' );
expect( tooltip ).toBeInTheDocument();
@@ -118,7 +118,7 @@ describe( 'ReportSummary', () => {
expect( delta ).toBeInTheDocument();
expectTooltipToBeHidden();
- userEvent.hover( delta );
+ await userEvent.hover( delta );
const tooltip = await screen.findByText( 'Previous year: 500' );
expect( tooltip ).toBeInTheDocument();
@@ -137,7 +137,7 @@ describe( 'ReportSummary', () => {
expect( delta ).toBeInTheDocument();
expectTooltipToBeHidden();
- userEvent.hover( delta );
+ await userEvent.hover( delta );
const tooltip = await screen.findByText( 'Previous year: 0' );
await waitExpectTooltipToShow();
expect( tooltip ).toBeInTheDocument();
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/report-table/index.js b/plugins/woocommerce/client/admin/client/analytics/components/report-table/index.js
index 4d05aba4273..d906a381569 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/report-table/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/components/report-table/index.js
@@ -621,7 +621,7 @@ export default compose(
advancedFilters,
defaultDateRange,
fields: summaryFields,
- } )
+ } )
: EMPTY_OBJECT;
const queriedTableData =
tableData ||
@@ -646,7 +646,7 @@ export default compose(
itemIdField && extendedTableData.items.data
? extendedTableData.items.data.map(
( item ) => item[ itemIdField ]
- )
+ )
: EMPTY_ARRAY,
tableData: extendedTableData,
query,
diff --git a/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/test/index.tsx b/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/test/index.tsx
index 2c4626ee0fd..6772de06704 100644
--- a/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/test/index.tsx
+++ b/plugins/woocommerce/client/admin/client/analytics/components/scheduled-updates-promotion-notice/test/index.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/categories/breadcrumbs.js b/plugins/woocommerce/client/admin/client/analytics/report/categories/breadcrumbs.js
index 099925b4c82..50ac4c8a958 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/categories/breadcrumbs.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/categories/breadcrumbs.js
@@ -15,7 +15,9 @@ export default class CategoryBreadcrumbs extends Component {
while ( parent ) {
const parentCategory = categories.get( parent );
- if ( ! parentCategory ) break;
+ if ( ! parentCategory ) {
+ break;
+ }
ancestors.unshift( parent );
parent = parentCategory.parent;
}
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/categories/index.js b/plugins/woocommerce/client/admin/client/analytics/report/categories/index.js
index 52e0bf680cf..ff839ce8228 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/categories/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/categories/index.js
@@ -32,9 +32,9 @@ class CategoriesReport extends Component {
: 'time-comparison';
const itemsLabel = isSingleCategoryView
? /* translators: %d: number of products */
- __( '%d products', 'woocommerce' )
+ __( '%d products', 'woocommerce' )
: /* translators: %d: number of categories */
- __( '%d categories', 'woocommerce' );
+ __( '%d categories', 'woocommerce' );
return {
isSingleCategoryView,
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/coupons/table.js b/plugins/woocommerce/client/admin/client/analytics/report/coupons/table.js
index 2fc06266bbd..2a28836aafc 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/coupons/table.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/coupons/table.js
@@ -95,7 +95,7 @@ class CouponsReportTable extends Component {
? getNewPath( persistedQuery, '/analytics/coupons', {
filter: 'single_coupon',
coupons: couponId,
- } )
+ } )
: null;
const couponLink =
@@ -112,7 +112,7 @@ class CouponsReportTable extends Component {
? getNewPath( persistedQuery, '/analytics/orders', {
filter: 'advanced',
coupon_includes: couponId,
- } )
+ } )
: null;
const ordersLink =
ordersUrl === null ? (
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/customers/config.js b/plugins/woocommerce/client/admin/client/analytics/report/customers/config.js
index 79735cae4d4..aecdda22662 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/customers/config.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/customers/config.js
@@ -73,7 +73,6 @@ export const filters = applyFilters( CUSTOMERS_REPORT_FILTERS_FILTER, [
},
] );
-/*eslint-disable max-len*/
/**
* Customers Report Advanced Filters.
*
@@ -504,4 +503,3 @@ export const advancedFilters = applyFilters(
},
}
);
-/*eslint-enable max-len*/
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/orders/config.js b/plugins/woocommerce/client/admin/client/analytics/report/orders/config.js
index 6075a5f437c..139a14a5b6b 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/orders/config.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/orders/config.js
@@ -83,8 +83,6 @@ export const filters = applyFilters( ORDERS_REPORT_FILTERS_FILTER, [
},
] );
-/*eslint-disable max-len*/
-
/**
* Orders Report Advanced Filters.
*
@@ -377,4 +375,3 @@ export const advancedFilters = applyFilters(
},
}
);
-/*eslint-enable max-len*/
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/orders/table.js b/plugins/woocommerce/client/admin/client/analytics/report/orders/table.js
index fb319e9526f..331a27543d6 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/orders/table.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/orders/table.js
@@ -273,6 +273,7 @@ class OrdersReportTable extends Component {
value: formatValue( currency, 'number', ordersCount ),
},
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: _n(
' Customer',
' Customers',
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/products/index.js b/plugins/woocommerce/client/admin/client/analytics/report/products/index.js
index 87f648ccb2e..0cb6783c3d9 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/products/index.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/products/index.js
@@ -40,9 +40,9 @@ class ProductsReport extends Component {
const label =
isSingleProductView && isSingleProductVariable
? /* translators: %d: number of variations */
- __( '%d variations', 'woocommerce' )
+ __( '%d variations', 'woocommerce' )
: /* translators: %d: number of products */
- __( '%d products', 'woocommerce' );
+ __( '%d products', 'woocommerce' );
return {
compareObject,
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/products/table.js b/plugins/woocommerce/client/admin/client/analytics/report/products/table.js
index 5368ca66137..4cc3006b74a 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/products/table.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/products/table.js
@@ -86,14 +86,14 @@ class ProductsReportTable extends Component {
? {
label: __( 'Status', 'woocommerce' ),
key: 'stock_status',
- }
+ }
: null,
manageStock === 'yes'
? {
label: __( 'Stock', 'woocommerce' ),
key: 'stock',
isNumeric: true,
- }
+ }
: null,
].filter( Boolean );
}
@@ -257,7 +257,7 @@ class ProductsReportTable extends Component {
value: extendedInfoManageStock
? stockStatuses[ extendedInfoStockStatus ]
: null,
- }
+ }
: null,
manageStock === 'yes'
? {
@@ -266,10 +266,10 @@ class ProductsReportTable extends Component {
currency,
'number',
stockQuantity
- )
+ )
: __( 'N/A', 'woocommerce' ),
value: stockQuantity,
- }
+ }
: null,
].filter( Boolean );
} );
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/revenue/config.js b/plugins/woocommerce/client/admin/client/analytics/report/revenue/config.js
index 03f55df8048..158ab0f29ed 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/revenue/config.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/revenue/config.js
@@ -46,7 +46,7 @@ export const charts = applyFilters( REVENUE_REPORT_CHARTS_FILTER, [
? __(
'Returns include returned shipping and tax amounts.',
'woocommerce'
- )
+ )
: null,
},
{
@@ -68,7 +68,7 @@ export const charts = applyFilters( REVENUE_REPORT_CHARTS_FILTER, [
: __(
'Full refunds are not deducted from tax or net sales totals',
'woocommerce'
- ),
+ ),
},
{
key: 'taxes',
@@ -82,7 +82,7 @@ export const charts = applyFilters( REVENUE_REPORT_CHARTS_FILTER, [
: __(
'Full refunds are not deducted from tax or net sales totals',
'woocommerce'
- ),
+ ),
},
{
key: 'shipping',
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/stock/table.js b/plugins/woocommerce/client/admin/client/analytics/report/stock/table.js
index 33b8824e654..92473f7a072 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/stock/table.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/stock/table.js
@@ -128,7 +128,7 @@ class StockReportTable extends Component {
this.context.getCurrencyConfig(),
'number',
stockQuantity
- )
+ )
: __( 'N/A', 'woocommerce' ),
value: stockQuantity,
},
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/use-reports.js b/plugins/woocommerce/client/admin/client/analytics/report/use-reports.js
index 9b213f98e32..ef5ffff6741 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/use-reports.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/use-reports.js
@@ -12,39 +12,52 @@ import { getAdminSetting } from '~/utils/admin-settings';
import { useFilterHook } from '~/utils/use-filter-hook';
import { ScheduledUpdatesPromotionNotice } from '~/analytics/components';
-const RevenueReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-revenue" */ './revenue' )
+const RevenueReport = lazy(
+ () =>
+ import( /* webpackChunkName: "analytics-report-revenue" */ './revenue' )
);
-const ProductsReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-products" */ './products' )
+const ProductsReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report-products" */ './products'
+ )
);
-const VariationsReport = lazy( () =>
- import(
- /* webpackChunkName: "analytics-report-variations" */ './variations'
- )
+const VariationsReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report-variations" */ './variations'
+ )
);
-const OrdersReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-orders" */ './orders' )
+const OrdersReport = lazy(
+ () => import( /* webpackChunkName: "analytics-report-orders" */ './orders' )
);
-const CategoriesReport = lazy( () =>
- import(
- /* webpackChunkName: "analytics-report-categories" */ './categories'
- )
+const CategoriesReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report-categories" */ './categories'
+ )
);
-const CouponsReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-coupons" */ './coupons' )
+const CouponsReport = lazy(
+ () =>
+ import( /* webpackChunkName: "analytics-report-coupons" */ './coupons' )
);
-const TaxesReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-taxes" */ './taxes' )
+const TaxesReport = lazy(
+ () => import( /* webpackChunkName: "analytics-report-taxes" */ './taxes' )
);
-const DownloadsReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-downloads" */ './downloads' )
+const DownloadsReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report-downloads" */ './downloads'
+ )
);
-const StockReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-stock" */ './stock' )
+const StockReport = lazy(
+ () => import( /* webpackChunkName: "analytics-report-stock" */ './stock' )
);
-const CustomersReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report-customers" */ './customers' )
+const CustomersReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report-customers" */ './customers'
+ )
);
const manageStock = getAdminSetting( 'manageStock', 'no' );
@@ -116,7 +129,7 @@ const getReports = () => {
navArgs: {
id: 'woocommerce-analytics-stock',
},
- }
+ }
: null,
{
report: 'customers',
diff --git a/plugins/woocommerce/client/admin/client/analytics/report/variations/table.js b/plugins/woocommerce/client/admin/client/analytics/report/variations/table.js
index 6fb7f98afb4..664b7355d33 100644
--- a/plugins/woocommerce/client/admin/client/analytics/report/variations/table.js
+++ b/plugins/woocommerce/client/admin/client/analytics/report/variations/table.js
@@ -79,14 +79,14 @@ class VariationsReportTable extends Component {
? {
label: __( 'Status', 'woocommerce' ),
key: 'stock_status',
- }
+ }
: null,
manageStock === 'yes'
? {
label: __( 'Stock', 'woocommerce' ),
key: 'stock',
isNumeric: true,
- }
+ }
: null,
].filter( Boolean );
}
@@ -182,13 +182,13 @@ class VariationsReportTable extends Component {
stockStatuses[ stockStatus ]
),
value: stockStatuses[ stockStatus ],
- }
+ }
: null,
manageStock === 'yes'
? {
display: stockQuantity,
value: stockQuantity,
- }
+ }
: null,
].filter( Boolean );
} );
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 b445290949c..88ba0cb5853 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
@@ -118,17 +118,17 @@ function FailedOrdersNotice() {
const template =
overflowCount > 0
? /* translators: %d: number of failed orders currently stored (additional failures were dropped past the storage limit). <link> is a link to the order import log. */
- __(
+ __(
'More than %d orders failed to import. To recover all missed orders, run the import above with "Skip previously imported customers and orders" checked. <link>View the log</link> for details.',
'woocommerce'
- )
+ )
: /* translators: %d: number of failed orders. <link> is a link to the order import log. */
- _n(
+ _n(
'%d order failed to import. <link>View the log</link> for details.',
'%d orders failed to import. <link>View the log</link> for details.',
failedCount,
'woocommerce'
- );
+ );
const message = createInterpolateElement(
sprintf( template, failedCount ),
diff --git a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/layout.js b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/layout.js
index 8e49bc539d4..6bd44760060 100644
--- a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/layout.js
+++ b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/layout.js
@@ -147,11 +147,11 @@ export default withSelect( ( select, props ) => {
const hasImportFinished = Boolean(
inProgress &&
- ! cacheNeedsClearing &&
- isImporting === false &&
- ( customersTotal > 0 || ordersTotal > 0 ) &&
- customersProgress === customersTotal &&
- ordersProgress === ordersTotal
+ ! cacheNeedsClearing &&
+ isImporting === false &&
+ ( customersTotal > 0 || ordersTotal > 0 ) &&
+ customersProgress === customersTotal &&
+ ordersProgress === ordersTotal
);
let response = {
diff --git a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/progress.js b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/progress.js
index 44950d136f9..66976bbaf63 100644
--- a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/progress.js
+++ b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/progress.js
@@ -12,10 +12,10 @@ function HistoricalDataProgress( { label, progress, total } ) {
const labelCounters = ! isNil( total )
? /* translators: 1: progress, 2: total */
- sprintf( __( '%(progress)s of %(total)s', 'woocommerce' ), {
+ sprintf( __( '%(progress)s of %(total)s', 'woocommerce' ), {
progress: progress || 0,
total,
- } )
+ } )
: null;
return (
diff --git a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/status.js b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/status.js
index 9a409f25429..bf5321da98d 100644
--- a/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/status.js
+++ b/plugins/woocommerce/client/admin/client/analytics/settings/historical-data/status.js
@@ -54,7 +54,7 @@ function HistoricalDataStatus( { importDate, status } ) {
// @todo The date formatting should be localized ( 'll' ), but this is currently broken in Gutenberg.
// See https://github.com/WordPress/gutenberg/issues/12626 for details.
moment( importDate ).format( 'YYYY-MM-DD' )
- ),
+ ),
} );
return (
diff --git a/plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx b/plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx
index 8893a896e75..ae12ea6963f 100644
--- a/plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx
+++ b/plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx
@@ -281,7 +281,7 @@ export const fileUploadMachine = setup( {
hasSettingsToOverwrite: ( { context } ) =>
Boolean(
context.settings_to_overwrite &&
- context.settings_to_overwrite.length > 0
+ context.settings_to_overwrite.length > 0
),
},
} ).createMachine( {
diff --git a/plugins/woocommerce/client/admin/client/blueprint/settings/overwrite-confirmation-modal.tsx b/plugins/woocommerce/client/admin/client/blueprint/settings/overwrite-confirmation-modal.tsx
index 49eda97628c..f4038523cf9 100644
--- a/plugins/woocommerce/client/admin/client/blueprint/settings/overwrite-confirmation-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/blueprint/settings/overwrite-confirmation-modal.tsx
@@ -37,11 +37,11 @@ export const OverwriteConfirmationModal = ( {
? __(
'Importing the file will overwrite the current configuration for the following items in WooCommerce Settings:',
'woocommerce'
- )
+ )
: __(
'Importing the file will overwrite the current configuration in WooCommerce Settings.',
'woocommerce'
- ) }
+ ) }
</p>
<ul className="woocommerce-blueprint-overwrite-modal__list">
diff --git a/plugins/woocommerce/client/admin/client/components/tracked-link/tracked-link.tsx b/plugins/woocommerce/client/admin/client/components/tracked-link/tracked-link.tsx
index c7301955b58..7dc01c76fca 100644
--- a/plugins/woocommerce/client/admin/client/components/tracked-link/tracked-link.tsx
+++ b/plugins/woocommerce/client/admin/client/components/tracked-link/tracked-link.tsx
@@ -77,7 +77,7 @@ export const TrackedLink = ( {
? `${ linkText } (${ __(
'opens in a new tab',
'woocommerce'
- ) })`
+ ) })`
: undefined
}
/>
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/components/geolocation-country-select/geolocation-country-select.tsx b/plugins/woocommerce/client/admin/client/core-profiler/components/geolocation-country-select/geolocation-country-select.tsx
index 0dfd0ac5913..61153a64b33 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/components/geolocation-country-select/geolocation-country-select.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/components/geolocation-country-select/geolocation-country-select.tsx
@@ -67,8 +67,8 @@ export const GeolocationCountrySelect = ( {
useEffect( () => {
const overruled = Boolean(
geolocatedLocation &&
- getCountry( selectedCountry?.key ) !==
- getCountry( geolocationMatch?.key )
+ getCountry( selectedCountry?.key ) !==
+ getCountry( geolocationMatch?.key )
);
setGeolocationOverruled( overruled );
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/components/multiple-selector/multiple-selector.tsx b/plugins/woocommerce/client/admin/client/core-profiler/components/multiple-selector/multiple-selector.tsx
index f55f049026e..ac1691b3b21 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/components/multiple-selector/multiple-selector.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/components/multiple-selector/multiple-selector.tsx
@@ -94,7 +94,7 @@ export const MultipleSelector = ( {
? selectedOptions.filter(
( existingItem ) =>
existingItem.value !== item.value
- )
+ )
: [ ...selectedOptions, item ];
onSelect( updatedPlatforms );
} }
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/components/navigation/woologo.tsx b/plugins/woocommerce/client/admin/client/core-profiler/components/navigation/woologo.tsx
index 45e4a58899d..5a305c2afc9 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/components/navigation/woologo.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/components/navigation/woologo.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable max-len */
const WooLogo = () => {
return (
<svg
@@ -24,6 +23,5 @@ const WooLogo = () => {
</svg>
);
};
-/* eslint-enable max-len */
export default WooLogo;
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
index 4675c2e8c40..009e374b3a0 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
@@ -1839,7 +1839,6 @@ export const CoreProfilerController = ( {
inspect: xstateV5Inspector,
} );
- // eslint-disable-next-line react-hooks/exhaustive-deps -- false positive due to function name match, this isn't from react std lib
const currentNodeMeta = useSelector( service, ( currentState ) =>
findComponentMeta< ComponentMeta >(
currentState?.getMeta() ?? undefined
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/pages/BusinessInfo.tsx b/plugins/woocommerce/client/admin/client/core-profiler/pages/BusinessInfo.tsx
index 8c808873d8d..8e0cd6ca12c 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/pages/BusinessInfo.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/pages/BusinessInfo.tsx
@@ -161,7 +161,7 @@ export const BusinessInfo = ( {
? industryChoices.find(
( choice ) =>
choice.key === industryFromOnboardingProfile[ 0 ]
- )
+ )
: undefined
);
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/pages/Plugins/components/plugin-card/test/index.tsx b/plugins/woocommerce/client/admin/client/core-profiler/pages/Plugins/components/plugin-card/test/index.tsx
index 4a79407baeb..0319e1f29ba 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/pages/Plugins/components/plugin-card/test/index.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/pages/Plugins/components/plugin-card/test/index.tsx
@@ -28,8 +28,12 @@ describe( 'PluginCard', () => {
const description = queryByText( 'Plugin description' );
expect( title ).toBeInTheDocument();
expect( description ).toBeInTheDocument();
- if ( title ) fireEvent.click( title );
- if ( description ) fireEvent.click( description );
+ if ( title ) {
+ fireEvent.click( title );
+ }
+ if ( description ) {
+ fireEvent.click( description );
+ }
expect( onChange ).toHaveBeenCalledTimes( 2 );
} );
@@ -53,8 +57,12 @@ describe( 'PluginCard', () => {
expect( checkbox ).toBeDisabled();
const title = queryByText( 'Plugin title' );
const description = queryByText( 'Plugin description' );
- if ( title ) fireEvent.click( title );
- if ( description ) fireEvent.click( description );
+ if ( title ) {
+ fireEvent.click( title );
+ }
+ if ( description ) {
+ fireEvent.click( description );
+ }
expect( onChange ).not.toHaveBeenCalled();
} );
} );
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/pages/test/business-info.test.tsx b/plugins/woocommerce/client/admin/client/core-profiler/pages/test/business-info.test.tsx
index 0693c5457a1..a08b6e2d484 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/pages/test/business-info.test.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/pages/test/business-info.test.tsx
@@ -161,7 +161,7 @@ describe( 'BusinessInfo', () => {
).toHaveValue( 'Aruba' );
} );
- it( 'should correctly send event with empty form inputs when continue is clicked', () => {
+ it( 'should correctly send event with empty form inputs when continue is clicked', async () => {
props.context.geolocatedLocation = {
latitude: '-37.83961',
longitude: '144.94228',
@@ -174,7 +174,7 @@ describe( 'BusinessInfo', () => {
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
- userEvent.click( continueButton );
+ await userEvent.click( continueButton );
expect( props.sendEvent ).toHaveBeenCalledWith( {
payload: {
geolocationOverruled: false,
@@ -227,7 +227,7 @@ describe( 'BusinessInfo', () => {
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
- userEvent.click( continueButton );
+ await userEvent.click( continueButton );
expect( props.sendEvent ).toHaveBeenCalledWith( {
payload: {
geolocationOverruled: true,
@@ -254,7 +254,7 @@ describe( 'BusinessInfo', () => {
const storeNameInput = screen.getByRole( 'textbox', {
name: /Give your store a name/i,
} );
- userEvent.type( storeNameInput, 'Test Store Name' );
+ await userEvent.type( storeNameInput, 'Test Store Name' );
const industrySelector = screen.getByRole( 'combobox', {
name: /Select an industry/i,
} );
@@ -278,7 +278,7 @@ describe( 'BusinessInfo', () => {
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
- userEvent.click( continueButton );
+ await userEvent.click( continueButton );
expect( props.sendEvent ).toHaveBeenCalledWith( {
payload: {
geolocationOverruled: false,
@@ -292,7 +292,7 @@ describe( 'BusinessInfo', () => {
} );
} );
- it( 'should send the event with the correct values if the form has been pre-filled from context', () => {
+ it( 'should send the event with the correct values if the form has been pre-filled from context', async () => {
props.context.geolocatedLocation = {
latitude: '-37.83961',
longitude: '144.94228',
@@ -308,7 +308,7 @@ describe( 'BusinessInfo', () => {
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
- userEvent.click( continueButton );
+ await userEvent.click( continueButton );
expect( props.sendEvent ).toHaveBeenCalledWith( {
payload: {
geolocationOverruled: false,
@@ -333,36 +333,36 @@ describe( 'BusinessInfo', () => {
expect( continueButton ).not.toBeDisabled();
} );
- it( 'should disable the continue field when opt in checkbox is checked and email field is empty', () => {
+ it( 'should disable the continue field when opt in checkbox is checked and email field is empty', async () => {
props.context.businessInfo.location = 'AW';
props.context.onboardingProfile.is_store_country_set = true;
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
expect( continueButton ).toBeDisabled();
} );
- it( 'should correctly send event with opt-in true when opt in checkbox is checked and email field is filled', () => {
+ it( 'should correctly send event with opt-in true when opt in checkbox is checked and email field is filled', async () => {
props.context.businessInfo.location = 'AW';
props.context.onboardingProfile.is_store_country_set = true;
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'wordpress@automattic.com' );
+ await userEvent.type( emailInput, 'wordpress@automattic.com' );
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
- userEvent.click( continueButton );
+ await userEvent.click( continueButton );
expect( props.sendEvent ).toHaveBeenCalledWith( {
payload: {
geolocationOverruled: false,
@@ -406,48 +406,48 @@ describe( 'BusinessInfo', () => {
expect( emailInput ).toHaveValue( 'wordpress@automattic.com' );
} );
- it( 'should not show an error for invalid email if isOptInMarketing is false', () => {
+ it( 'should not show an error for invalid email if isOptInMarketing is false', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
expect(
screen.queryByText( /This email is not valid./i )
).not.toBeInTheDocument();
} );
- it( 'should validate the email field when isOptInMarketing is true', () => {
+ it( 'should validate the email field when isOptInMarketing is true', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
expect(
screen.getByText( /This email is not valid./i )
).toBeInTheDocument();
} );
- it( 'should not show an error for invalid email if isOptInMarketing is true and email is valid', () => {
+ it( 'should not show an error for invalid email if isOptInMarketing is true and email is valid', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'valid@email.com' );
+ await userEvent.type( emailInput, 'valid@email.com' );
} );
- it( 'should show an error for invalid email if isOptInMarketing is checked after the invalid email has already been filled out', () => {
+ it( 'should show an error for invalid email if isOptInMarketing is checked after the invalid email has already been filled out', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
expect(
@@ -456,55 +456,55 @@ describe( 'BusinessInfo', () => {
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
expect(
screen.getByText( /This email is not valid./i )
).toBeInTheDocument();
} );
- it( 'should hide the error after the invalid email has been corrected', () => {
+ it( 'should hide the error after the invalid email has been corrected', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
expect(
screen.getByText( /This email is not valid./i )
).toBeInTheDocument();
- userEvent.clear( emailInput );
- userEvent.type( emailInput, 'valid@email.com' );
+ await userEvent.clear( emailInput );
+ await userEvent.type( emailInput, 'valid@email.com' );
expect(
screen.queryByText( /This email is not valid./i )
).not.toBeInTheDocument();
} );
- it( 'should not allow the continue button to be pressed if email is invalid and isOptInMarketing is checked', () => {
+ it( 'should not allow the continue button to be pressed if email is invalid and isOptInMarketing is checked', async () => {
props.context.businessInfo.location = 'AW';
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
expect( continueButton ).toBeDisabled();
} );
- it( 'should allow the continue button to be pressed if email is invalid and isOptInMarketing is unchecked', () => {
+ it( 'should allow the continue button to be pressed if email is invalid and isOptInMarketing is unchecked', async () => {
props.context.businessInfo.location = 'AW';
props.context.onboardingProfile.is_store_country_set = true;
@@ -513,32 +513,32 @@ describe( 'BusinessInfo', () => {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'invalid email' );
+ await userEvent.type( emailInput, 'invalid email' );
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
expect( continueButton ).not.toBeDisabled();
} );
- it( 'should allow the continue button to be pressed if email is valid and isOptInMarketing is checked', () => {
+ it( 'should allow the continue button to be pressed if email is valid and isOptInMarketing is checked', async () => {
props.context.businessInfo.location = 'AW';
props.context.onboardingProfile.is_store_country_set = true;
render( <BusinessInfo { ...props } /> );
const checkbox = screen.getByRole( 'checkbox', {
name: /Get tips, discounts, and recommendations from Woo./i,
} );
- userEvent.click( checkbox );
+ await userEvent.click( checkbox );
const emailInput = screen.getByRole( 'textbox', {
name: /Your email address/i,
} );
- userEvent.type( emailInput, 'valid@email.com' );
+ await userEvent.type( emailInput, 'valid@email.com' );
const continueButton = screen.getByRole( 'button', {
name: /Continue/i,
} );
expect( continueButton ).not.toBeDisabled();
} );
- it( 'should link to the privacy policy and record a Tracks event when it is clicked', () => {
+ it( 'should link to the privacy policy and record a Tracks event when it is clicked', async () => {
render( <BusinessInfo { ...props } /> );
const link = screen.getByRole( 'link', {
name: 'Privacy Policy (opens in a new tab)',
@@ -547,7 +547,7 @@ describe( 'BusinessInfo', () => {
'href',
'https://automattic.com/privacy/'
);
- userEvent.click( link );
+ await userEvent.click( link );
expect( recordEvent ).toHaveBeenCalledWith(
'coreprofiler_business_info_privacy_policy_click',
{}
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/pages/test/intro-opt-in.test.tsx b/plugins/woocommerce/client/admin/client/core-profiler/pages/test/intro-opt-in.test.tsx
index 72d32b4f9ef..82f5b786691 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/pages/test/intro-opt-in.test.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/pages/test/intro-opt-in.test.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/ban-ts-comment */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/utils/get-loader-stage-meta.tsx b/plugins/woocommerce/client/admin/client/core-profiler/utils/get-loader-stage-meta.tsx
index 4ae66922587..73eaa5157c3 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/utils/get-loader-stage-meta.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/utils/get-loader-stage-meta.tsx
@@ -19,6 +19,7 @@ const LightbulbStage = {
image: <img src={ LightBulbImage } alt="loader-lightbulb" />,
paragraphs: [
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: __( '#FunWooFact: ', 'woocommerce' ),
text: __(
'Explore powerful extensions and themes at WooCommerce.com to enhance your store.',
@@ -26,6 +27,7 @@ const LightbulbStage = {
),
},
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: __( '#FunWooFact: ', 'woocommerce' ),
text: __(
'The Woo team is made up of over 350 talented individuals, distributed across 30+ countries.',
@@ -39,6 +41,7 @@ const LayoutStage = {
image: <img src={ LayoutImage } alt="loader-lightbulb" />,
paragraphs: [
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: __( '#FunWooFact: ', 'woocommerce' ),
text: __(
'Did you know that Woo powers almost 4 million stores worldwide? You’re in good company.',
@@ -53,6 +56,7 @@ const DevelopingStage = {
image: <img src={ DevelopingImage } alt="loader-developng" />,
paragraphs: [
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: __( '#FunWooFact: ', 'woocommerce' ),
text: __(
'Did you know that Woo was founded by two South Africans and a Norwegian? Here are three alternative ways to say “store” in those countries – Winkel, ivenkile, and butikk.',
@@ -67,7 +71,9 @@ const OpeningTheDoorsStage = {
image: <img src={ OpeningTheDoorsImage } alt="loader-opening-the-doors" />,
paragraphs: [
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
label: __( '#FunWooFact: ', 'woocommerce' ),
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
text: __( 'Our favorite color is purple ', 'woocommerce' ),
element: (
<img
diff --git a/plugins/woocommerce/client/admin/client/customize-store/site-hub/index.tsx b/plugins/woocommerce/client/admin/client/customize-store/site-hub/index.tsx
index 5d48692f800..989239fccf9 100644
--- a/plugins/woocommerce/client/admin/client/customize-store/site-hub/index.tsx
+++ b/plugins/woocommerce/client/admin/client/customize-store/site-hub/index.tsx
@@ -1,5 +1,5 @@
// Reference: https://github.com/WordPress/gutenberg/blob/v16.4.0/packages/edit-site/src/components/site-hub/index.js
-/* eslint-disable @typescript-eslint/ban-ts-comment */
+
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/admin/client/dashboard/default-sections.js b/plugins/woocommerce/client/admin/client/dashboard/default-sections.js
index c0f6ae52885..6d30c30f7a3 100644
--- a/plugins/woocommerce/client/admin/client/dashboard/default-sections.js
+++ b/plugins/woocommerce/client/admin/client/dashboard/default-sections.js
@@ -11,14 +11,20 @@ import ListOrdered from 'gridicons/dist/list-ordered';
/**
* Internal dependencies
*/
-const LazyDashboardCharts = lazy( () =>
- import( /* webpackChunkName: "dashboard-charts" */ './dashboard-charts' )
+const LazyDashboardCharts = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "dashboard-charts" */ './dashboard-charts'
+ )
);
-const LazyLeaderboards = lazy( () =>
- import( /* webpackChunkName: "leaderboards" */ './leaderboards' )
+const LazyLeaderboards = lazy(
+ () => import( /* webpackChunkName: "leaderboards" */ './leaderboards' )
);
-const LazyStorePerformance = lazy( () =>
- import( /* webpackChunkName: "store-performance" */ './store-performance' )
+const LazyStorePerformance = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "store-performance" */ './store-performance'
+ )
);
const DashboardCharts = ( props ) => (
diff --git a/plugins/woocommerce/client/admin/client/dashboard/index.js b/plugins/woocommerce/client/admin/client/dashboard/index.js
index 5be57e704a5..3523bab5a56 100644
--- a/plugins/woocommerce/client/admin/client/dashboard/index.js
+++ b/plugins/woocommerce/client/admin/client/dashboard/index.js
@@ -15,8 +15,11 @@ import {
import './style.scss';
import { ScheduledUpdatesPromotionNotice } from '~/analytics/components';
-const CustomizableDashboard = lazy( () =>
- import( /* webpackChunkName: "customizable-dashboard" */ './customizable' )
+const CustomizableDashboard = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "customizable-dashboard" */ './customizable'
+ )
);
class Dashboard extends Component {
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 a4caafc7cdf..9039f099ec2 100644
--- a/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx
+++ b/plugins/woocommerce/client/admin/client/guided-tours/shipping-tour.tsx
@@ -372,6 +372,7 @@ export const ShippingTour = ( {
name: 'shipping-recommendations',
heading: __( 'WooCommerce Shipping', 'woocommerce' ),
descriptions: {
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
desktop: __(
'If you’d like to speed up your process and print your shipping label straight from your Woo dashboard, WooCommerce Shipping may be for you! ',
'woocommerce'
diff --git a/plugins/woocommerce/client/admin/client/header/use-wp-admin-chrome.ts b/plugins/woocommerce/client/admin/client/header/use-wp-admin-chrome.ts
index 8b6240a2efa..66702ae043f 100644
--- a/plugins/woocommerce/client/admin/client/header/use-wp-admin-chrome.ts
+++ b/plugins/woocommerce/client/admin/client/header/use-wp-admin-chrome.ts
@@ -121,8 +121,12 @@ export const useWpAdminChrome = (
attributes: true,
attributeFilter: [ 'aria-expanded' ],
};
- if ( screenOptBtn ) observer.observe( screenOptBtn, opts );
- if ( helpBtn ) observer.observe( helpBtn, opts );
+ if ( screenOptBtn ) {
+ observer.observe( screenOptBtn, opts );
+ }
+ if ( helpBtn ) {
+ observer.observe( helpBtn, opts );
+ }
return () => observer.disconnect();
}, [ hasScreenOptions, hasContextualHelp ] );
diff --git a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/index.js b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/index.js
index b313d5ac499..68d84051001 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/index.js
+++ b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/index.js
@@ -97,7 +97,7 @@ function renderOrders( orders, customers, getFormattedOrderTotal ) {
? getNewPath( {}, '/analytics/customers', {
filter: 'single_customer',
customers: customer.id,
- } )
+ } )
: getAdminLink( 'user-edit.php?user_id=' + customer.id );
}
@@ -277,7 +277,6 @@ function OrdersPanel( { unreadOrdersCount, orderStatuses } ) {
return { isRequesting: false };
}
- /* eslint-disable @wordpress/no-unused-vars-before-return */
const actionableOrders = getOrders( actionableOrdersQuery, null );
const isRequestingActionable = hasFinishedResolution( 'getOrders', [
diff --git a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/test/index.js b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/test/index.js
index 7515eedb7c2..972c4e68798 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/test/index.js
+++ b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/orders/test/index.js
@@ -50,7 +50,7 @@ describe( 'OrdersPanel', () => {
).toBeInTheDocument();
} );
- it( 'should record activity_panel_orders_orders_begin_fulfillment Tracks event when order is clicked', () => {
+ it( 'should record activity_panel_orders_orders_begin_fulfillment Tracks event when order is clicked', async () => {
useSelect.mockReturnValue( {
orders: [
{
@@ -65,7 +65,7 @@ describe( 'OrdersPanel', () => {
const { getByText } = render(
<OrdersPanel orderStatuses={ [] } unreadOrdersCount={ 1 } />
);
- userEvent.click( getByText( '0 products' ) );
+ await userEvent.click( getByText( '0 products' ) );
expect( recordEvent ).toHaveBeenCalledWith(
'activity_panel_orders_orders_begin_fulfillment',
{}
diff --git a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/card.js b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/card.js
index fc76262d5e7..ec2fdfefb2d 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/card.js
+++ b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/card.js
@@ -207,7 +207,7 @@ export class ProductStockCard extends Component {
/* translators: %s = time since last product order. e.g.: "10 minutes ago" - translated. */
__( 'Last ordered %s', 'woocommerce' ),
moment.utc( product.last_order_date ).fromNow()
- )
+ )
: null;
// Hide cards that are not in low stock and have not been edited.
diff --git a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/test/index.js b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/test/index.js
index c01a2b62fef..bad4b075a3e 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/test/index.js
+++ b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/stock/test/index.js
@@ -56,9 +56,11 @@ describe( 'StockPanel', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: 'Update stock' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Update stock' } )
+ );
// Number input gets "spinbutton", apparently.
- userEvent.type( getByRole( 'spinbutton' ), '3' );
+ await userEvent.type( getByRole( 'spinbutton' ), '3' );
fireEvent.submit( getByRole( 'button', { name: 'Save' } ) );
await waitFor( () => {
@@ -93,7 +95,9 @@ describe( 'StockPanel', () => {
createNotice={ createNotice }
/>
);
- userEvent.click( getByRole( 'button', { name: 'Update stock' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Update stock' } )
+ );
expect( recordEvent ).toHaveBeenCalledWith(
'activity_panel_stock_update_stock',
{}
diff --git a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/test/index.js b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/test/index.js
index bfbafa936c7..e89ee185842 100644
--- a/plugins/woocommerce/client/admin/client/homescreen/activity-panel/test/index.js
+++ b/plugins/woocommerce/client/admin/client/homescreen/activity-panel/test/index.js
@@ -85,12 +85,12 @@ describe( 'ActivityPanel', () => {
expect( screen.queryByText( 'custom-panel-2' ) ).toBeNull();
} );
- it( 'should record activity_panel_open Tracks event when panel is opened', () => {
+ it( 'should record activity_panel_open Tracks event when panel is opened', async () => {
useSelect.mockReturnValue( {
isTaskListHidden: false,
} );
const { getByText } = render( <ActivityPanel /> );
- userEvent.click( getByText( 'custom-panel-2' ) );
+ await userEvent.click( getByText( 'custom-panel-2' ) );
expect( recordEvent ).toHaveBeenCalledWith( 'activity_panel_open', {
tab: 'custom-panel-2',
} );
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 a80fc2d71ae..34938f40b99 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
@@ -192,7 +192,7 @@ export const QRLoginNumberMatchStep = ( {
/* translators: %d: seconds remaining before the challenge expires. */
__( 'Expires in %ds', 'woocommerce' ),
secondsRemaining
- ) }
+ ) }
</p>
{ errorMessage && (
diff --git a/plugins/woocommerce/client/admin/client/hooks/test/use-tasklists-state.test.ts b/plugins/woocommerce/client/admin/client/hooks/test/use-tasklists-state.test.ts
index a3db1ca7a9d..b5e0967ff8d 100644
--- a/plugins/woocommerce/client/admin/client/hooks/test/use-tasklists-state.test.ts
+++ b/plugins/woocommerce/client/admin/client/hooks/test/use-tasklists-state.test.ts
@@ -77,16 +77,24 @@ describe( 'useTaskListsState', () => {
} ) )
);
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' ) return [];
- if ( setting === 'completedTaskListIds' ) return [];
+ if ( setting === 'visibleTaskListIds' ) {
+ return [];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
} );
it( 'should return default state when no task lists are visible', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' ) return [];
- if ( setting === 'completedTaskListIds' ) return [];
+ if ( setting === 'visibleTaskListIds' ) {
+ return [];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
@@ -105,8 +113,12 @@ describe( 'useTaskListsState', () => {
it( 'should return setup task list state when only setup is visible and not completed', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' ) return [ 'setup' ];
- if ( setting === 'completedTaskListIds' ) return [];
+ if ( setting === 'visibleTaskListIds' ) {
+ return [ 'setup' ];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
@@ -131,8 +143,12 @@ describe( 'useTaskListsState', () => {
it( 'should return extended task list state when only extended is visible and not completed', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' ) return [ 'extended' ];
- if ( setting === 'completedTaskListIds' ) return [];
+ if ( setting === 'visibleTaskListIds' ) {
+ return [ 'extended' ];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
@@ -162,9 +178,12 @@ describe( 'useTaskListsState', () => {
it( 'should return full state when both task lists are visible and not completed', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' )
+ if ( setting === 'visibleTaskListIds' ) {
return [ 'setup', 'extended' ];
- if ( setting === 'completedTaskListIds' ) return [];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
@@ -190,9 +209,12 @@ describe( 'useTaskListsState', () => {
it( 'should handle loading state correctly', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' )
+ if ( setting === 'visibleTaskListIds' ) {
return [ 'setup', 'extended' ];
- if ( setting === 'completedTaskListIds' ) return [];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
@@ -209,9 +231,12 @@ describe( 'useTaskListsState', () => {
it( 'should handle completed task lists correctly', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' )
+ if ( setting === 'visibleTaskListIds' ) {
return [ 'setup', 'extended' ];
- if ( setting === 'completedTaskListIds' ) return [ 'setup' ];
+ }
+ if ( setting === 'completedTaskListIds' ) {
+ return [ 'setup' ];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
@@ -239,10 +264,12 @@ describe( 'useTaskListsState', () => {
it( 'should respect the options parameter when task lists are completed', () => {
( getAdminSetting as jest.Mock ).mockImplementation( ( setting ) => {
- if ( setting === 'visibleTaskListIds' )
+ if ( setting === 'visibleTaskListIds' ) {
return [ 'setup', 'extended' ];
- if ( setting === 'completedTaskListIds' )
+ }
+ if ( setting === 'completedTaskListIds' ) {
return [ 'setup', 'extended' ];
+ }
return [];
} );
( useSelect as jest.Mock ).mockImplementation( ( callback ) =>
diff --git a/plugins/woocommerce/client/admin/client/hooks/useFocusOutside.js b/plugins/woocommerce/client/admin/client/hooks/useFocusOutside.js
index f7395b4f9e2..649b5a9bbd6 100644
--- a/plugins/woocommerce/client/admin/client/hooks/useFocusOutside.js
+++ b/plugins/woocommerce/client/admin/client/hooks/useFocusOutside.js
@@ -17,7 +17,7 @@ const INPUT_BUTTON_TYPES = [ 'button', 'submit' ];
*/
// Disable reason: Rule doesn't support predicate return types
-/* eslint-disable jsdoc/valid-types */
+
/**
* Returns true if the given element is a button element subject to focus
* normalization, or false otherwise.
@@ -46,7 +46,6 @@ function isFocusNormalizedButton( eventTarget ) {
return false;
}
-/* eslint-enable jsdoc/valid-types */
/**
* @typedef {import('react').SyntheticEvent} SyntheticEvent
diff --git a/plugins/woocommerce/client/admin/client/inbox-panel/index.js b/plugins/woocommerce/client/admin/client/inbox-panel/index.js
index a3058a28132..9f6292e356b 100644
--- a/plugins/woocommerce/client/admin/client/inbox-panel/index.js
+++ b/plugins/woocommerce/client/admin/client/inbox-panel/index.js
@@ -204,7 +204,7 @@ const renderNotes = ( {
</Button>
</CardFooter>
);
- } )() }
+ } )() }
</Card>
);
};
diff --git a/plugins/woocommerce/client/admin/client/inbox-panel/test/index.js b/plugins/woocommerce/client/admin/client/inbox-panel/test/index.js
index f6cd8f84419..9ebf9f4d41f 100644
--- a/plugins/woocommerce/client/admin/client/inbox-panel/test/index.js
+++ b/plugins/woocommerce/client/admin/client/inbox-panel/test/index.js
@@ -221,7 +221,7 @@ describe( 'inbox_note_view event', () => {
} );
describe( 'inbox_action_click event', () => {
- test( 'should fire tracks event when inboxNoteCard fires onBodyLinkClick', () => {
+ test( 'should fire tracks event when inboxNoteCard fires onBodyLinkClick', async () => {
useSelect.mockImplementation( () => ( {
notes: NOTES,
isError: false,
@@ -237,7 +237,7 @@ describe( 'inbox_action_click event', () => {
} );
const { getAllByText } = render( <InboxPanel /> );
const buttons = getAllByText( 'Trigger action' );
- userEvent.click( buttons[ 0 ] );
+ await userEvent.click( buttons[ 0 ] );
expect( recordEvent ).toHaveBeenCalledWith( 'inbox_action_click', {
note_name: NOTES[ 0 ].name,
note_title: NOTES[ 0 ].title,
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/components/resizable-frame.jsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/components/resizable-frame.jsx
index b36045fd1da..c1d4df06370 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/components/resizable-frame.jsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/components/resizable-frame.jsx
@@ -204,7 +204,7 @@ function ResizableFrame( {
const resizeHandler = (
/* Disable reason: role="separator" does in fact support aria-valuenow */
- /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */
+
<motion.button
key="handle"
role="separator"
@@ -248,8 +248,9 @@ function ResizableFrame( {
variants={ frameAnimationVariants }
animate={ isFullWidth ? 'fullWidth' : 'default' }
onAnimationComplete={ ( definition ) => {
- if ( definition === 'fullWidth' )
+ if ( definition === 'fullWidth' ) {
setFrameSize( { width: '100%', height: '100%' } );
+ }
} }
transition={ frameTransition }
size={ frameSize }
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/Survey.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/Survey.tsx
index e332f6b0d7b..227bbb824c0 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/Survey.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/Survey.tsx
@@ -26,9 +26,8 @@ export const LysSurvey = ( {
const [ score, setScore ] = useState< number | null >( null );
const [ feedbackText, setFeedbackText ] = useState< string >( '' );
const [ isShowThanks, setIsShowThanks ] = useState< boolean >( false );
- const [ isShowSurvey, setIsShowSurvey ] = useState< boolean >(
- ! hasCompleteSurvey
- );
+ const [ isShowSurvey, setIsShowSurvey ] =
+ useState< boolean >( ! hasCompleteSurvey );
const shouldShowComment = isInteger( score );
const sendData = () => {
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/index.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/index.tsx
index bff7bb2d1d6..2f426a00475 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/index.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/main-content/pages/launch-store-success/index.tsx
@@ -119,11 +119,11 @@ export const LaunchYourStoreSuccess = ( {
? __(
'Congratulations! Your store will launch soon',
'woocommerce'
- )
+ )
: __(
'Congratulations! Your store is now live',
'woocommerce'
- ) }
+ ) }
</h1>
<h2 className="woocommerce-launch-store__congrats-subheading">
{ siteIsShowingCachedContent
@@ -146,11 +146,11 @@ export const LaunchYourStoreSuccess = ( {
</a>
),
}
- )
+ )
: __(
'You’ve successfully launched your store and are ready to start selling! We can’t wait to see your business grow.',
'woocommerce'
- ) }
+ ) }
</h2>
<div className="woocommerce-launch-store__congrats-midsection-container">
<div className="woocommerce-launch-store__congrats-visit-store">
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/launch-store-hub.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/launch-store-hub.tsx
index b2079b64142..8b84ee65a35 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/launch-store-hub.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/components/launch-store-hub.tsx
@@ -168,10 +168,13 @@ export const LaunchYourStoreHubSidebar = ( props: SidebarComponentProps ) => {
onChange={ setRemoveTestOrder }
/>
<p>
- { __(
- 'Remove test orders and associated data, including analytics and transactions, once your store goes live. ',
- 'woocommerce'
- ) }
+ {
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __(
+ 'Remove test orders and associated data, including analytics and transactions, once your store goes live. ',
+ 'woocommerce'
+ )
+ }
</p>
</ItemGroup>
</>
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 7fba53aa648..299b542a1fe 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
@@ -158,9 +158,12 @@ export const PaymentsSidebar = ( props: SidebarComponentProps ) => {
>
{ payments_task?.additionalData?.wooPaymentsIsInstalled
? /* translators: %s: WooPayments */
- sprintf( __( 'Enable %s', 'woocommerce' ), 'WooPayments' )
+ sprintf( __( 'Enable %s', 'woocommerce' ), 'WooPayments' )
: /* translators: %s: WooPayments */
- sprintf( __( 'Install %s', 'woocommerce' ), 'WooPayments' ) }
+ sprintf(
+ __( 'Install %s', 'woocommerce' ),
+ 'WooPayments'
+ ) }
</SidebarNavigationItem>
);
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/tasklist.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/tasklist.tsx
index 733ddba112f..a9d40d574d6 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/tasklist.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/tasklist.tsx
@@ -49,7 +49,6 @@ export const getLysTasklist = async () => {
*
* @filter woocommerce_launch_your_store_tasklist_whitelist
* @param {string[]} LYS_TASKS_WHITELIST Default list of task IDs to show in LYS.
- *
*/
const filteredTasks = applyFilters(
'woocommerce_launch_your_store_tasklist_whitelist',
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/xstate.tsx b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/xstate.tsx
index 8189eafd1b9..e9706a2f90c 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/xstate.tsx
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/hub/sidebar/xstate.tsx
@@ -217,8 +217,8 @@ const recordStoreLaunchAttempt = ( {
.filter( ( task ) => task.isComplete )
.map( ( task ) => task.id ) || [];
- const tasks_completed_in_lys = completed.filter(
- ( task ) => context.tasklist?.recentlyActionedTasks.includes( task )
+ const tasks_completed_in_lys = completed.filter( ( task ) =>
+ context.tasklist?.recentlyActionedTasks.includes( task )
); // recently actioned tasks can include incomplete tasks
recordEvent( 'launch_your_store_hub_store_launch_attempted', {
diff --git a/plugins/woocommerce/client/admin/client/launch-your-store/settings/slotfill.js b/plugins/woocommerce/client/admin/client/launch-your-store/settings/slotfill.js
index 19216cd68cb..d90fb32b05e 100644
--- a/plugins/woocommerce/client/admin/client/launch-your-store/settings/slotfill.js
+++ b/plugins/woocommerce/client/admin/client/launch-your-store/settings/slotfill.js
@@ -209,15 +209,15 @@ const SiteVisibility = () => {
href: comingSoonTemplateId
? getAdminLink(
`site-editor.php?postType=wp_template&postId=${ comingSoonTemplateId }&canvas=edit`
- )
+ )
: getAdminLink( 'site-editor.php' ),
} ),
}
- )
+ )
: __(
'Your site is hidden from visitors behind a “Coming soon” landing page until it’s ready for viewing.',
'woocommerce'
- ) }
+ ) }
</p>
<div
className={ clsx(
diff --git a/plugins/woocommerce/client/admin/client/layout/controller.js b/plugins/woocommerce/client/admin/client/layout/controller.js
index 15d45da1a95..1b57d91315f 100644
--- a/plugins/woocommerce/client/admin/client/layout/controller.js
+++ b/plugins/woocommerce/client/admin/client/layout/controller.js
@@ -27,49 +27,62 @@ import { useFilterHook } from '~/utils/use-filter-hook';
import { NoMatch } from './NoMatch';
import { isFeatureEnabled } from '~/utils/features';
-const AnalyticsReport = lazy( () =>
- import( /* webpackChunkName: "analytics-report" */ '../analytics/report' )
+const AnalyticsReport = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-report" */ '../analytics/report'
+ )
);
-const AnalyticsSettings = lazy( () =>
- import(
- /* webpackChunkName: "analytics-settings" */ '../analytics/settings'
- )
+const AnalyticsSettings = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "analytics-settings" */ '../analytics/settings'
+ )
);
-const Dashboard = lazy( () =>
- import( /* webpackChunkName: "dashboard" */ '../dashboard' )
+const Dashboard = lazy(
+ () => import( /* webpackChunkName: "dashboard" */ '../dashboard' )
);
-const Homescreen = lazy( () =>
- import( /* webpackChunkName: "homescreen" */ '../homescreen' )
+const Homescreen = lazy(
+ () => import( /* webpackChunkName: "homescreen" */ '../homescreen' )
);
-const MarketingOverviewMultichannel = lazy( () =>
- import(
- /* webpackChunkName: "multichannel-marketing" */ '../marketing/overview-multichannel'
- )
+const MarketingOverviewMultichannel = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "multichannel-marketing" */ '../marketing/overview-multichannel'
+ )
);
-const Marketplace = lazy( () =>
- import( /* webpackChunkName: "marketplace" */ '../marketplace' )
+const Marketplace = lazy(
+ () => import( /* webpackChunkName: "marketplace" */ '../marketplace' )
);
-const CoreProfiler = lazy( () =>
- import( /* webpackChunkName: "core-profiler" */ '../core-profiler' )
+const CoreProfiler = lazy(
+ () => import( /* webpackChunkName: "core-profiler" */ '../core-profiler' )
);
-const WCPaymentsWelcomePage = lazy( () =>
- import(
- /* webpackChunkName: "wcpay-payment-welcome-page" */ '../payments-welcome'
- )
+const WCPaymentsWelcomePage = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "wcpay-payment-welcome-page" */ '../payments-welcome'
+ )
);
-const CustomizeStore = lazy( () =>
- import( /* webpackChunkName: "customize-store" */ '../customize-store' )
+const CustomizeStore = lazy(
+ () =>
+ import( /* webpackChunkName: "customize-store" */ '../customize-store' )
);
-const LaunchStore = lazy( () =>
- import( /* webpackChunkName: "launch-store" */ '../launch-your-store/hub' )
+const LaunchStore = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "launch-store" */ '../launch-your-store/hub'
+ )
);
-const MobileAppLoginPage = lazy( () =>
- import( /* webpackChunkName: "mobile-app-login" */ '../mobile-app-login' )
+const MobileAppLoginPage = lazy(
+ () =>
+ import(
+ /* webpackChunkName: "mobile-app-login" */ '../mobile-app-login'
+ )
);
export const PAGES_FILTER = 'woocommerce_admin_pages_list';
@@ -517,7 +530,7 @@ window.wpNavMenuClassChange = function ( page, url ) {
parentPath === '/'
? 'admin.php?page=wc-admin'
: 'admin.php?page=wc-admin&path=' +
- encodeURIComponent( parentPath );
+ encodeURIComponent( parentPath );
currentItemsSelector += `, li > a[href*="${ parentPageUrl }"]`;
}
diff --git a/plugins/woocommerce/client/admin/client/layout/embed.tsx b/plugins/woocommerce/client/admin/client/layout/embed.tsx
index c6c7c1735a6..3245a72e514 100644
--- a/plugins/woocommerce/client/admin/client/layout/embed.tsx
+++ b/plugins/woocommerce/client/admin/client/layout/embed.tsx
@@ -72,7 +72,7 @@ export const EmbedLayout = compose(
getAdminSetting( 'preloadOptions' )
? withOptionsHydration( {
...getAdminSetting( 'preloadOptions' ),
- } )
+ } )
: identity,
withPluginsHydration( {
...getAdminSetting( 'plugins', {} ),
diff --git a/plugins/woocommerce/client/admin/client/layout/index.tsx b/plugins/woocommerce/client/admin/client/layout/index.tsx
index 83ac814148f..d5395d411e7 100644
--- a/plugins/woocommerce/client/admin/client/layout/index.tsx
+++ b/plugins/woocommerce/client/admin/client/layout/index.tsx
@@ -227,7 +227,7 @@ export const Layout = compose(
window.wcSettings.admin
? withOptionsHydration( {
...getAdminSetting( 'preloadOptions', {} ),
- } )
+ } )
: identity,
withPluginsHydration( {
...getAdminSetting( 'plugins', {} ),
diff --git a/plugins/woocommerce/client/admin/client/marketing/components/CreateNewCampaignModal/CreateNewCampaignModal.tsx b/plugins/woocommerce/client/admin/client/marketing/components/CreateNewCampaignModal/CreateNewCampaignModal.tsx
index 9bad7d1f1d7..7ed8b751554 100644
--- a/plugins/woocommerce/client/admin/client/marketing/components/CreateNewCampaignModal/CreateNewCampaignModal.tsx
+++ b/plugins/woocommerce/client/admin/client/marketing/components/CreateNewCampaignModal/CreateNewCampaignModal.tsx
@@ -74,7 +74,7 @@ export const CreateNewCampaignModal = ( props: CreateCampaignModalProps ) => {
? __(
'Where would you like to promote your products?',
'woocommerce'
- )
+ )
: __( 'No campaign types found.', 'woocommerce' ) }
</div>
{ campaignTypes?.map( ( el ) => (
diff --git a/plugins/woocommerce/client/admin/client/marketing/coupons/knowledge-base/test/index.js b/plugins/woocommerce/client/admin/client/marketing/coupons/knowledge-base/test/index.js
index 697e7815f18..9d913a5e098 100644
--- a/plugins/woocommerce/client/admin/client/marketing/coupons/knowledge-base/test/index.js
+++ b/plugins/woocommerce/client/admin/client/marketing/coupons/knowledge-base/test/index.js
@@ -298,7 +298,7 @@ describe( 'No posts and not loading', () => {
describe( 'Clicking on a post', () => {
afterAll( () => jest.clearAllMocks() );
- it( 'should record an event when clicked', () => {
+ it( 'should record an event when clicked', async () => {
const { getByRole } = render(
<KnowledgeBase
posts={ mockPosts }
@@ -307,7 +307,7 @@ describe( 'Clicking on a post', () => {
/>
);
- userEvent.click( getByRole( 'link', { name: /Post 1/ } ) );
+ await userEvent.click( getByRole( 'link', { name: /Post 1/ } ) );
expect( recordEvent ).toHaveBeenCalledTimes( 1 );
expect( recordEvent ).toHaveBeenCalledWith(
@@ -317,7 +317,7 @@ describe( 'Clicking on a post', () => {
}
);
- userEvent.click( getByRole( 'link', { name: /Post 2/ } ) );
+ await userEvent.click( getByRole( 'link', { name: /Post 2/ } ) );
expect( recordEvent ).toHaveBeenCalledTimes( 2 );
expect( recordEvent ).toHaveBeenCalledWith(
@@ -341,7 +341,7 @@ describe( 'Pagination', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByLabelText( 'Next Page', { selector: 'button' } )
);
@@ -362,7 +362,7 @@ describe( 'Pagination', () => {
}
);
- userEvent.click(
+ await userEvent.click(
getByLabelText( 'Previous Page', { selector: 'button' } )
);
diff --git a/plugins/woocommerce/client/admin/client/marketing/coupons/recommended-extensions/test/index.js b/plugins/woocommerce/client/admin/client/marketing/coupons/recommended-extensions/test/index.js
index 7b44a6ca1ce..e6350cfeeb2 100644
--- a/plugins/woocommerce/client/admin/client/marketing/coupons/recommended-extensions/test/index.js
+++ b/plugins/woocommerce/client/admin/client/marketing/coupons/recommended-extensions/test/index.js
@@ -154,7 +154,7 @@ describe( 'No Recommendations and not loading', () => {
} );
describe( 'Click Recommendations', () => {
- it( 'should record an event when clicked', () => {
+ it( 'should record an event when clicked', async () => {
const { getByRole } = render(
<RecommendedExtensionsItem
title={ 'AutomateWoo' }
@@ -166,7 +166,7 @@ describe( 'Click Recommendations', () => {
/>
);
- userEvent.click( getByRole( 'link' ) );
+ await userEvent.click( getByRole( 'link' ) );
expect( recordEvent ).toHaveBeenCalledTimes( 1 );
expect( recordEvent ).toHaveBeenCalledWith(
diff --git a/plugins/woocommerce/client/admin/client/marketing/data-multichannel/reducer.ts b/plugins/woocommerce/client/admin/client/marketing/data-multichannel/reducer.ts
index c5d4d946fae..e2f15e6848c 100644
--- a/plugins/woocommerce/client/admin/client/marketing/data-multichannel/reducer.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/data-multichannel/reducer.ts
@@ -78,10 +78,10 @@ export const reducer: Reducer< State, Action > = (
[ key ]: action.error
? {
error: action.payload,
- }
+ }
: {
data: action.payload,
- },
+ },
},
meta: {
total: meta.total,
@@ -95,10 +95,10 @@ export const reducer: Reducer< State, Action > = (
campaignTypes: action.error
? {
error: action.payload,
- }
+ }
: {
data: action.payload,
- },
+ },
};
default:
diff --git a/plugins/woocommerce/client/admin/client/marketing/hooks/test/useCampaigns.test.ts b/plugins/woocommerce/client/admin/client/marketing/hooks/test/useCampaigns.test.ts
index db17a0de192..b604bf5d44f 100644
--- a/plugins/woocommerce/client/admin/client/marketing/hooks/test/useCampaigns.test.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/hooks/test/useCampaigns.test.ts
@@ -4,7 +4,7 @@
import { renderHook } from '@testing-library/react-hooks/dom';
import { waitFor } from '@testing-library/react';
import { dispatch } from '@wordpress/data';
-import 'whatwg-fetch'; /* eslint-disable-line import/no-unresolved */ /* To make sure Response is available */
+import 'whatwg-fetch'; /* To make sure Response is available */
/**
* Internal dependencies
diff --git a/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts b/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
index 766fa112c37..0b77dcb1b48 100644
--- a/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
+++ b/plugins/woocommerce/client/admin/client/marketing/hooks/useRegisteredChannels.ts
@@ -41,7 +41,7 @@ const convert = ( data: APIRegisteredChannel ): RegisteredChannel => {
// translators: %d: The number of issues to resolve.
__( '%d issues to resolve', 'woocommerce' ),
data.errors_count
- )
+ )
: __( 'No issues to resolve', 'woocommerce' );
return {
diff --git a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx
index 57b505e4a3f..1740fca9f76 100644
--- a/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx
+++ b/plugins/woocommerce/client/admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx
@@ -91,10 +91,13 @@ export const Campaigns = () => {
{ __( 'An unexpected error occurred.', 'woocommerce' ) }
</div>
<div className="woocommerce-marketing-campaigns-card-body__content-description">
- { __(
- 'Please try again later. Check the logs if the problem persists. ',
- 'woocommerce'
- ) }
+ {
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __(
+ 'Please try again later. Check the logs if the problem persists. ',
+ 'woocommerce'
+ )
+ }
</div>
</CardBody>
);
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/banner/banner.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/banner/banner.tsx
index b936a6bb7e7..9e187d9f691 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/banner/banner.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/banner/banner.tsx
@@ -92,7 +92,9 @@ export default function ProductFeaturedBanner() {
}
};
- if ( isDismissed ) return null;
+ if ( isDismissed ) {
+ return null;
+ }
return (
<div
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/content/content.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/content/content.tsx
index e0c16da2ae6..f3b58cd3649 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/content/content.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/content/content.tsx
@@ -319,9 +319,7 @@ export default function Content(): React.JSX.Element {
} );
const tab = query.tab as
- | 'extensions'
- | 'themes'
- | 'business-services';
+ 'extensions' | 'themes' | 'business-services';
recordSearchFinishedEvent( resultsCounts[ tab ] );
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/create-order.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/create-order.tsx
index ec52148e66b..5e2438d582c 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/create-order.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/install-flow/create-order.tsx
@@ -23,8 +23,7 @@ type CreateOrderErrorResponse = {
};
type CreateOrderResponse =
- | CreateOrderSuccessResponse
- | CreateOrderErrorResponse;
+ CreateOrderSuccessResponse | CreateOrderErrorResponse;
function createOrder( productId: number ): Promise< CreateOrderResponse > {
return apiFetch( {
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 ce9c54eb3de..f60d67fc413 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
@@ -23,15 +23,15 @@ import { getAdminSetting } from '../../../utils/admin-settings';
import { MarketplaceContext } from '../../contexts/marketplace-context';
enum InstallFlowStatus {
- 'notConnected',
- 'notInstalled',
- 'installing',
- 'installedCanActivate',
- 'installedCannotActivate',
- 'installFailed',
- 'activating',
- 'activated',
- 'activationFailed',
+ notConnected,
+ notInstalled,
+ installing,
+ installedCanActivate,
+ installedCannotActivate,
+ installFailed,
+ activating,
+ activated,
+ activationFailed,
}
function InstallNewProductModal( props: { products: Product[] } ) {
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/connect-button.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/connect-button.tsx
index 7d2a0c3989f..51965dd591c 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/connect-button.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/connect-button.tsx
@@ -114,7 +114,7 @@ export default function ConnectButton( props: ConnectProps ) {
connect();
},
},
- ];
+ ];
addNotice(
props.subscription.product_key,
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install-modal.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install-modal.tsx
index 98bb8e760ec..5d56af3d411 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/actions/install-modal.tsx
@@ -123,11 +123,11 @@ export default function InstallModal() {
? __(
'Keep the momentum going and start setting up your extension.',
'woocommerce'
- )
+ )
: __(
'Would you like to install this extension?',
'woocommerce'
- );
+ );
return (
<>
<p className="woocommerce-marketplace__header-account-modal-text">
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/rows/auto-update-status.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/rows/auto-update-status.tsx
index 48aae7c0c69..032741e27b6 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/rows/auto-update-status.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/my-subscriptions/table/rows/auto-update-status.tsx
@@ -114,9 +114,9 @@ export default function AutoUpdateStatus( props: {
.then( () => {
const announcement = enabled
? /* translators: %s is the product name. */
- __( 'Auto-updates enabled for %s.', 'woocommerce' )
+ __( 'Auto-updates enabled for %s.', 'woocommerce' )
: /* translators: %s is the product name. */
- __( 'Auto-updates disabled for %s.', 'woocommerce' );
+ __( 'Auto-updates disabled for %s.', 'woocommerce' );
speak( sprintf( announcement, subscription.product_name ) );
@@ -139,7 +139,7 @@ export default function AutoUpdateStatus( props: {
: __(
'Auto-updates could not be disabled.',
'woocommerce'
- );
+ );
// The endpoint answers with wp_send_json_error(), which nests the reason under data.
const reason = error?.data?.message;
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/notice/notice.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/notice/notice.tsx
index 0e2ae3b21d0..87b2e67e559 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/notice/notice.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/notice/notice.tsx
@@ -64,7 +64,9 @@ export default function Notice( props: NoticeProps ): React.JSX.Element | null {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ isVisible ] );
- if ( ! isVisible ) return null;
+ if ( ! isVisible ) {
+ return null;
+ }
const classes = clsx(
'woocommerce-marketplace__notice',
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/product-card/product-card-footer.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/product-card/product-card-footer.tsx
index 3612d3475ca..d038e9df7a5 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/product-card/product-card-footer.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/product-card/product-card-footer.tsx
@@ -165,7 +165,7 @@ function ProductCardFooter( props: { product: Product } ) {
if ( product.price !== 0 && product.freemium_type !== 'primary' ) {
return sprintf(
- //translators: %1$s is the price of the product, %2$s is the billing period
+ /* eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace */ /* translators: %1$s is the price of the product, %2$s is the billing period */
__( ' %1$s, %2$s ', 'woocommerce' ),
getPriceLabel(),
getBillingText()
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/product-list-content/product-list-content.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/product-list-content/product-list-content.tsx
index d9f33a1feac..a5872d5d12d 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/product-list-content/product-list-content.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/product-list-content/product-list-content.tsx
@@ -134,7 +134,7 @@ export default function ProductListContent( props: {
[ 'utm_medium', 'product' ],
[ 'utm_campaign', 'wcaddons' ],
[ 'utm_content', 'devpartner' ],
- ] )
+ ] )
: '',
price: product.price,
url: appendURLParams(
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/promo-card/promo-card.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/promo-card/promo-card.tsx
index c3eb6b08dc7..e641ff4351a 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/promo-card/promo-card.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/promo-card/promo-card.tsx
@@ -59,7 +59,9 @@ const PromoCard = ( {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ isVisible ] );
- if ( ! isVisible ) return null;
+ if ( ! isVisible ) {
+ return null;
+ }
const handleDismiss = () => {
setIsVisible( false );
diff --git a/plugins/woocommerce/client/admin/client/marketplace/components/tabs/tabs.tsx b/plugins/woocommerce/client/admin/client/marketplace/components/tabs/tabs.tsx
index 8d56e47608f..78b9e4fa947 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/components/tabs/tabs.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/components/tabs/tabs.tsx
@@ -109,7 +109,7 @@ const renderTabs = (
'woocommerce'
),
tabs[ tabKey ]?.updateCount
- )
+ )
: sprintf(
/* translators: %d: number of matching items */
_n(
@@ -119,7 +119,7 @@ const renderTabs = (
'woocommerce'
),
tabs[ tabKey ]?.updateCount
- )
+ )
}
aria-label={
tabKey === 'my-subscriptions'
@@ -132,7 +132,7 @@ const renderTabs = (
'woocommerce'
),
tabs[ tabKey ]?.updateCount
- )
+ )
: sprintf(
/* translators: %d: number of matching items */
_n(
@@ -142,7 +142,7 @@ const renderTabs = (
'woocommerce'
),
tabs[ tabKey ]?.updateCount
- )
+ )
}
>
<span> { tabs[ tabKey ]?.updateCount } </span>
diff --git a/plugins/woocommerce/client/admin/client/marketplace/contexts/marketplace-context.tsx b/plugins/woocommerce/client/admin/client/marketplace/contexts/marketplace-context.tsx
index 12d2018e27a..7ce82a992d2 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/contexts/marketplace-context.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/contexts/marketplace-context.tsx
@@ -56,7 +56,7 @@ export function MarketplaceContextProvider( props: {
);
// useExperiment keeps returning a cached assignment after tracking is turned off, so drop it here.
const productPreviewVariation = window.wcTracks?.isEnabled
- ? productPreviewAssignment?.variationName ?? null
+ ? ( productPreviewAssignment?.variationName ?? null )
: null;
const [ installedPlugins, setInstalledPlugins ] = useState< string[] >(
[]
diff --git a/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx b/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
index ddb85bb8752..bc199934e84 100644
--- a/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
+++ b/plugins/woocommerce/client/admin/client/marketplace/utils/functions.tsx
@@ -517,8 +517,7 @@ function addNotice(
*/
const getRefreshErrorMessage = ( error: unknown ): string => {
const candidate = error as
- | { data?: { message?: unknown }; message?: unknown }
- | undefined;
+ { data?: { message?: unknown }; message?: unknown } | undefined;
const message = [ candidate?.data?.message, candidate?.message ].find(
( value ): value is string => typeof value === 'string' && value !== ''
diff --git a/plugins/woocommerce/client/admin/client/order-attribution-install-banner/order-attribution-install-banner.js b/plugins/woocommerce/client/admin/client/order-attribution-install-banner/order-attribution-install-banner.js
index 65105ff52af..7eb108754eb 100644
--- a/plugins/woocommerce/client/admin/client/order-attribution-install-banner/order-attribution-install-banner.js
+++ b/plugins/woocommerce/client/admin/client/order-attribution-install-banner/order-attribution-install-banner.js
@@ -47,7 +47,6 @@ const WC_ANALYTICS_ORDER_ATTRIBUTION_ADMIN_URL =
* @param {string} props.buttonText The text for the button.
*
* @return {JSX.Element} The rendered component.
- *
*/
export const OrderAttributionInstallBanner = ( {
bannerImage = null,
diff --git a/plugins/woocommerce/client/admin/client/payments-welcome/banner.tsx b/plugins/woocommerce/client/admin/client/payments-welcome/banner.tsx
index 6e3dcd3e813..c8d1a8fa5da 100644
--- a/plugins/woocommerce/client/admin/client/payments-welcome/banner.tsx
+++ b/plugins/woocommerce/client/admin/client/payments-welcome/banner.tsx
@@ -72,7 +72,7 @@ const Banner = ( { isSubmitted, handleSetup }: Props ) => {
{ strings.noThanks }
</Button>
<p>
- { isWooPayEligible ?? false
+ { ( isWooPayEligible ?? false )
? strings.TosAndPpWooPay
: strings.TosAndPp }
</p>
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 c6dd9101892..2e651376efa 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
@@ -23,7 +23,7 @@ import strings from './strings';
*
*/
function ExitSurveyModal( {}: {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/no-empty-object-type
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
setExitSurveyModalOpen: Function;
} ): JSX.Element | null {
const incentive = getAdminSetting( 'wcpayWelcomePageIncentive' );
diff --git a/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx b/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
index 8a1ee30c53e..0df091a7a28 100644
--- a/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
+++ b/plugins/woocommerce/client/admin/client/payments-welcome/index.tsx
@@ -134,7 +134,9 @@ const ConnectAccountPage = () => {
}
};
- if ( ! incentive ) return null;
+ if ( ! incentive ) {
+ return null;
+ }
return (
<div className="woopayments-welcome-page">
diff --git a/plugins/woocommerce/client/admin/client/payments-welcome/strings.tsx b/plugins/woocommerce/client/admin/client/payments-welcome/strings.tsx
index 0f93e4ed879..3ffbde954e4 100644
--- a/plugins/woocommerce/client/admin/client/payments-welcome/strings.tsx
+++ b/plugins/woocommerce/client/admin/client/payments-welcome/strings.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable max-len */
/**
* External dependencies
*/
@@ -19,7 +18,7 @@ export default {
limitedTimeOffer: __( 'Limited time offer', 'woocommerce' ),
TosAndPp: createInterpolateElement(
sprintf(
- /* translators: 1: Payment provider name (e.g., WooPayments) */
+ /* eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace */ /* translators: 1: Payment provider name (e.g., WooPayments) */
__(
'By using %1$s you agree to our <a1>Terms of Service</a1> and acknowledge that you have read our <a2>Privacy Policy</a2>. Discount will be applied to payments processed via %1$s upon completion of installation, setup, and connection. ',
'woocommerce'
@@ -47,7 +46,7 @@ export default {
),
TosAndPpWooPay: createInterpolateElement(
sprintf(
- /* translators: 1: Payment provider name (e.g., WooPayments) */
+ /* eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace */ /* translators: 1: Payment provider name (e.g., WooPayments) */
__(
'By using %1$s you agree to our <a1>Terms of Service</a1> (including WooPay <a3>merchant terms</a3>) and acknowledge that you have read our <a2>Privacy Policy</a2>. Discount will be applied to payments processed via %1$s upon completion of installation, setup, and connection. ',
'woocommerce'
diff --git a/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-slotfill.tsx b/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-slotfill.tsx
index 76e5766633d..220a7cf7f1e 100644
--- a/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-slotfill.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-email/settings-email-listing-slotfill.tsx
@@ -42,10 +42,10 @@ const ListView = lazy( () =>
isRTL()
? import(
/* webpackChunkName: "settings-email-listing-styles-rtl" */ './settings-email-listing-rtl.scss'
- )
+ )
: import(
/* webpackChunkName: "settings-email-listing-styles" */ './settings-email-listing.scss'
- ),
+ ),
] )
.then( ( [ module ] ) => ( { default: module.ListView } ) )
.catch( ( error ) => {
@@ -71,9 +71,7 @@ export type EmailStatus = 'enabled' | 'disabled' | 'manual';
* Public REST API contract — see RSM-140 spec § 4.3.
*/
export type TemplateStatus =
- | 'in_sync'
- | 'core_updated_uncustomized'
- | 'core_updated_customized';
+ 'in_sync' | 'core_updated_uncustomized' | 'core_updated_customized';
export type EmailType = {
title: string;
@@ -331,7 +329,7 @@ export const registerSettingsEmailListingFill = () => {
emailTypes = Array.isArray( parsed )
? parsed.map( ( item: Record< string, unknown > ) =>
normalizeEmailTypePayload( item )
- )
+ )
: [];
} catch ( e ) {}
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-account-modal.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-account-modal.tsx
index 5daa729f69e..be475f04422 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-account-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-account-modal.tsx
@@ -120,7 +120,7 @@ export const BankAccountModal = ( {
: __(
'Add your bank account details.',
'woocommerce'
- ) }
+ ) }
</p>
<SelectControl
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx
index ca039e7d0b3..66f1f9c2dd3 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx
@@ -113,7 +113,9 @@ export const BankAccountsList = ( {
* Confirms and deletes the selected bank account.
*/
const confirmDelete = () => {
- if ( ! accountToDelete ) return;
+ if ( ! accountToDelete ) {
+ return;
+ }
const newAccounts = accountsWithIds.filter(
( acc ) => acc.id !== accountToDelete.id
);
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/country-selector.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/country-selector.tsx
index 7239a5ea4b5..04bb4324f1c 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/country-selector.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/country-selector.tsx
@@ -81,7 +81,7 @@ export const CountrySelector = < ItemType extends Item >( {
const visibleItems =
searchText !== ''
- ? throttledApplySearchToItems( searchText, items ) ?? new Set()
+ ? ( throttledApplySearchToItems( searchText, items ) ?? new Set() )
: new Set( items );
const {
@@ -128,7 +128,7 @@ export const CountrySelector = < ItemType extends Item >( {
currentSelectedItem
) + 1,
currentItems.length - 1
- )
+ )
: 0
],
isOpen: true, // Keep menu open after selection.
@@ -145,7 +145,7 @@ export const CountrySelector = < ItemType extends Item >( {
currentSelectedItem
) - 1,
0
- )
+ )
: currentItems.length - 1
],
isOpen: true, // Keep menu open after selection.
@@ -429,9 +429,9 @@ export const CountrySelector = < ItemType extends Item >( {
keyboardHighlightIndex !==
null
? index ===
- keyboardHighlightIndex
+ keyboardHighlightIndex
: index ===
- highlightedIndex,
+ highlightedIndex,
}
),
'data-index': index,
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/test/country-selector.test.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/test/country-selector.test.tsx
index d30317bc001..a4de13a8796 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/test/country-selector.test.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/country-selector/test/country-selector.test.tsx
@@ -248,7 +248,7 @@ describe( 'CountrySelector', () => {
await new Promise( ( resolve ) => setTimeout( resolve, 10 ) );
// Tab should not be prevented by onSearchKeyDown, allowing focus to move to Apply button.
- userEvent.tab();
+ await userEvent.tab();
// Dropdown should still be open.
expect( screen.getByRole( 'listbox' ) ).toBeInTheDocument();
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-banner/incentive-banner.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-banner/incentive-banner.tsx
index 1c86fd46742..4b4257ea6e5 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-banner/incentive-banner.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-banner/incentive-banner.tsx
@@ -124,7 +124,7 @@ export const IncentiveBanner = ( {
provider,
onboardingUrl,
provider.plugin.status === 'not_installed'
- ? provider._links?.attach?.href ?? null
+ ? ( provider._links?.attach?.href ?? null )
: null,
'wc_settings_payments__incentive_banner'
);
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-modal/incentive-modal.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-modal/incentive-modal.tsx
index fdf78f8db2b..619b77fcfc3 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-modal/incentive-modal.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/incentive-modal/incentive-modal.tsx
@@ -140,7 +140,7 @@ export const IncentiveModal = ( {
provider,
onboardingUrl,
provider.plugin.status === 'not_installed'
- ? provider._links?.attach?.href ?? null
+ ? ( provider._links?.attach?.href ?? null )
: null,
'wc_settings_payments__incentive_modal'
);
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 3386e0a79a3..644b8bddc0f 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
@@ -128,7 +128,7 @@ export const WooPaymentsResetAccountModal = ( {
'woocommerce'
),
'WooPayments'
- )
+ )
: sprintf(
/* translators: %s: Provider name */
__(
@@ -136,7 +136,7 @@ export const WooPaymentsResetAccountModal = ( {
'woocommerce'
),
'WooPayments'
- ),
+ ),
{
isDismissible: true,
}
@@ -164,7 +164,7 @@ export const WooPaymentsResetAccountModal = ( {
'woocommerce'
),
'WooPayments'
- )
+ )
: sprintf(
/* translators: %s: Provider name */
__(
@@ -172,7 +172,7 @@ export const WooPaymentsResetAccountModal = ( {
'woocommerce'
),
'WooPayments'
- );
+ );
if ( isEmbeddedResetFlow ) {
// If resetting the account from NOX, override the content.
content = sprintf(
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/offline-payment-gateway-list/offline-payment-gateway-list.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/offline-payment-gateway-list/offline-payment-gateway-list.tsx
index 1540c36bea7..b0fb94cc2c0 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/offline-payment-gateway-list/offline-payment-gateway-list.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/offline-payment-gateway-list/offline-payment-gateway-list.tsx
@@ -64,7 +64,7 @@ export const OfflinePaymentGatewayListItem = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ sanitizeHTML(
decodeEntities( gateway.description )
) }
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx
index 354e2e8a67a..27f6777884a 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx
@@ -294,11 +294,11 @@ export const OtherPaymentGateways = ( {
? __< string >(
'Installing',
'woocommerce'
- )
+ )
: __< string >(
'Install',
'woocommerce'
- );
+ );
// If the plugin is already installed, the CTA is to activate it.
if ( isPluginAlreadyInstalled ) {
@@ -306,11 +306,11 @@ export const OtherPaymentGateways = ( {
? __< string >(
'Activating',
'woocommerce'
- )
+ )
: __< string >(
'Activate',
'woocommerce'
- );
+ );
}
return (
@@ -361,11 +361,11 @@ export const OtherPaymentGateways = ( {
extension.plugin
.status ===
'not_installed'
- ? extension
+ ? ( extension
._links
?.attach
?.href ??
- null
+ null )
: null,
'wc_settings_payments__other_payment_options'
)
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-extension-suggestion-list-item/payment-extension-suggestion-list-item.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-extension-suggestion-list-item/payment-extension-suggestion-list-item.tsx
index 6d3bcdea15f..38bda35c18b 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-extension-suggestion-list-item/payment-extension-suggestion-list-item.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-extension-suggestion-list-item/payment-extension-suggestion-list-item.tsx
@@ -167,8 +167,8 @@ export const PaymentExtensionSuggestionListItem = ( {
?.href ?? null,
pluginInstalled
? null
- : suggestion._links?.attach?.href ??
- null,
+ : ( suggestion._links?.attach?.href ??
+ null ),
'wc_settings_payments__main_suggestion'
);
} }
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list-item/payment-gateway-list-item.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list-item/payment-gateway-list-item.tsx
index 5a734084046..f92c1e6f74b 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list-item/payment-gateway-list-item.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list-item/payment-gateway-list-item.tsx
@@ -63,7 +63,7 @@ export const PaymentGatewayListItem = ( {
// Default to onboarding supported to avoid blocking the user, but only when onboarding exists.
const isOnboardingSupported = gateway.onboarding
- ? gateway.onboarding.state?.supported ?? true
+ ? ( gateway.onboarding.state?.supported ?? true )
: true;
// If the account is not connected or the onboarding is not started, or not completed then the gateway needs onboarding.
@@ -224,7 +224,7 @@ export const PaymentGatewayListItem = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ sanitizeHTML(
decodeEntities( gateway.description )
) }
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list/payment-gateway-list.tsx b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list/payment-gateway-list.tsx
index fa4a2396962..a6cbb0419ae 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list/payment-gateway-list.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/components/payment-gateway-list/payment-gateway-list.tsx
@@ -176,7 +176,7 @@ export const PaymentGatewayList = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ {
__html: offlinePmsGroup.description,
} }
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/shipping-restriction-fields.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/shipping-restriction-fields.tsx
index f28d1548797..2e5077112ab 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/shipping-restriction-fields.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/shipping-restriction-fields.tsx
@@ -58,7 +58,7 @@ export const getShippingRestrictionFields = (
const shippingMethodsOptions = gateway?.settings.enable_for_methods?.options
? mapShippingMethodsOptions(
gateway.settings.enable_for_methods.options
- )
+ )
: [];
return [
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cheque.test.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cheque.test.tsx
index 1493118580b..dd2fd28c0ca 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cheque.test.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cheque.test.tsx
@@ -154,7 +154,7 @@ describe( 'SettingsPaymentsCheque', () => {
} );
} );
- it( 'supports keyboard navigation through the form fields', () => {
+ it( 'supports keyboard navigation through the form fields', async () => {
render( <SettingsPaymentsCheque /> );
// Make a change first so the Save button is enabled (and tabbable).
@@ -162,15 +162,15 @@ describe( 'SettingsPaymentsCheque', () => {
target: { value: 'Edited title' },
} );
- userEvent.tab();
+ await userEvent.tab();
expect(
screen.getByLabelText( 'Enable check payments' )
).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Title' ) ).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Description' ) ).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Instructions' ) ).toHaveFocus();
// The shipping methods tree select and the virtual orders checkbox
// sit between Instructions and Save; tab until Save receives focus.
@@ -182,7 +182,7 @@ describe( 'SettingsPaymentsCheque', () => {
i < 6 && saveButton.ownerDocument.activeElement !== saveButton;
i++
) {
- userEvent.tab();
+ await userEvent.tab();
}
expect( saveButton ).toHaveFocus();
} );
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cod.test.tsx b/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cod.test.tsx
index bde2c458f4b..80a9d1424d8 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cod.test.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/offline/test/settings-payments-cod.test.tsx
@@ -153,7 +153,7 @@ describe( 'SettingsPaymentsCod', () => {
} );
} );
- it( 'supports keyboard navigation through the form fields', () => {
+ it( 'supports keyboard navigation through the form fields', async () => {
render( <SettingsPaymentsCod /> );
// Make a change first so the Save button is enabled (and tabbable).
@@ -161,15 +161,15 @@ describe( 'SettingsPaymentsCod', () => {
target: { value: 'Edited title' },
} );
- userEvent.tab();
+ await userEvent.tab();
expect(
screen.getByLabelText( 'Enable cash on delivery payments' )
).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Title' ) ).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Description' ) ).toHaveFocus();
- userEvent.tab();
+ await userEvent.tab();
expect( screen.getByLabelText( 'Instructions' ) ).toHaveFocus();
// The shipping methods tree select and the virtual orders checkbox
// sit between Instructions and Save; tab until Save receives focus.
@@ -181,7 +181,7 @@ describe( 'SettingsPaymentsCod', () => {
i < 6 && saveButton.ownerDocument.activeElement !== saveButton;
i++
) {
- userEvent.tab();
+ await userEvent.tab();
}
expect( saveButton ).toHaveFocus();
} );
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/components/stepper/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/components/stepper/index.tsx
index 71e1e6b2727..569cdf66d39 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/components/stepper/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/components/stepper/index.tsx
@@ -73,7 +73,9 @@ export default function Stepper( {
}
}, [ activeSubStep ] );
- if ( ! topLevelStep ) return null;
+ if ( ! topLevelStep ) {
+ return null;
+ }
const activeStepIndex =
steps.findIndex( ( step ) => step.id === activeTopLevelStep ) + 1;
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/index.tsx
index e3cc2dcc88d..e40223decf7 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/custom-select-control/index.tsx
@@ -117,7 +117,7 @@ function CustomSelectControl< ItemType extends Item >( {
) }
>
{
- /* eslint-disable-next-line jsx-a11y/label-has-associated-control, jsx-a11y/label-has-for */
+ /* eslint-disable-next-line jsx-a11y/label-has-associated-control */
<label
{ ...getLabelProps( {
className: 'components-custom-select-control__label',
@@ -155,7 +155,6 @@ function CustomSelectControl< ItemType extends Item >( {
>
{ isOpen &&
items.map( ( item, index ) => (
- // eslint-disable-next-line react/jsx-key
<li
key={ item.key }
{ ...getItemProps( {
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/grouped-select-control/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/grouped-select-control/index.tsx
index 5b5b18a53ca..5a5a78a54bf 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/grouped-select-control/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/components/grouped-select-control/index.tsx
@@ -86,7 +86,9 @@ const GroupedSelectControl = < ItemType extends ListItem >( {
}
if ( changes.selectedItem && changes.selectedItem.items ) {
- if ( searchText ) return state;
+ if ( searchText ) {
+ return state;
+ }
const key = changes.selectedItem.key;
if ( openedGroups.has( key ) ) {
openedGroups.delete( key );
@@ -211,7 +213,6 @@ const GroupedSelectControl = < ItemType extends ListItem >( {
const isGroup = !! item.items;
return (
- // eslint-disable-next-line react/jsx-key
<li
key={ item.key }
{ ...getItemProps( {
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/index.tsx
index 1c7d5b3b03b..c9df19064bf 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/index.tsx
@@ -24,7 +24,9 @@ import WooPaymentsOnboardingModalSnackbar from './components/snackbar';
const SnackbarWrapper = () => {
const { snackbar } = useOnboardingContext();
- if ( ! snackbar.show ) return null;
+ if ( ! snackbar.show ) {
+ return null;
+ }
return (
<WooPaymentsOnboardingModalSnackbar
@@ -128,7 +130,9 @@ export default function WooPaymentsModal( {
setIsOpen( false );
};
- if ( ! isOpen ) return null;
+ if ( ! isOpen ) {
+ return null;
+ }
return (
<Modal setIsOpen={ handleClose }>
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/appearance.ts b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/appearance.ts
index 658f1ac5bfd..3eacb228211 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/appearance.ts
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/embedded/appearance.ts
@@ -1,5 +1,3 @@
-/* eslint-disable max-len */
-
/**
* Customised appearance variables for the external KYC flow.
*/
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/fields.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/fields.tsx
index 6179fabd017..9d01e28ac2c 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/fields.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/fields.tsx
@@ -41,7 +41,9 @@ const makeField = (
ref?: React.Ref< HTMLInputElement >
) => {
const { error, ...rest } = props;
- if ( ! error ) return <Control { ...rest } ref={ ref } />;
+ if ( ! error ) {
+ return <Control { ...rest } ref={ ref } />;
+ }
return (
<>
<Control
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/index.tsx
index 34f23fd2c9f..16efd5f3f4c 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/components/form/index.tsx
@@ -138,12 +138,15 @@ export const OnboardingTextField: React.FC< OnboardingTextFieldProps > = (
touched[ name ] ||
inputRef.current !==
inputRef.current?.ownerDocument.activeElement
- )
+ ) {
validate( value );
+ }
} }
onBlur={ () => validate() }
onKeyDown={ ( event: React.KeyboardEvent< HTMLInputElement > ) => {
- if ( event.key === 'Enter' ) validate();
+ if ( event.key === 'Enter' ) {
+ validate();
+ }
} }
error={ error() }
{ ...props }
@@ -151,8 +154,9 @@ export const OnboardingTextField: React.FC< OnboardingTextFieldProps > = (
);
};
-interface OnboardingSelectFieldProps< ItemType >
- extends Partial< Omit< SelectFieldProps< ItemType >, 'onChange' > > {
+interface OnboardingSelectFieldProps< ItemType > extends Partial<
+ Omit< SelectFieldProps< ItemType >, 'onChange' >
+> {
name: keyof OnboardingFields;
onChange?: ( name: keyof OnboardingFields, item?: ItemType | null ) => void;
}
@@ -190,8 +194,9 @@ export const OnboardingSelectField = < ItemType extends SelectItem >( {
);
};
-interface OnboardingGroupedSelectFieldProps< ItemType >
- extends Partial< Omit< GroupedSelectFieldProps< ItemType >, 'onChange' > > {
+interface OnboardingGroupedSelectFieldProps< ItemType > extends Partial<
+ Omit< GroupedSelectFieldProps< ItemType >, 'onChange' >
+> {
name: keyof OnboardingFields;
onChange?: ( name: keyof OnboardingFields, item?: ItemType | null ) => void;
}
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/sections/embedded-kyc.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/sections/embedded-kyc.tsx
index 4f61c70cd02..24decc8419d 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/sections/embedded-kyc.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/sections/embedded-kyc.tsx
@@ -23,10 +23,7 @@ interface Props {
}
type EmbeddedKycLoadFailureReason =
- | 'timeout'
- | 'load_error'
- | 'bad_session'
- | 'init_error';
+ 'timeout' | 'load_error' | 'bad_session' | 'init_error';
type EmbeddedKycLoadFailure = {
reason: EmbeddedKycLoadFailureReason;
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/strings.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/strings.tsx
index b4c4c3126e3..16848625ba1 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/strings.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/strings.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable max-len */
/**
* External dependencies
*/
@@ -85,6 +84,7 @@ export default {
'What category of legal entity identify your business?',
'woocommerce'
),
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
mcc: __(
'What type of goods or services does your business sell? ',
'woocommerce'
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/test/business-details-flow.test.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/test/business-details-flow.test.tsx
index f5a9f27cdef..75086cd179a 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/test/business-details-flow.test.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/test/business-details-flow.test.tsx
@@ -17,7 +17,8 @@ import BusinessDetails from '../sections/business-details';
jest.mock( '@wordpress/api-fetch', () => jest.fn() );
jest.mock( '@wordpress/components', () => {
- const ReactModule = jest.requireActual< typeof import('react') >( 'react' );
+ const ReactModule =
+ jest.requireActual< typeof import( 'react' ) >( 'react' );
return {
Button: ReactModule.forwardRef(
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/translations/descriptions.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/translations/descriptions.tsx
index ad4314eefe3..6c33b5e11c0 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/translations/descriptions.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/translations/descriptions.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable max-len */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/types.ts b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/types.ts
index bcfffb6e213..e85d657499e 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/types.ts
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/types.ts
@@ -3,11 +3,7 @@
*/
export type OnboardingSteps =
- | 'activate'
- | 'business'
- | 'store'
- | 'embedded'
- | 'loading';
+ 'activate' | 'business' | 'store' | 'embedded' | 'loading';
export type OnboardingFields = {
country?: string;
@@ -65,8 +61,7 @@ export interface EmbeddedKycSessionCreateResult {
}
export type EmbeddedAccountInitializationFailureReason =
- | 'bad_session'
- | 'init_error';
+ 'bad_session' | 'init_error';
export interface EmbeddedAccountInitializationFailure {
reason: EmbeddedAccountInitializationFailureReason;
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/index.ts b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/index.ts
index 32011082b0e..d621309ef9f 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/index.ts
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/index.ts
@@ -36,7 +36,7 @@ export const getBusinessTypes = ( data: Country[] ): Country[] => {
description: businessTypeDescriptionStrings[ country.key ]
? businessTypeDescriptionStrings[ country.key ][
type.key
- ]
+ ]
: businessTypeDescriptionStrings.generic[ type.key ],
} ) ),
} ) )
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/validation.ts b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/validation.ts
index c20a615ba22..1ff6aeeb4e3 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/validation.ts
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/business-verification/utils/validation.ts
@@ -11,7 +11,9 @@ import { useBusinessVerificationContext } from '../data/business-verification-co
import { OnboardingFields } from '../types';
const isValid = ( name: keyof OnboardingFields, value?: string ): boolean => {
- if ( ! value ) return false;
+ if ( ! value ) {
+ return false;
+ }
switch ( name ) {
default:
@@ -20,18 +22,20 @@ const isValid = ( name: keyof OnboardingFields, value?: string ): boolean => {
};
// TS is smart enough to infer the return type here.
-// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+
export const useValidation = ( name: keyof OnboardingFields ) => {
const { data, errors, setErrors, touched, setTouched } =
useBusinessVerificationContext();
const validate = ( value: string | undefined = data[ name ] ) => {
- if ( ! touched[ name ] ) setTouched( { [ name ]: true } );
+ if ( ! touched[ name ] ) {
+ setTouched( { [ name ]: true } );
+ }
const error = isValid( name, value )
? undefined
: ( strings.errors as Record< string, string > )[ name ] ||
- strings.errors.generic;
+ strings.errors.generic;
setErrors( { [ name ]: error } );
};
@@ -41,7 +45,9 @@ export const useValidation = ( name: keyof OnboardingFields ) => {
validate();
// Set touched to false if the field is empty.
- if ( ! data[ name ] ) setTouched( { [ name ]: false } );
+ if ( ! data[ name ] ) {
+ setTouched( { [ name ]: false } );
+ }
// Clean up the error when the field is unmounted.
return () => setErrors( { [ name ]: undefined } );
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 99912cb8b43..dcf79030dc4 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
@@ -263,9 +263,9 @@ export default function PaymentMethodsSelection() {
// Pass down the calculated initial visibility for this specific method from state
initialVisibilityStatus={
initialVisibilityMap
- ? initialVisibilityMap[
+ ? ( initialVisibilityMap[
method.id
- ] ?? null
+ ] ?? null )
: null
}
isExpanded={ isExpanded }
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/list-item.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/list-item.tsx
index 3c13e8c1a27..f774608ea3d 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/list-item.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/list-item.tsx
@@ -76,8 +76,8 @@ export const PaymentMethodListItem = ( {
// Prioritize the prop if provided, otherwise use the internal ref state.
const baseVisibility =
initialVisibilityStatus !== undefined
- ? initialVisibilityStatus ?? false
- : shouldRenderInMainListRef.current ?? false;
+ ? ( initialVisibilityStatus ?? false )
+ : ( shouldRenderInMainListRef.current ?? false );
const shouldRender = isExpanded || baseVisibility;
@@ -115,7 +115,7 @@ export const PaymentMethodListItem = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ sanitizeHTML(
decodeEntities( method.description )
) }
@@ -147,7 +147,7 @@ export const PaymentMethodListItem = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ sanitizeHTML(
decodeEntities( method.description )
) }
@@ -167,7 +167,7 @@ export const PaymentMethodListItem = ( {
</span>
<span
className="woocommerce-list__item-content"
- // eslint-disable-next-line react/no-danger -- This string is sanitized by the PaymentGateway class.
+
dangerouslySetInnerHTML={ sanitizeHTML(
decodeEntities(
method.extraDescription ?? ''
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-account/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-account/index.tsx
index ae37e979b7f..62ed9443776 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-account/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-account/index.tsx
@@ -470,7 +470,7 @@ const TestAccountStep = () => {
setIsResetAccountModalOpen( true );
},
},
- ]
+ ]
: [
{
label: __( 'Try Again', 'woocommerce' ),
@@ -509,7 +509,7 @@ const TestAccountStep = () => {
closeModal();
},
},
- ];
+ ];
// Render loading/error state.
return (
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-or-live-account/index.tsx b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-or-live-account/index.tsx
index be057bfa45a..bf36a006565 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-or-live-account/index.tsx
+++ b/plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/test-or-live-account/index.tsx
@@ -33,8 +33,9 @@ const TestOrLiveAccountStep = () => {
const [ isContinueButtonLoading, setIsContinueButtonLoading ] =
useState( false );
- const testAccountStepActions = getStepByKey( TESTING_ACCOUNT_STEP_ID )
- ?.actions;
+ const testAccountStepActions = getStepByKey(
+ TESTING_ACCOUNT_STEP_ID
+ )?.actions;
const canCreateTestAccount = testAccountStepActions?.finish?.href;
return (
diff --git a/plugins/woocommerce/client/admin/client/settings-payments/utils.ts b/plugins/woocommerce/client/admin/client/settings-payments/utils.ts
index 5f23128e58c..03790b671c2 100644
--- a/plugins/woocommerce/client/admin/client/settings-payments/utils.ts
+++ b/plugins/woocommerce/client/admin/client/settings-payments/utils.ts
@@ -480,12 +480,12 @@ export const getPluginActionErrorMessage = (
/* translators: %s: payment provider name (e.g. Visa Acceptance Solutions) */
__( 'Could not install %s.', 'woocommerce' ),
title
- )
+ )
: sprintf(
/* translators: %s: payment provider name (e.g. Visa Acceptance Solutions) */
__( 'Could not activate %s.', 'woocommerce' ),
title
- );
+ );
const rejection =
typeof error === 'object' && error !== null
diff --git a/plugins/woocommerce/client/admin/client/settings-recommendations/test/dismissable-list.test.js b/plugins/woocommerce/client/admin/client/settings-recommendations/test/dismissable-list.test.js
index 36562d287a7..273742acdd8 100644
--- a/plugins/woocommerce/client/admin/client/settings-recommendations/test/dismissable-list.test.js
+++ b/plugins/woocommerce/client/admin/client/settings-recommendations/test/dismissable-list.test.js
@@ -106,7 +106,7 @@ describe( 'DismissableListHeading', () => {
expect( screen.queryByText( 'heading content' ) ).toBeInTheDocument();
} );
- it( 'calls onDismiss when "Hide this" is clicked', () => {
+ it( 'calls onDismiss when "Hide this" is clicked', async () => {
const onDismiss = jest.fn();
render(
<DismissableListHeading onDismiss={ onDismiss }>
@@ -114,18 +114,18 @@ describe( 'DismissableListHeading', () => {
</DismissableListHeading>
);
- userEvent.click( screen.getByTitle( 'Task List Options' ) );
- userEvent.click( screen.getByText( 'Hide this' ) );
+ await userEvent.click( screen.getByTitle( 'Task List Options' ) );
+ await userEvent.click( screen.getByText( 'Hide this' ) );
expect( onDismiss ).toHaveBeenCalledTimes( 1 );
} );
- it( 'does not throw when "Hide this" is clicked without an onDismiss prop', () => {
+ it( 'does not throw when "Hide this" is clicked without an onDismiss prop', async () => {
render(
<DismissableListHeading>heading content</DismissableListHeading>
);
- userEvent.click( screen.getByTitle( 'Task List Options' ) );
+ await userEvent.click( screen.getByTitle( 'Task List Options' ) );
expect( () =>
userEvent.click( screen.getByText( 'Hide this' ) )
diff --git a/plugins/woocommerce/client/admin/client/settings/conflict-error-slotfill.js b/plugins/woocommerce/client/admin/client/settings/conflict-error-slotfill.js
index 3605b869fdc..4a3b04d41d3 100644
--- a/plugins/woocommerce/client/admin/client/settings/conflict-error-slotfill.js
+++ b/plugins/woocommerce/client/admin/client/settings/conflict-error-slotfill.js
@@ -53,7 +53,7 @@ const SettingsErrorFill = () => {
const handleApplyRecommendedSettings = () => {
/** We're using jQuery in this file because the select boxes are implemented using select2 and can only be interacted with using jQuery */
- // eslint-disable-next-line no-undef
+
window
.jQuery( '#woocommerce_tax_display_shop' )
.val( pricesEnteredWithTaxSetting )
diff --git a/plugins/woocommerce/client/admin/client/shipping/woocommerce-shipping-item.tsx b/plugins/woocommerce/client/admin/client/shipping/woocommerce-shipping-item.tsx
index 3606d8e9930..ace79911c6f 100644
--- a/plugins/woocommerce/client/admin/client/shipping/woocommerce-shipping-item.tsx
+++ b/plugins/woocommerce/client/admin/client/shipping/woocommerce-shipping-item.tsx
@@ -67,7 +67,7 @@ const WooCommerceShippingItem = ( {
: __(
'WooCommerce Shipping is installed!',
'woocommerce'
- ),
+ ),
{}
);
},
diff --git a/plugins/woocommerce/client/admin/client/store-management-links/quick-link/test/index.js b/plugins/woocommerce/client/admin/client/store-management-links/quick-link/test/index.js
index 80a70242cb4..3fe7d82d5b5 100644
--- a/plugins/woocommerce/client/admin/client/store-management-links/quick-link/test/index.js
+++ b/plugins/woocommerce/client/admin/client/store-management-links/quick-link/test/index.js
@@ -29,7 +29,7 @@ describe( 'QuickLink', () => {
);
} );
- it( 'attaches a click handler to the link if it is passed', () => {
+ it( 'attaches a click handler to the link if it is passed', async () => {
const clickHandler = jest.fn();
const { queryByRole } = render(
@@ -43,7 +43,7 @@ describe( 'QuickLink', () => {
);
const link = queryByRole( 'link' );
- userEvent.click( link );
+ await userEvent.click( link );
expect( clickHandler ).toHaveBeenCalled();
} );
} );
diff --git a/plugins/woocommerce/client/admin/client/store-management-links/test/index.js b/plugins/woocommerce/client/admin/client/store-management-links/test/index.js
index 97188e34089..c5945027ec8 100644
--- a/plugins/woocommerce/client/admin/client/store-management-links/test/index.js
+++ b/plugins/woocommerce/client/admin/client/store-management-links/test/index.js
@@ -70,11 +70,11 @@ describe( 'getLinkTypeAndHref', () => {
} );
describe( 'StoreManagementLinks', () => {
- it( 'records a track when a link is clicked', () => {
+ it( 'records a track when a link is clicked', async () => {
const { queryByText } = render( <StoreManagementLinks /> );
const linkDetails = getItemsByCategory( 'fakeUrl' )[ 0 ].items[ 0 ];
- userEvent.click( queryByText( linkDetails.title ) );
+ await userEvent.click( queryByText( linkDetails.title ) );
expect( recordEvent ).toHaveBeenCalledWith( 'home_quick_links_click', {
task_name: linkDetails.listItemTag,
diff --git a/plugins/woocommerce/client/admin/client/task-lists/components/progress-header/utils.tsx b/plugins/woocommerce/client/admin/client/task-lists/components/progress-header/utils.tsx
index 7bf6dabffb1..d5de4defa9b 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/components/progress-header/utils.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/components/progress-header/utils.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable no-console */
/**
* External dependencies
*/
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 07d1b00cb2e..2a53d75df21 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
@@ -248,7 +248,7 @@ export const TaskListItem = ( {
: () => {
trackTaskListClick?.();
setExpandedTask( id );
- }
+ }
}
/>
);
diff --git a/plugins/woocommerce/client/admin/client/task-lists/components/test/task-list-item.test.tsx b/plugins/woocommerce/client/admin/client/task-lists/components/test/task-list-item.test.tsx
index adfb6a3e0f9..9c8530f1934 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/components/test/task-list-item.test.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/components/test/task-list-item.test.tsx
@@ -188,7 +188,7 @@ describe( 'TaskListItem', () => {
} );
} );
- it( 'should call dismissTask and trigger a notice when dismissing a task', () => {
+ it( 'should call dismissTask and trigger a notice when dismissing a task', async () => {
const { getByRole } = render(
<TaskListItem
task={ { ...task } }
@@ -197,8 +197,8 @@ describe( 'TaskListItem', () => {
setExpandedTask={ () => {} }
/>
);
- act( () => {
- userEvent.click( getByRole( 'button', { name: 'Dismiss' } ) );
+ await act( async () => {
+ await userEvent.click( getByRole( 'button', { name: 'Dismiss' } ) );
} );
expect( mockDispatch.dismissTask ).toHaveBeenCalledWith( task.id );
expect( mockDispatch.createNotice ).toHaveBeenCalled();
@@ -210,7 +210,7 @@ describe( 'TaskListItem', () => {
);
} );
- it( 'should trigger tasklist_click event when clicking tasklist item', () => {
+ it( 'should trigger tasklist_click event when clicking tasklist item', async () => {
render(
<TaskListItem
task={ { ...task } }
@@ -219,8 +219,8 @@ describe( 'TaskListItem', () => {
setExpandedTask={ () => {} }
/>
);
- act( () => {
- userEvent.click( screen.getByText( task.title ) );
+ await act( async () => {
+ await userEvent.click( screen.getByText( task.title ) );
} );
expect( recordEvent ).toHaveBeenCalledWith( 'tasklist_click', {
@@ -229,7 +229,7 @@ describe( 'TaskListItem', () => {
} );
} );
- it( 'should call trackClick when clicking tasklist item', () => {
+ it( 'should call trackClick when clicking tasklist item', async () => {
const trackClick = jest.fn();
render(
<TaskListItem
@@ -241,14 +241,14 @@ describe( 'TaskListItem', () => {
/>
);
- act( () => {
- userEvent.click( screen.getByText( task.title ) );
+ await act( async () => {
+ await userEvent.click( screen.getByText( task.title ) );
} );
expect( trackClick ).toHaveBeenCalledTimes( 1 );
} );
- it( 'should call trackClick before expanding expandable tasklist item', () => {
+ it( 'should call trackClick before expanding expandable tasklist item', async () => {
const trackClick = jest.fn();
const setExpandedTask = jest.fn();
render(
@@ -261,8 +261,8 @@ describe( 'TaskListItem', () => {
/>
);
- act( () => {
- userEvent.click( screen.getByText( task.title ) );
+ await act( async () => {
+ await userEvent.click( screen.getByText( task.title ) );
} );
expect( trackClick ).toHaveBeenCalledTimes( 1 );
@@ -346,7 +346,7 @@ describe( 'TaskListItem', () => {
expect( onTaskSkip ).not.toHaveBeenCalled();
} );
- it( 'should call snoozeTask and trigger a notice when snoozing a task', () => {
+ it( 'should call snoozeTask and trigger a notice when snoozing a task', async () => {
const { getByRole } = render(
<TaskListItem
task={ { ...task } }
@@ -355,8 +355,8 @@ describe( 'TaskListItem', () => {
setExpandedTask={ () => {} }
/>
);
- act( () => {
- userEvent.click( getByRole( 'button', { name: 'Snooze' } ) );
+ await act( async () => {
+ await userEvent.click( getByRole( 'button', { name: 'Snooze' } ) );
} );
expect( mockDispatch.snoozeTask ).toHaveBeenCalledWith( task.id );
expect( mockDispatch.createNotice ).toHaveBeenCalled();
diff --git a/plugins/woocommerce/client/admin/client/task-lists/components/test/task.test.tsx b/plugins/woocommerce/client/admin/client/task-lists/components/test/task.test.tsx
index e49373533d2..8328bde7b9a 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/components/test/task.test.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/components/test/task.test.tsx
@@ -109,8 +109,10 @@ describe( 'Task', () => {
<Task query={ { task: 'test' } } task={ task } />
</div>
);
- act( () => {
- userEvent.click( getByRole( 'button', { name: 'complete' } ) );
+ act( async () => {
+ await userEvent.click(
+ getByRole( 'button', { name: 'complete' } )
+ );
} );
expect( optimisticallyCompleteTask ).toHaveBeenCalledWith( 'test' );
expect( invalidateResolutionForStoreSelector ).toHaveBeenCalledWith(
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js
index 2a15519cc1a..64ff72ac5aa 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/components/Setup/Setup.js
@@ -109,7 +109,7 @@ export const Setup = ( { markConfigured, paymentGateway } ) => {
pluginSlugs={ plugins }
/>
),
- }
+ }
: null;
}, [] );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js
index 2013c193bf4..12a97e599d5 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/index.js
@@ -99,13 +99,13 @@ export const PaymentGatewaySuggestions = ( { onComplete, query } ) => {
{ task: getQuery().task },
{},
'/'
- )
+ )
: getNewPath(
{ task: 'payments' },
{},
'/'
- ),
- }
+ ),
+ }
: {}
);
} );
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js
index e4f076024ba..ad0eaf23265 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/PaymentGatewaySuggestions/utils.js
@@ -116,9 +116,9 @@ export const getSplitGateways = (
if ( gateway.installed && ! gateway.needsSetup ) {
wcPayBnpl.push( gateway );
}
- } else if (
- ! ( gateway.installed && ! gateway.needsSetup )
- ) {
+ } else if ( ! (
+ gateway.installed && ! gateway.needsSetup
+ ) ) {
// WCPay is always shown when it's not installed, or it's installed but needs setup.
wcPay.push( gateway );
}
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/components/use-load-sample-products.ts b/plugins/woocommerce/client/admin/client/task-lists/fills/components/use-load-sample-products.ts
index eab61ae735f..e324ff4acbb 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/components/use-load-sample-products.ts
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/components/use-load-sample-products.ts
@@ -48,7 +48,7 @@ const useLoadSampleProducts = ( {
: __(
'There was an error importing the sample products',
'woocommerce'
- );
+ );
createNotice( 'error', message );
}
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/test/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/test/index.tsx
index 50ccded624c..f2810357f5b 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/test/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/import-products/test/index.tsx
@@ -36,7 +36,7 @@ describe( 'Products', () => {
test( 'should fire "tasklist_add_product_from_scratch_click" event when the button clicked', async () => {
const { getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Or add your products from scratch' } )
);
await waitFor( () =>
@@ -49,7 +49,7 @@ describe( 'Products', () => {
test( 'should fire "tasklist_add_product" event when the csv option clicked', async () => {
const { getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'menuitem', {
name: 'FROM A CSV FILE Import all products at once by uploading a CSV file.',
} )
@@ -77,7 +77,7 @@ describe( 'Products', () => {
} );
const { getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'menuitem', {
name: 'FROM A CSV FILE Import all products at once by uploading a CSV file.',
} )
@@ -88,35 +88,34 @@ describe( 'Products', () => {
'tasklist_add_product',
{ method: 'import' }
);
-
- expect( recordEvent ).toHaveBeenNthCalledWith(
- 2,
- 'task_completion_time',
- {
- task_name: 'products',
- time: '0-2s',
- }
- );
} );
+ expect( recordEvent ).toHaveBeenNthCalledWith(
+ 2,
+ 'task_completion_time',
+ {
+ task_name: 'products',
+ time: '0-2s',
+ }
+ );
} );
it( 'should send a request to load sample products when the "Import sample products" button is clicked', async () => {
const fetchMock = jest.spyOn( global, 'fetch' );
const { queryByText, getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Or add your products from scratch' } )
);
expect( queryByText( 'Load Sample Products' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: 'Load Sample Products' } )
);
await waitFor( () =>
expect( queryByText( confirmModalText ) ).toBeInTheDocument()
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Import sample products' } )
);
await waitFor( () =>
@@ -137,19 +136,19 @@ describe( 'Products', () => {
it( 'should close the confirmation modal when the cancel button is clicked', async () => {
const { queryByText, getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Or add your products from scratch' } )
);
expect( queryByText( 'Load Sample Products' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: 'Load Sample Products' } )
);
await waitFor( () =>
expect( queryByText( confirmModalText ) ).toBeInTheDocument()
);
- userEvent.click( getByRole( 'button', { name: 'Cancel' } ) );
+ await userEvent.click( getByRole( 'button', { name: 'Cancel' } ) );
expect( queryByText( confirmModalText ) ).not.toBeInTheDocument();
expect( recordEvent ).toHaveBeenCalledWith(
'tasklist_cancel_load_sample_products_click'
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/products/constants.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/products/constants.tsx
index 7167aecb58f..38cd3f4bf97 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/products/constants.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/products/constants.tsx
@@ -137,8 +137,7 @@ export const ImportCSVItem = {
};
export type SponsoredProductPlacementType =
- | typeof PrintfulAdvertProductPlacement
- | typeof ImportCSVItem;
+ typeof PrintfulAdvertProductPlacement | typeof ImportCSVItem;
export type ProductType =
| ( typeof productTypes )[ number ]
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/index.tsx
index 403eb3e4fd3..88334b46499 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/index.tsx
@@ -103,7 +103,7 @@ describe( 'Products', () => {
expect( queryByText( 'View more product types' ) ).toBeInTheDocument();
} );
- it( 'clicking on suggested product should fire event tasklist_add_product with method: product_template, tasklist_product_template_selection with is_suggested:true and task_completion_time', () => {
+ it( 'clicking on suggested product should fire event tasklist_add_product with method: product_template, tasklist_product_template_selection with is_suggested:true and task_completion_time', async () => {
( getAdminSetting as jest.Mock ).mockImplementation( () => ( {
profile: {
product_types: [ 'downloads' ],
@@ -111,7 +111,7 @@ describe( 'Products', () => {
} ) );
const { getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'menuitem', {
name: 'Digital product A digital product like service, downloadable book, music or video.',
} )
@@ -146,7 +146,7 @@ describe( 'Products', () => {
expect( queryByText( 'View more product types' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'View more product types' } )
);
@@ -157,7 +157,7 @@ describe( 'Products', () => {
);
} );
- userEvent.click(
+ await userEvent.click(
getByRole( 'menuitem', {
name: 'Grouped product A collection of related products.',
} )
@@ -196,7 +196,7 @@ describe( 'Products', () => {
expect( queryByText( 'View more product types' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'View more product types' } )
);
@@ -214,19 +214,19 @@ describe( 'Products', () => {
const fetchMock = jest.spyOn( global, 'fetch' );
const { queryByText, getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'View more product types' } )
);
expect( queryByText( 'Load Sample Products' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: 'Load Sample Products' } )
);
await waitFor( () =>
expect( queryByText( confirmModalText ) ).toBeInTheDocument()
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Import sample products' } )
);
await waitFor( () =>
@@ -247,19 +247,19 @@ describe( 'Products', () => {
it( 'should close the confirmation modal when the cancel button is clicked', async () => {
const { queryByText, getByRole } = render( <Products /> );
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'View more product types' } )
);
expect( queryByText( 'Load Sample Products' ) ).toBeInTheDocument();
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: 'Load Sample Products' } )
);
await waitFor( () =>
expect( queryByText( confirmModalText ) ).toBeInTheDocument()
);
- userEvent.click( getByRole( 'button', { name: 'Cancel' } ) );
+ await userEvent.click( getByRole( 'button', { name: 'Cancel' } ) );
expect( queryByText( confirmModalText ) ).not.toBeInTheDocument();
expect( recordEvent ).toHaveBeenCalledWith(
'tasklist_cancel_load_sample_products_click'
@@ -275,10 +275,10 @@ describe( 'Products', () => {
).toBeGreaterThanOrEqual( 1 );
} );
- it( 'should trigger event tasklist_add_product_visit_marketplace_click when clicking the WooCommerce Marketplace link', () => {
+ it( 'should trigger event tasklist_add_product_visit_marketplace_click when clicking the WooCommerce Marketplace link', async () => {
const { getByText } = render( <Products /> );
- userEvent.click( getByText( 'the WooCommerce Marketplace' ) );
+ await userEvent.click( getByText( 'the WooCommerce Marketplace' ) );
expect( recordEvent ).toHaveBeenCalledWith(
'tasklist_add_product_visit_marketplace_click',
@@ -294,7 +294,7 @@ describe( 'Products', () => {
const { getByText } = render( <Products /> );
- userEvent.click( getByText( 'the WooCommerce Marketplace' ) );
+ await userEvent.click( getByText( 'the WooCommerce Marketplace' ) );
expect( mockLocation.href ).toContain(
'admin.php?page=wc-admin&tab=extensions&path=/extensions&category=merchandising'
);
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/stack.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/stack.tsx
index a17ef0150fe..9e36a234213 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/stack.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/products/test/stack.tsx
@@ -66,10 +66,12 @@ describe( 'Stack', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: 'Load Sample Products' } )
);
- await waitFor( () => expect( onClickLoadSampleProduct ).toBeCalled() );
+ await waitFor( () =>
+ expect( onClickLoadSampleProduct ).toHaveBeenCalled()
+ );
} );
it( 'should fire the tasklist_add_product and task_completion_time events when the "Start Blank" link is clicked', async () => {
@@ -86,7 +88,7 @@ describe( 'Stack', () => {
/>
);
- userEvent.click( getByRole( 'link', { name: 'Start Blank' } ) );
+ await userEvent.click( getByRole( 'link', { name: 'Start Blank' } ) );
expect( recordEvent ).toHaveBeenNthCalledWith(
1,
'tasklist_add_product',
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
index b34fdf4a57b..1b15844e4b0 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
@@ -383,12 +383,12 @@ export class Shipping extends Component {
/>
),
},
- } )
+ } )
: __(
'With WooCommerce Shipping you can save time ' +
'by printing your USPS and DHL Express shipping labels at home',
'woocommerce'
- ),
+ ),
content: (
<>
{ ! isJetpackConnected &&
@@ -483,7 +483,7 @@ export class Shipping extends Component {
this.state.step !== 'rates'
? () => {
this.setState( { step: 'rates' } );
- }
+ }
: undefined,
content: (
<ShippingRates
@@ -512,11 +512,11 @@ export class Shipping extends Component {
? getSinglePluginDescription(
pluginsToPromote[ 0 ].name,
pluginsToPromote[ 0 ].learn_more_link
- )
+ )
: __(
'Save time and money by printing your shipping labels right from your computer with one of these shipping solutions.',
'woocommerce'
- ),
+ ),
content: (
<>
@@ -704,7 +704,7 @@ export class Shipping extends Component {
this.state.step !== 'store_location'
? () => {
this.setState( { step: 'store_location' } );
- }
+ }
: undefined,
buttonText: __( 'Save store location', 'woocommerce' ),
},
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/rates.js b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/rates.js
index 301e7c494fd..7cb65c11787 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/rates.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/rates.js
@@ -172,7 +172,7 @@ class ShippingRates extends Component {
method: 'POST',
path: shippingMethod
? // Update the first existing method if one exists, otherwise create a new one.
- `/wc/v3/shipping/zones/${ zone.id }/methods/${ shippingMethod.instance_id }`
+ `/wc/v3/shipping/zones/${ zone.id }/methods/${ shippingMethod.instance_id }`
: `/wc/v3/shipping/zones/${ zone.id }/methods`,
data: {
method_id: methodType,
@@ -244,7 +244,7 @@ class ShippingRates extends Component {
shippingMethods.length && shippingMethods[ 0 ].settings.cost
? this.getFormattedRate(
shippingMethods[ 0 ].settings.cost.value
- )
+ )
: formatDecimalString( 0 );
values[ `${ zone.id }_rate` ] = rate;
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/manual-configuration/configure.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/manual-configuration/configure.tsx
index fbb2af6ae93..fc61b046b87 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/tax/manual-configuration/configure.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/tax/manual-configuration/configure.tsx
@@ -43,7 +43,6 @@ export const Configure = ( {
{ generalSettings?.woocommerce_calc_taxes !== 'yes' &&
interpolateComponents( {
mixedString: __(
- /*eslint-disable max-len*/
'By clicking "Configure" you\'re enabling tax rates and calculations. More info {{link}}here{{/link}}.',
'woocommerce'
),
diff --git a/plugins/woocommerce/client/admin/client/task-lists/progress-title/default-progress-title.tsx b/plugins/woocommerce/client/admin/client/task-lists/progress-title/default-progress-title.tsx
index 60a639ca50b..f9e09bdd26d 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/progress-title/default-progress-title.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/progress-title/default-progress-title.tsx
@@ -52,7 +52,7 @@ export const DefaultProgressTitle = ( {
/* translators: %s = site title */
__( 'Welcome to %s', 'woocommerce' ),
siteTitle as string
- )
+ )
: __( 'Welcome to your store', 'woocommerce' );
}
if ( completedCount <= 3 ) {
diff --git a/plugins/woocommerce/client/admin/client/task-lists/progress-title/utils.tsx b/plugins/woocommerce/client/admin/client/task-lists/progress-title/utils.tsx
index c81d30c085f..4442b4e08eb 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/progress-title/utils.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/progress-title/utils.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable no-console */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/customize-store.tsx b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/customize-store.tsx
index 4d35629022b..3c4aa361c2b 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/customize-store.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/customize-store.tsx
@@ -21,11 +21,11 @@ const CustomizeStoreHeader = ( {
? __(
'Use our built-in AI tools to design your store and populate it with content, or select a pre-built theme and customize it to fit your brand.',
'woocommerce'
- )
+ )
: __(
'Quickly create a beautiful looking store using our built-in store designer, or select a pre-built theme and customize it to fit your brand.',
'woocommerce'
- );
+ );
return (
<div
className={ `woocommerce-task-header__contents-container woocommerce-task-header__${ task.id }` }
diff --git a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/products.js b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/products.js
index c62e4281160..bacf34f8893 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/products.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/setup-task-list/components/task-headers/products.js
@@ -29,10 +29,13 @@ const ProductsHeader = ( { task, goToTask } ) => {
: __( 'List your products', 'woocommerce' ) }
</h1>
<p>
- { __(
- 'Start selling by adding products or services to your store. Choose to list products manually, or import them from a different store. ',
- 'woocommerce'
- ) }
+ {
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __(
+ 'Start selling by adding products or services to your store. Choose to list products manually, or import them from a different store. ',
+ 'woocommerce'
+ )
+ }
</p>
<Button
isSecondary={ task.isComplete }
diff --git a/plugins/woocommerce/client/admin/client/task-lists/test/tasks.test.tsx b/plugins/woocommerce/client/admin/client/task-lists/test/tasks.test.tsx
index f7247e69815..e363636a389 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/test/tasks.test.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/test/tasks.test.tsx
@@ -80,13 +80,13 @@ describe( 'Task', () => {
cleanup();
} );
- it( 'should render if no current task and finished resolving', () => {
+ it( 'should render if no current task and finished resolving', async () => {
const { queryByText } = render(
<div>
<TaskLists query={ {} } />
</div>
);
- waitFor( () => {
+ await waitFor( () => {
expect( queryByText( 'task-list:main' ) ).toBeInTheDocument();
expect( queryByText( 'task-list:extended' ) ).toBeInTheDocument();
expect(
@@ -151,7 +151,7 @@ describe( 'Task', () => {
} );
describe( 'toggle list', () => {
- it( 'should trigger hide track when clicking Show things to do next button', () => {
+ it( 'should trigger hide track when clicking Show things to do next button', async () => {
( useSelect as jest.Mock ).mockImplementation( () => ( {
isResolving: false,
taskLists: [
@@ -170,8 +170,8 @@ describe( 'Task', () => {
<TaskLists query={ {} } />
</div>
);
- act( () => {
- userEvent.click( getByText( 'Show things to do next' ) );
+ await act( async () => {
+ await userEvent.click( getByText( 'Show things to do next' ) );
} );
expect( recordEvent ).toHaveBeenCalledWith(
'main_tasklist_hide',
@@ -180,7 +180,7 @@ describe( 'Task', () => {
expect( hideTaskList ).toHaveBeenCalledWith( 'main' );
} );
- it( 'should trigger show track when toggling task list when isHidden was true', () => {
+ it( 'should trigger show track when toggling task list when isHidden was true', async () => {
( useSelect as jest.Mock ).mockImplementation( () => ( {
isResolving: false,
taskLists: [
@@ -199,8 +199,8 @@ describe( 'Task', () => {
<TaskLists query={ {} } />
</div>
);
- act( () => {
- userEvent.click( getByText( 'Show things to do next' ) );
+ await act( async () => {
+ await userEvent.click( getByText( 'Show things to do next' ) );
} );
expect( recordEvent ).toHaveBeenCalledWith(
'main_tasklist_show',
diff --git a/plugins/woocommerce/client/admin/client/tax/tax-recommendations.tsx b/plugins/woocommerce/client/admin/client/tax/tax-recommendations.tsx
index 6acb5830f68..bd54ca6d93f 100644
--- a/plugins/woocommerce/client/admin/client/tax/tax-recommendations.tsx
+++ b/plugins/woocommerce/client/admin/client/tax/tax-recommendations.tsx
@@ -141,12 +141,12 @@ const TaxRecommendationItem = ( {
/* translators: %s: extension name. */
__( '%s activated!', 'woocommerce' ),
title
- )
+ )
: sprintf(
/* translators: %s: extension name. */
__( '%s is installed!', 'woocommerce' ),
title
- ),
+ ),
{}
);
},
diff --git a/plugins/woocommerce/client/admin/client/typings/index.d.ts b/plugins/woocommerce/client/admin/client/typings/index.d.ts
index 56a5a0db937..f3b1be6dcbc 100644
--- a/plugins/woocommerce/client/admin/client/typings/index.d.ts
+++ b/plugins/woocommerce/client/admin/client/typings/index.d.ts
@@ -13,8 +13,8 @@ declare module '@wordpress/keyboard-shortcuts' {
modifier?: string;
character: string;
};
- export declare const store: import('@wordpress/data').StoreDescriptor<
- import('@wordpress/data').ReduxStoreConfig<
+ export declare const store: import( '@wordpress/data' ).StoreDescriptor<
+ import( '@wordpress/data' ).ReduxStoreConfig<
unknown,
{
registerShortcut: ( shortcut: {
diff --git a/plugins/woocommerce/client/admin/client/utils/admin-settings.js b/plugins/woocommerce/client/admin/client/utils/admin-settings.js
index b7e0b01b963..e1349d94b87 100644
--- a/plugins/woocommerce/client/admin/client/utils/admin-settings.js
+++ b/plugins/woocommerce/client/admin/client/utils/admin-settings.js
@@ -77,7 +77,7 @@ export function getAdminSetting(
? createDeprecatedPropertiesProxy(
filtered,
deprecatedProperties[ name ]
- )
+ )
: filtered;
}
diff --git a/plugins/woocommerce/client/admin/client/utils/index.js b/plugins/woocommerce/client/admin/client/utils/index.js
index 372946f0fc2..644eda6d566 100644
--- a/plugins/woocommerce/client/admin/client/utils/index.js
+++ b/plugins/woocommerce/client/admin/client/utils/index.js
@@ -21,7 +21,7 @@ export function getUrlParams( locationSearch ) {
const key = chunks[ 0 ];
let value = decodeURIComponent( chunks[ 1 ] );
value = isNaN( Number( value ) ) ? value : Number( value );
- return ( params[ key ] = value ), params;
+ return ( ( params[ key ] = value ), params );
}, {} );
}
return {};
diff --git a/plugins/woocommerce/client/admin/client/utils/static-form-helper.ts b/plugins/woocommerce/client/admin/client/utils/static-form-helper.ts
index a30189ecbbc..bff646e5cd0 100644
--- a/plugins/woocommerce/client/admin/client/utils/static-form-helper.ts
+++ b/plugins/woocommerce/client/admin/client/utils/static-form-helper.ts
@@ -14,8 +14,9 @@ export function staticFormDataToObject( elForm: HTMLFormElement ) {
field.type === 'submit' ||
field.type === 'hidden' ||
! sKey
- )
+ ) {
continue;
+ }
switch ( field.type ) {
case 'checkbox':
values[ sKey ] = +( field as HTMLInputElement ).checked;
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/__tests__/use-update-banner.test.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/__tests__/use-update-banner.test.ts
index 415abf10a36..b40a1b2b179 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/__tests__/use-update-banner.test.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/__tests__/use-update-banner.test.ts
@@ -17,7 +17,6 @@ if (
typeof ( globalThis as { TextEncoder?: unknown } ).TextEncoder ===
'undefined'
) {
- // eslint-disable-next-line @typescript-eslint/no-var-requires
const { TextEncoder: NodeTextEncoder } = require( 'util' );
(
globalThis as unknown as { TextEncoder: typeof TextEncoder }
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/email-validation.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/email-validation.ts
index f850675f6f7..4385a9ba347 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/email-validation.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/email-validation.ts
@@ -110,7 +110,9 @@ const emailValidationRule: EmailContentValidationRule = {
const wooCommerceData = getWooCommerceData();
const email = wooCommerceData?.sender_settings?.from_address ?? '';
- if ( ! email.trim() ) return false;
+ if ( ! email.trim() ) {
+ return false;
+ }
return ! isValidEmail( email.trim() );
},
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 2b208922d9d..4b9320fd00a 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
@@ -175,7 +175,7 @@ export function useApplyUpdate(
: __(
'Update applied · customizations preserved',
'woocommerce'
- );
+ );
void createSuccessNotice( successMessage, {
type: 'snackbar',
actions: [
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-update-banner.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-update-banner.ts
index 82ccf226e42..822d4d3aa42 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-update-banner.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/hooks/use-update-banner.ts
@@ -149,7 +149,7 @@ export function useUpdateBanner(): UseUpdateBannerResult {
kind: 'postType',
name: 'woo_email',
id,
- } )
+ } )
: undefined;
const canUpdate = canUpdateRaw === false ? false : true;
@@ -183,7 +183,7 @@ export function useUpdateBanner(): UseUpdateBannerResult {
} | null;
};
- const meta = postId !== null ? record?.meta ?? null : null;
+ const meta = postId !== null ? ( record?.meta ?? null ) : null;
const status =
meta && typeof meta._wc_email_template_status === 'string'
? ( meta._wc_email_template_status as string )
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/review-drawer.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/review-drawer.tsx
index db8f83d66cc..4ca2494d1c8 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/review-drawer.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/review-drawer.tsx
@@ -127,7 +127,7 @@ const ConflictsGroup = ( {
conflict.block,
conflict.occurrence,
conflict.total
- )
+ )
: conflict.block;
return (
@@ -275,7 +275,7 @@ const AutoResolvedGroup = ( {
entry.block,
entry.occurrence,
entry.total
- )
+ )
: entry.block;
return (
<AutoResolvedItem
@@ -458,9 +458,9 @@ export const ReviewDrawer = ( {
const totalChanges = summary
? summary.copy_changes.length +
- summary.added_blocks.length +
- summary.removed_blocks.length +
- summary.structural_changes.length
+ summary.added_blocks.length +
+ summary.removed_blocks.length +
+ summary.structural_changes.length
: 0;
const subtitle = sprintf(
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/save-button.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/save-button.tsx
index 19ad22c7409..aa89e58ffba 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/save-button.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/save-button.tsx
@@ -47,8 +47,7 @@ function useSaveShortcutTakeover( onSave: () => void, isDisabled: boolean ) {
description: select(
keyboardShortcutsStore
).getShortcutDescription( 'core/editor/save' ) as
- | string
- | undefined,
+ string | undefined,
} ),
[]
);
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/tracks/build-shared-payload.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/tracks/build-shared-payload.ts
index 1c0ed8ad9e9..e33c663bf70 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/tracks/build-shared-payload.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/tracks/build-shared-payload.ts
@@ -23,8 +23,7 @@ export type AppliedFrom =
| typeof APPLIED_FROM_SELECTIVE_REST;
export type ViewedFrom =
- | typeof VIEWED_FROM_EDITOR_BANNER
- | typeof VIEWED_FROM_EMAIL_LIST;
+ typeof VIEWED_FROM_EDITOR_BANNER | typeof VIEWED_FROM_EMAIL_LIST;
/**
* Shape of the base payload shared by every block-email update Tracks event
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/update-banner.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/update-banner.tsx
index db4659793de..b977660ff38 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/update-banner.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/update-banner.tsx
@@ -310,7 +310,7 @@ export function UpdateBanner( {
'woocommerce'
),
expandableLines.length
- ) }
+ ) }
</button>
{ expanded && (
<ul
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/customer-notification-form/test/index.test.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/customer-notification-form/test/index.test.js
index fd7a8e52343..29867a53256 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/customer-notification-form/test/index.test.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/customer-notification-form/test/index.test.js
@@ -53,7 +53,6 @@ jest.mock( '@wordpress/components', () => ( {
) ),
TextareaControl: ( props ) => (
<div data-testid="textarea-control">
- { /* eslint-disable-next-line jsx-a11y/label-has-associated-control */ }
<label htmlFor="customer-note">{ props.label }</label>
<textarea
id="customer-note"
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-editor.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-editor.tsx
index 31fee67280c..d7dcc0cb365 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-editor.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-editor.tsx
@@ -96,12 +96,15 @@ export default function FulfillmentEditor( {
}, [ isEditing, expanded ] );
const handleChevronClick = () => {
- if ( isEditing ) return;
+ if ( isEditing ) {
+ return;
+ }
if (
itemsNotInAnyFulfillment.length === 0 &&
fulfillments.length === 1
- )
+ ) {
return;
+ }
if ( ! expanded ) {
onExpand();
} else {
@@ -140,9 +143,12 @@ export default function FulfillmentEditor( {
sprintf(
isEditing
? /* translators: %s: Fulfillment ID */
- __( 'Editing fulfillment #%s', 'woocommerce' )
+ __(
+ 'Editing fulfillment #%s',
+ 'woocommerce'
+ )
: /* translators: %s: Fulfillment ID */
- __( 'Fulfillment #%s', 'woocommerce' ),
+ __( 'Fulfillment #%s', 'woocommerce' ),
( index + 1 ).toString()
)
}
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-line-item.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-line-item.tsx
index e339937e407..547ff90fe01 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-line-item.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/fulfillments/fulfillment-line-item.tsx
@@ -67,8 +67,7 @@ export default function FulfillmentLineItem( {
...storeCurrency,
symbol: decodeEntities( symbol ),
symbolPosition: storeCurrency.symbolPosition as
- | SymbolPosition
- | undefined,
+ SymbolPosition | undefined,
code: orderCurrencyCode,
} ).formatAmount( total );
};
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/test/shipment-tracking-number-form.test.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/test/shipment-tracking-number-form.test.js
index 9335c81c3b4..c8d4cb3bc65 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/test/shipment-tracking-number-form.test.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/shipment-form/test/shipment-tracking-number-form.test.js
@@ -139,12 +139,12 @@ describe( 'ShipmentTrackingNumberForm', () => {
// Check for the error container with proper ARIA attributes
const errorContainer = screen.getByRole( 'alert' );
expect( errorContainer ).toBeInTheDocument();
- // eslint-disable-next-line testing-library/no-wait-for-multiple-assertions
+
expect( errorContainer.getAttribute( 'id' ) ).toMatch(
/^tracking-number-error/
);
// role="alert" implicitly sets aria-live="assertive", so explicit aria-live should not be present
- // eslint-disable-next-line testing-library/no-wait-for-multiple-assertions
+
expect( errorContainer ).not.toHaveAttribute( 'aria-live' );
// Check that the error message is within the error label component
@@ -152,7 +152,7 @@ describe( 'ShipmentTrackingNumberForm', () => {
'No information found for this tracking number. Check the number or enter the details manually.',
{ selector: '.woocommerce-fulfillment-error-label__text' }
);
- // eslint-disable-next-line testing-library/no-wait-for-multiple-assertions
+
expect( errorLabel ).toBeInTheDocument();
} );
} );
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillment-drawer/fulfillment-drawer.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillment-drawer/fulfillment-drawer.tsx
index 6fdec955b7f..5dbec3054d5 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillment-drawer/fulfillment-drawer.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillment-drawer/fulfillment-drawer.tsx
@@ -64,7 +64,9 @@ const FulfillmentDrawer: React.FC< Props > = ( {
// Handle keyboard navigation: Escape to close and focus trapping
useEffect( () => {
const handleKeyDown = ( event: KeyboardEvent ) => {
- if ( ! isOpen ) return;
+ if ( ! isOpen ) {
+ return;
+ }
// Close drawer on Escape key
if ( event.key === 'Escape' ) {
@@ -75,13 +77,17 @@ const FulfillmentDrawer: React.FC< Props > = ( {
// Focus trap: Only trap Tab navigation, allow all other keys (including scrolling)
if ( event.key === 'Tab' ) {
const drawerElement = drawerRef.current;
- if ( ! drawerElement ) return;
+ if ( ! drawerElement ) {
+ return;
+ }
const focusableElements = drawerElement.querySelectorAll(
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])'
);
- if ( focusableElements.length === 0 ) return;
+ if ( focusableElements.length === 0 ) {
+ return;
+ }
const firstElement = focusableElements[ 0 ] as HTMLElement;
const lastElement = focusableElements[
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillments-card/card.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillments-card/card.tsx
index 2d65c92d51f..d30f271cbad 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillments-card/card.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/fulfillments/components/user-interface/fulfillments-card/card.tsx
@@ -51,7 +51,7 @@ export default function FulfillmentCard( {
onKeyUp: handleKeyUp,
role: 'button',
tabIndex: 0,
- }
+ }
: {} ) }
>
{ header }
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/marketplace-orders-promo/index.tsx b/plugins/woocommerce/client/admin/client/wp-admin-scripts/marketplace-orders-promo/index.tsx
index 0c10e79e4c4..a03100fc5c3 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/marketplace-orders-promo/index.tsx
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/marketplace-orders-promo/index.tsx
@@ -74,7 +74,7 @@ if ( data && data.promotion && anchor && anchor.parentNode ) {
},
body: JSON.stringify( { id: promoId } ),
} ).catch( () => {} );
- }
+ }
: undefined;
createRoot( root ).render(
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-milestone-easter-egg/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-milestone-easter-egg/index.js
index 0495a48f14a..68802091e68 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-milestone-easter-egg/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-milestone-easter-egg/index.js
@@ -189,10 +189,14 @@
/* -- Load pinata -------------------------------------------------------- */
async function loadPinata( variantKey ) {
- if ( ! VARIANTS[ variantKey ] ) return;
+ if ( ! VARIANTS[ variantKey ] ) {
+ return;
+ }
var svgText = SVG_DATA[ variantKey ];
- if ( ! svgText ) return;
+ if ( ! svgText ) {
+ return;
+ }
active = VARIANTS[ variantKey ];
var v = active;
@@ -208,7 +212,9 @@
var firstEl =
svg &&
svg.querySelector( 'path,circle,ellipse,polygon,rect,polyline' );
- if ( firstEl ) protectedEls.add( firstEl );
+ if ( firstEl ) {
+ protectedEls.add( firstEl );
+ }
svg.removeAttribute( 'width' );
svg.removeAttribute( 'height' );
svg.setAttribute( 'preserveAspectRatio', 'xMidYMid meet' );
@@ -262,11 +268,21 @@
} catch ( _ ) {
return;
}
- if ( bb.width === 0 && bb.height === 0 ) return;
- if ( bb.x < minX ) minX = bb.x;
- if ( bb.y < minY ) minY = bb.y;
- if ( bb.x + bb.width > maxX ) maxX = bb.x + bb.width;
- if ( bb.y + bb.height > maxY ) maxY = bb.y + bb.height;
+ if ( bb.width === 0 && bb.height === 0 ) {
+ return;
+ }
+ if ( bb.x < minX ) {
+ minX = bb.x;
+ }
+ if ( bb.y < minY ) {
+ minY = bb.y;
+ }
+ if ( bb.x + bb.width > maxX ) {
+ maxX = bb.x + bb.width;
+ }
+ if ( bb.y + bb.height > maxY ) {
+ maxY = bb.y + bb.height;
+ }
} );
if ( isFinite( minY ) ) {
_contentBB = {
@@ -316,12 +332,16 @@
Math.round( parseFloat( c.getAttribute( 'cx' ) ) / 15 ) +
',' +
Math.round( parseFloat( c.getAttribute( 'cy' ) ) / 15 );
- if ( ! posMap[ key ] ) posMap[ key ] = [];
+ if ( ! posMap[ key ] ) {
+ posMap[ key ] = [];
+ }
posMap[ key ].push( c );
} );
Object.keys( posMap ).forEach( function ( k ) {
var group = posMap[ k ];
- if ( group.length < 2 ) return;
+ if ( group.length < 2 ) {
+ return;
+ }
var sumCx = 0,
sumCy = 0;
group.forEach( function ( c ) {
@@ -354,7 +374,9 @@
[].slice
.call( svg.querySelectorAll( 'circle' ) )
.forEach( function ( c ) {
- if ( eyeElsSet.has( c ) ) return;
+ if ( eyeElsSet.has( c ) ) {
+ return;
+ }
var cx = parseFloat( c.getAttribute( 'cx' ) ),
cy = parseFloat( c.getAttribute( 'cy' ) );
var near = eyeGroups.some( function ( g ) {
@@ -365,7 +387,9 @@
) < 100
);
} );
- if ( ! near ) return;
+ if ( ! near ) {
+ return;
+ }
protectedEls.add( c );
eyeEls.push( c );
eyeElsSet.add( c );
@@ -430,7 +454,9 @@
}
var existingBoom = svg.querySelector( '#egg-boom-text' );
- if ( existingBoom ) existingBoom.remove();
+ if ( existingBoom ) {
+ existingBoom.remove();
+ }
var allClassEls = [];
v.classes.forEach( function ( sel ) {
allClassEls = allClassEls.concat(
@@ -492,15 +518,20 @@
/* -- Init --------------------------------------------------------------- */
/* -- Blink -------------------------------------------------------------- */
function startBlink() {
- if ( ! eyeGroups.length ) return;
+ if ( ! eyeGroups.length ) {
+ return;
+ }
blinkScaleY = 1;
function animTo( from, to, dur, done ) {
var t0 = Date.now();
( function tick() {
var p = Math.min( 1, ( Date.now() - t0 ) / dur );
blinkScaleY = from + ( to - from ) * p;
- if ( p < 1 ) requestAnimationFrame( tick );
- else if ( done ) done();
+ if ( p < 1 ) {
+ requestAnimationFrame( tick );
+ } else if ( done ) {
+ done();
+ }
} )();
}
function doBlink() {
@@ -517,8 +548,9 @@
}
function updatePupil() {
- if ( ! eyeGroups.length || ! overlayEl || ! overlayEl.parentNode )
+ if ( ! eyeGroups.length || ! overlayEl || ! overlayEl.parentNode ) {
return;
+ }
var lastOx = 0,
lastOy = 0;
eyeGroups.forEach( function ( group ) {
@@ -528,7 +560,9 @@
} catch ( _ ) {
return;
}
- if ( ! ctm ) return;
+ if ( ! ctm ) {
+ return;
+ }
var scale = Math.sqrt( ctm.a * ctm.a + ctm.b * ctm.b );
var esx = ctm.a * group.pupilCx + ctm.c * group.pupilCy + ctm.e;
var esy = ctm.b * group.pupilCx + ctm.d * group.pupilCy + ctm.f;
@@ -569,7 +603,9 @@
/* -- Physics ------------------------------------------------------------ */
function update() {
- if ( ! dropped ) return;
+ if ( ! dropped ) {
+ return;
+ }
var proxTorque = 0;
if ( mActive ) {
@@ -577,16 +613,21 @@
dx = mx - c.x,
d = Math.hypot( dx, my - c.y ),
R = c.r * 2.69;
- if ( d < R && d > 1 )
+ if ( d < R && d > 1 ) {
proxTorque = -( dx / d ) * Math.pow( 1 - d / R, 2 ) * 0.0006;
+ }
}
mainOmega =
( mainOmega +
( -settings.gravity * Math.sin( mainAngle ) + proxTorque ) ) *
settings.damp;
- if ( mainOmega > 0.06 ) mainOmega = 0.06;
- if ( mainOmega < -0.06 ) mainOmega = -0.06;
+ if ( mainOmega > 0.06 ) {
+ mainOmega = 0.06;
+ }
+ if ( mainOmega < -0.06 ) {
+ mainOmega = -0.06;
+ }
mainAngle += mainOmega;
var _maxSwing =
active && active.maxSwing !== null ? active.maxSwing : 0.9;
@@ -602,7 +643,9 @@
var pcx = _contentBB.centerX,
pcy = _contentBB.centerY;
COLOR_LAYERS.forEach( function ( layer ) {
- if ( ! layer.els.length ) return;
+ if ( ! layer.els.length ) {
+ return;
+ }
var target =
-mainOmega *
layer.velMult *
@@ -696,7 +739,9 @@
/* -- Confetti ----------------------------------------------------------- */
async function loadConfettiShapes() {
var text = SVG_DATA.confetti;
- if ( ! text ) return;
+ if ( ! text ) {
+ return;
+ }
var tmp = document.createElement( 'div' );
tmp.style.cssText =
'position:absolute;left:-9999px;top:-9999px;visibility:hidden';
@@ -713,7 +758,9 @@
}
var d = p.getAttribute( 'd' ),
fill = p.getAttribute( 'fill' ) || '#7c5cf0';
- if ( ! d || bb.width <= 0 || bb.height <= 0 ) return;
+ if ( ! d || bb.width <= 0 || bb.height <= 0 ) {
+ return;
+ }
var aspect =
Math.max( bb.width, bb.height ) /
Math.max( 0.0001, Math.min( bb.width, bb.height ) );
@@ -748,7 +795,9 @@
} else {
activeShapes = ALL_SHAPES.slice();
}
- if ( ! activeShapes.length ) activeShapes = ALL_SHAPES.slice();
+ if ( ! activeShapes.length ) {
+ activeShapes = ALL_SHAPES.slice();
+ }
}
function rebuildColumns() {
@@ -765,7 +814,9 @@
}
function spawnBurst( x, y, count, opts ) {
- if ( ! settings.cfOn || ! activeShapes.length ) return;
+ if ( ! settings.cfOn || ! activeShapes.length ) {
+ return;
+ }
count = count || settings.cfCount;
var upBias = ( opts && opts.upBias ) || 2.5;
for ( var i = 0; i < count; i++ ) {
@@ -813,7 +864,9 @@
}
if ( ! settings.cfPile ) {
- if ( p.y - p.r > H + 50 ) live.splice( i, 1 );
+ if ( p.y - p.r > H + 50 ) {
+ live.splice( i, 1 );
+ }
continue;
}
@@ -824,8 +877,9 @@
ftop = H;
for ( var dc = -hc; dc <= hc; dc++ ) {
var nc = cc + dc;
- if ( nc >= 0 && nc < columns.length && columns[ nc ] < ftop )
+ if ( nc >= 0 && nc < columns.length && columns[ nc ] < ftop ) {
ftop = columns[ nc ];
+ }
}
if ( p.y + r >= ftop ) {
@@ -833,7 +887,9 @@
fy = columns[ cc ],
rr = Math.max( 2, hc + 1 );
for ( var dc2 = -rr; dc2 <= rr; dc2++ ) {
- if ( ! dc2 ) continue;
+ if ( ! dc2 ) {
+ continue;
+ }
var nc2 = cc + dc2;
if (
nc2 >= 0 &&
@@ -844,27 +900,36 @@
fy = columns[ nc2 ];
}
}
- if ( fc !== cc )
+ if ( fc !== cc ) {
p.x =
( fc + 0.5 ) * COLUMN_W +
( Math.random() - 0.5 ) * COLUMN_W;
+ }
p.y = fy - r;
p.rotVel = 0;
var sp = hc + 2;
for ( var dc3 = -sp; dc3 <= sp; dc3++ ) {
var nc3 = fc + dc3;
- if ( nc3 < 0 || nc3 >= columns.length ) continue;
+ if ( nc3 < 0 || nc3 >= columns.length ) {
+ continue;
+ }
var dx3 = dc3 * COLUMN_W;
- if ( Math.abs( dx3 ) > r2 ) continue;
+ if ( Math.abs( dx3 ) > r2 ) {
+ continue;
+ }
var nt =
p.y +
r -
Math.sqrt( Math.max( 0, r2 * r2 - dx3 * dx3 ) );
- if ( nt < columns[ nc3 ] ) columns[ nc3 ] = nt;
+ if ( nt < columns[ nc3 ] ) {
+ columns[ nc3 ] = nt;
+ }
}
settled.push( p );
live.splice( i, 1 );
- if ( settled.length > SETTLED_CAP ) settled.splice( 0, 60 );
+ if ( settled.length > SETTLED_CAP ) {
+ settled.splice( 0, 60 );
+ }
} else if ( p.y - p.r > H + 50 ) {
live.splice( i, 1 );
}
@@ -913,7 +978,9 @@
var dpr = sizeCanvasHiDPI( bgCV );
bgCtx.setTransform( dpr, 0, 0, dpr, 0, 0 );
bgCtx.clearRect( 0, 0, window.innerWidth, window.innerHeight );
- if ( ! dropped ) return;
+ if ( ! dropped ) {
+ return;
+ }
var c = pinataCentre();
var strOff =
active && active.stringOffsetX !== null ? active.stringOffsetX : 10;
@@ -940,16 +1007,21 @@
var allLayers = COLOR_LAYERS.filter( function ( l ) {
return l.els.length > 0;
} );
- if ( HEAD_TOP_LAYER && HEAD_TOP_LAYER.els.length > 0 )
+ if ( HEAD_TOP_LAYER && HEAD_TOP_LAYER.els.length > 0 ) {
allLayers.push( HEAD_TOP_LAYER );
+ }
var eligible = [];
allLayers.forEach( function ( layer ) {
layer.els.forEach( function ( el ) {
- if ( ! protectedEls.has( el ) ) eligible.push( { layer, el } );
+ if ( ! protectedEls.has( el ) ) {
+ eligible.push( { layer, el } );
+ }
} );
} );
- if ( ! eligible.length ) return;
+ if ( ! eligible.length ) {
+ return;
+ }
var pick = eligible[ Math.floor( Math.random() * eligible.length ) ];
var layer = pick.layer;
@@ -974,9 +1046,13 @@
}
layer.els.splice( idx, 1 );
- if ( el.parentNode ) el.parentNode.removeChild( el );
+ if ( el.parentNode ) {
+ el.parentNode.removeChild( el );
+ }
- if ( ! d || ! bb || ! ctm || bb.width === 0 ) return;
+ if ( ! d || ! bb || ! ctm || bb.width === 0 ) {
+ return;
+ }
var svgCx = bb.x + bb.width / 2;
var svgCy = bb.y + bb.height / 2;
@@ -1007,13 +1083,17 @@
p.x += p.vx;
p.y += p.vy;
p.rot += p.rotVel;
- if ( p.y > window.innerHeight + 300 ) fallingPieces.splice( i, 1 );
+ if ( p.y > window.innerHeight + 300 ) {
+ fallingPieces.splice( i, 1 );
+ }
}
}
/* -- Cursor ------------------------------------------------------------- */
function updateCursor() {
- if ( ! mActive ) return;
+ if ( ! mActive ) {
+ return;
+ }
var rawVx = mx - lastMx;
mouseVx = mouseVx * 0.7 + rawVx * 0.3;
lastMx = mx;
@@ -1043,9 +1123,13 @@
/* -- Hits --------------------------------------------------------------- */
function tryHit( cx, cy ) {
- if ( ! dropped ) return;
+ if ( ! dropped ) {
+ return;
+ }
var c = pinataCentre();
- if ( Math.hypot( cx - c.x, cy - c.y ) > c.r * 1.68 ) return;
+ if ( Math.hypot( cx - c.x, cy - c.y ) > c.r * 1.68 ) {
+ return;
+ }
mainOmega +=
( c.x - cx ) * settings.hit +
( Math.random() - 0.5 ) * settings.hit * 5;
@@ -1058,8 +1142,9 @@
squishAngle = Math.atan2( c.y - cy, c.x - cx );
squishVel += 0.9;
var boomEl = document.getElementById( 'egg-boom-text' );
- if ( boomEl && boomEl.style.opacity === '0' )
+ if ( boomEl && boomEl.style.opacity === '0' ) {
boomEl.style.opacity = '1';
+ }
}
/* -- Main loop ---------------------------------------------------------- */
@@ -1078,10 +1163,14 @@
async function init() {
stick.innerHTML = SVG_DATA.stick || '';
ALL_SHAPES = [];
- if ( ! reducedMotion ) await loadConfettiShapes();
+ if ( ! reducedMotion ) {
+ await loadConfettiShapes();
+ }
filterShapes();
await loadPinata( settings.variant );
- if ( ! reducedMotion ) startBlink();
+ if ( ! reducedMotion ) {
+ startBlink();
+ }
dropped = true;
if ( reducedMotion ) {
applyRotation();
@@ -1122,7 +1211,9 @@
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
)
);
- if ( ! focusable.length ) return;
+ if ( ! focusable.length ) {
+ return;
+ }
var first = focusable[ 0 ],
last = focusable[ focusable.length - 1 ];
var activeElement = overlayEl.ownerDocument.activeElement;
@@ -1144,9 +1235,15 @@
tryHit( e.clientX, e.clientY );
return;
}
- if ( t.closest( '#egg-close-btn' ) ) return;
- if ( t.closest( '.egg-celebrate-btn' ) ) return;
- if ( t.closest( '.egg-opt-out-btn' ) ) return;
+ if ( t.closest( '#egg-close-btn' ) ) {
+ return;
+ }
+ if ( t.closest( '.egg-celebrate-btn' ) ) {
+ return;
+ }
+ if ( t.closest( '.egg-opt-out-btn' ) ) {
+ return;
+ }
tryHit( e.clientX, e.clientY );
}
@@ -1177,10 +1274,16 @@
document.removeEventListener( 'click', onDocClick );
document.removeEventListener( 'keydown', onKeyDown );
window.removeEventListener( 'resize', onResize );
- if ( svgDefsEl && svgDefsEl.parentNode ) svgDefsEl.remove();
- if ( overlayEl && overlayEl.parentNode ) overlayEl.remove();
+ if ( svgDefsEl && svgDefsEl.parentNode ) {
+ svgDefsEl.remove();
+ }
+ if ( overlayEl && overlayEl.parentNode ) {
+ overlayEl.remove();
+ }
var st = document.getElementById( 'woo-egg-style' );
- if ( st ) st.remove();
+ if ( st ) {
+ st.remove();
+ }
if ( _previousFocus && typeof _previousFocus.focus === 'function' ) {
_previousFocus.focus();
}
@@ -1327,7 +1430,9 @@
var firstFocusable = el.querySelector(
'.egg-celebrate-btn, #egg-close-btn'
);
- if ( firstFocusable ) firstFocusable.focus();
+ if ( firstFocusable ) {
+ firstFocusable.focus();
+ }
bgCV = document.getElementById( 'egg-bg' );
bgCtx = bgCV.getContext( '2d' );
@@ -1396,8 +1501,11 @@
e2 * maxScale +
') translate(-391 -381)'
);
- if ( t < 1 ) requestAnimationFrame( animReveal );
- else overlayEl.style.clipPath = 'none';
+ if ( t < 1 ) {
+ requestAnimationFrame( animReveal );
+ } else {
+ overlayEl.style.clipPath = 'none';
+ }
} )();
}
@@ -1470,10 +1578,13 @@
if (
params.get( 'page' ) !== 'wc-orders' ||
params.get( 'action' ) !== 'edit'
- )
+ ) {
return;
+ }
var orderId = parseInt( params.get( 'id' ), 10 );
- if ( ! orderId || shown[ orderId ] || ! milestones[ orderId ] ) return;
+ if ( ! orderId || shown[ orderId ] || ! milestones[ orderId ] ) {
+ return;
+ }
shown[ orderId ] = true;
showOverlay(
Object.assign( {}, milestones[ orderId ], { _orderId: orderId } )
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-tracking/exit-order-page.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-tracking/exit-order-page.ts
index c4a5cde5f95..bbce1a4d187 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-tracking/exit-order-page.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/order-tracking/exit-order-page.ts
@@ -39,7 +39,7 @@ if ( forms?.post || forms?.order ) {
forms?.post || forms?.order
? staticFormDataToObject(
( forms?.post || forms?.order ) as HTMLFormElement
- )
+ )
: {};
for ( const key of Object.keys( formData ) ) {
const value =
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 c770a6ac677..325d5d738f7 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
@@ -154,7 +154,7 @@ export const PaymentPromotionRow = ( {
subTitleContent ? (
<div
className="pre-install-payment-gateway__subtitle"
- // eslint-disable-next-line react/no-danger -- innerHTML from the element with class name: gateway-subtitle.
+
dangerouslySetInnerHTML={ sanitizeHTMLForReact(
subTitleContent
) }
@@ -219,7 +219,7 @@ export const PaymentPromotionRow = ( {
column.className.includes( 'renewals' )
? {
__html: column.html,
- }
+ }
: sanitizeHTMLForReact( column.html )
}
></td>
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/test/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/test/index.js
index fad6df8672c..778fdaa0f9d 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/test/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/dismiss-modal/test/index.js
@@ -27,7 +27,9 @@ describe( 'Option Save events in DismissModal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: "I don't need this" } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: "I don't need this" } )
+ );
await waitFor( () =>
expect( spyUpdateOptions ).toHaveBeenCalledWith( {
@@ -55,7 +57,9 @@ describe( 'Option Save events in DismissModal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: 'Remind me later' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Remind me later' } )
+ );
await waitFor( () =>
expect( spyUpdateOptions ).toHaveBeenCalledWith( {
@@ -85,7 +89,9 @@ describe( 'Tracking events in DismissModal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: "I don't need this" } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: "I don't need this" } )
+ );
await waitFor( () =>
expect( trackElementClicked ).toHaveBeenCalledWith(
@@ -108,7 +114,9 @@ describe( 'Tracking events in DismissModal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: 'Remind me later' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Remind me later' } )
+ );
await waitFor( () =>
expect( trackElementClicked ).toHaveBeenCalledWith(
@@ -136,7 +144,9 @@ describe( 'Dismissing modal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: "I don't need this" } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: "I don't need this" } )
+ );
await waitFor( () =>
expect( getByTestId( 'print-label' ) ).not.toBeVisible()
@@ -160,7 +170,9 @@ describe( 'Dismissing modal', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: 'Remind me later' } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: 'Remind me later' } )
+ );
await waitFor( () =>
expect( getByTestId( 'print-label' ) ).not.toBeVisible()
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
index e44573d23db..8db154d93a6 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js
@@ -448,7 +448,10 @@ export class ShippingBanner extends Component {
<img
className="wc-admin-shipping-banner-illustration"
src={ wcAssetUrl + 'images/shippingillustration.svg' }
- alt={ __( 'Shipping ', 'woocommerce' ) }
+ alt={
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __( 'Shipping ', 'woocommerce' )
+ }
/>
<div className="wc-admin-shipping-banner-blob">
<h3>{ headline }</h3>
@@ -549,11 +552,11 @@ export default compose(
? __(
'Print discounted shipping labels with a click, now with the dedicated plugin!',
'woocommerce'
- )
+ )
: __(
'Print discounted shipping labels with a click.',
'woocommerce'
- );
+ );
return {
isRequesting,
isJetpackConnected: isJetpackConnected(),
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
index 5e9b2014d32..7accd480805 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/test/index.js
@@ -91,7 +91,9 @@ describe( 'Tracking clicks in shippingBanner', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect( recordEvent ).toHaveBeenCalledWith(
@@ -122,7 +124,7 @@ describe( 'Tracking clicks in shippingBanner', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'link', { name: /WooCommerce Shipping/ } )
);
@@ -151,7 +153,7 @@ describe( 'Tracking clicks in shippingBanner', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', { name: 'Close Print Label Banner.' } )
);
@@ -199,7 +201,7 @@ describe( 'Create shipping label button', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', {
name: actionButtonLabel,
} )
@@ -228,7 +230,7 @@ describe( 'Create shipping label button', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', {
name: actionButtonLabel,
} )
@@ -256,7 +258,7 @@ describe( 'Create shipping label button', () => {
expect( reloadButton ).toBeInTheDocument();
expect( reloadButton ).not.toHaveClass( 'is-busy' );
- userEvent.click( reloadButton );
+ await userEvent.click( reloadButton );
expect( window.location.reload ).toHaveBeenCalledWith( true );
} );
@@ -280,7 +282,7 @@ describe( 'Create shipping label button', () => {
/>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', {
name: actionButtonLabel,
} )
@@ -326,7 +328,7 @@ describe( 'Create shipping label button', () => {
</Fragment>
);
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', {
name: actionButtonLabel,
} )
@@ -430,7 +432,7 @@ describe( 'Create shipping label button', () => {
);
// Initiate the loading of WCS assets on first click.
- userEvent.click(
+ await userEvent.click(
getByRole( 'button', {
name: actionButtonLabel,
} )
@@ -483,7 +485,9 @@ describe( 'In the process of installing, activating, loading assets for WooComme
getByRole( 'button', { name: 'Close Print Label Banner.' } )
).toBeEnabled();
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -538,7 +542,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -573,7 +579,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -609,7 +617,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -642,7 +652,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -677,7 +689,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -708,7 +722,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -741,7 +757,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -755,7 +773,7 @@ describe( 'Setup error message', () => {
).not.toHaveClass( 'is-busy' );
} );
- it( 'should not set busy state when isRequesting is true', () => {
+ it( 'should not set busy state when isRequesting is true', async () => {
const actionButtonLabel = 'Create shipping label';
const installPluginsMock = jest.fn();
@@ -773,7 +791,9 @@ describe( 'Setup error message', () => {
/>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
expect(
getByRole( 'button', { name: actionButtonLabel } )
@@ -817,7 +837,9 @@ describe( 'Setup error message', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () =>
expect(
@@ -924,7 +946,9 @@ describe( 'If incompatible WCS&T is active', () => {
</Fragment>
);
- userEvent.click( getByRole( 'button', { name: actionButtonLabel } ) );
+ await userEvent.click(
+ getByRole( 'button', { name: actionButtonLabel } )
+ );
await waitFor( () => {
expect( installPlugins ).toHaveBeenCalledWith( [ wcsPluginSlug ] );
@@ -940,7 +964,7 @@ describe( 'If incompatible WCS&T is active', () => {
const reloadButton = await waitFor( () =>
getByRole( 'button', { name: 'Reload page' } )
);
- userEvent.click( reloadButton );
+ await userEvent.click( reloadButton );
expect( window.location.reload ).toHaveBeenCalledWith( true );
} );
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/global.d.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/global.d.ts
index 4ae80f746ee..2935cb23896 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/global.d.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/global.d.ts
@@ -1,2 +1,2 @@
declare const productScreen: { name: string };
-declare const tinymce: import('tinymce').EditorManager;
+declare const tinymce: import( 'tinymce' ).EditorManager;
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/shared.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/shared.ts
index 6b5033fe035..107eabb4359 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/shared.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/shared.ts
@@ -369,26 +369,26 @@ const attachProductTagsTracks = () => {
addTagsDeleteTracks
);
- document
- .querySelector( '.tagadd' )
- ?.addEventListener( 'click', ( /* event: Event */ ) => {
- const tagInput = document.querySelector< HTMLInputElement >(
- '#new-tag-product_tag'
- );
- if ( tagInput && tagInput.value && tagInput.value.length > 0 ) {
- recordEvent( 'product_tags_add', {
- page: 'product',
- tag_string_length: tagInput.value.length,
- tag_list_size:
- ( document.querySelector( '.tagchecklist' )?.children
- .length || 0 ) + 1,
- most_used: false,
- } );
- setTimeout( () => {
- addTagsDeleteTracks();
- }, 500 );
- }
- } );
+ document.querySelector( '.tagadd' )?.addEventListener( 'click', (
+ /* event: Event */
+ ) => {
+ const tagInput = document.querySelector< HTMLInputElement >(
+ '#new-tag-product_tag'
+ );
+ if ( tagInput && tagInput.value && tagInput.value.length > 0 ) {
+ recordEvent( 'product_tags_add', {
+ page: 'product',
+ tag_string_length: tagInput.value.length,
+ tag_list_size:
+ ( document.querySelector( '.tagchecklist' )?.children
+ .length || 0 ) + 1,
+ most_used: false,
+ } );
+ setTimeout( () => {
+ addTagsDeleteTracks();
+ }, 500 );
+ }
+ } );
function addMostUsedTagEventListener( event: Event ) {
recordEvent( 'product_tags_add', {
@@ -474,7 +474,7 @@ const getUsedForVariationsAttributesCount = () =>
?.value === 'variable'
? document.querySelectorAll(
'input[name^="attribute_variation"]:checked'
- ).length
+ ).length
: 0;
/**
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/utils.ts b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/utils.ts
index b6e5306983f..c1067db2a45 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/utils.ts
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/product-tracking/utils.ts
@@ -16,7 +16,9 @@ export function attachEventListenerToParentForChildren(
) {
const parent = document.querySelector( parentQuery );
- if ( ! parent ) return;
+ if ( ! parent ) {
+ return;
+ }
const eventListener = ( event: Event ) => {
children.forEach( ( { eventName, childQuery, callback } ) => {
diff --git a/plugins/woocommerce/client/admin/client/wp-admin-scripts/woo-product-usage-notice/modal.js b/plugins/woocommerce/client/admin/client/wp-admin-scripts/woo-product-usage-notice/modal.js
index 136c0fa4d70..e3ec41e2cd2 100644
--- a/plugins/woocommerce/client/admin/client/wp-admin-scripts/woo-product-usage-notice/modal.js
+++ b/plugins/woocommerce/client/admin/client/wp-admin-scripts/woo-product-usage-notice/modal.js
@@ -103,7 +103,7 @@ export default function ProductUsageNoticeModal( {
? __(
'Reactivate your subscription and benefit from:',
'woocommerce'
- )
+ )
: __( 'Purchase a subscription to benefit from:', 'woocommerce' );
const benefits = [
@@ -171,24 +171,24 @@ export default function ProductUsageNoticeModal( {
/* translators: %s is product name */
__( 'Renew %s', 'woocommerce' ),
productName
- )
+ )
: sprintf(
/* translators: %s is product name */
__( 'Subscribe to %s', 'woocommerce' ),
productName
- );
+ );
const buttonLabel = isExpired
? sprintf(
/* translators: %s is product price */
__( 'Renew for $%s', 'woocommerce' ),
productRegularPrice
- )
+ )
: sprintf(
/* translators: %s is product price */
__( 'Subscribe for $%s', 'woocommerce' ),
productRegularPrice
- );
+ );
return (
<Card className="primary">
diff --git a/plugins/woocommerce/client/admin/package.json b/plugins/woocommerce/client/admin/package.json
index 0cd1257977e..cd12971a553 100644
--- a/plugins/woocommerce/client/admin/package.json
+++ b/plugins/woocommerce/client/admin/package.json
@@ -198,7 +198,7 @@
"postcss": "catalog:tooling",
"postcss-color-function": "^4.1.0",
"postcss-loader": "4.3.x",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"promptly": "^3.2.0",
"prop-types": "^15.8.1",
"raw-loader": "4.0.x",
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 901db035224..0c026d06329 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
@@ -147,7 +147,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
// Prepare props to pass to the applyCheckoutFilter filter.
// We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { receiveCart, ...cart } = useStoreCart();
const arg = useMemo(
() => ( {
@@ -417,7 +417,7 @@ const CartLineItemRow: React.ForwardRefExoticComponent<
: __(
'Save for later',
'woocommerce'
- ) }
+ ) }
</button>
</div>
) }
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 ca5bdcd591b..b0dd9b96b31 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
@@ -397,7 +397,7 @@ const Form = <
field.key in values
? ( values[
field.key as keyof T
- ] as string )
+ ] as string )
: ''
}
onChange={ ( newValue: string ) => {
@@ -437,7 +437,7 @@ const Form = <
/>
</span>
),
- }
+ }
: {} ) }
ariaDescribedBy={ ariaDescribedBy }
value={
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/test/address-line-fields.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/test/address-line-fields.tsx
index b37c1c8a5b6..5408ccbe334 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/test/address-line-fields.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/test/address-line-fields.tsx
@@ -42,7 +42,6 @@ describe( 'AddressLineFields', () => {
it( 'should show the AddressAutocomplete component when providers are available', () => {
jest.isolateModules( () => {
const AddressLineFields =
- // eslint-disable-next-line @typescript-eslint/no-var-requires
require( '../address-line-fields' ).default;
render(
<AddressLineFields
@@ -86,7 +85,6 @@ describe( 'AddressLineFields', () => {
it( 'should show the ValidatedTextInput component when no providers are available', () => {
jest.isolateModules( () => {
const AddressLineFields =
- // eslint-disable-next-line @typescript-eslint/no-var-requires
require( '../address-line-fields' ).default;
jest.mock( '@woocommerce/settings', () => ( {
...jest.requireActual( '@woocommerce/settings' ),
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/types.ts b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/types.ts
index 480efcf2b67..7476649e2c3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/form/types.ts
@@ -36,11 +36,10 @@ export interface FormProps<
isEditing?: boolean;
}
-export interface AddressLineFieldsProps
- extends Omit<
- FormProps< AddressFormValues >,
- 'fields' | 'values' | 'onChange'
- > {
+export interface AddressLineFieldsProps extends Omit<
+ FormProps< AddressFormValues >,
+ 'fields' | 'values' | 'onChange'
+> {
// Overwriting the id for the fields.
formId: string;
// Address 1 fields and value.
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/local-pickup-select/test/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/local-pickup-select/test/index.tsx
index 49e7d18ede5..fc8b0d4ff26 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/local-pickup-select/test/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/local-pickup-select/test/index.tsx
@@ -18,18 +18,19 @@ import {
jest.mock( '@woocommerce/base-context/hooks' );
describe( 'LocalPickupSelect', () => {
- const renderPickupLocationMock = jest.fn().mockImplementation(
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- ( location, pickupLocationsCount, clientSelectedOption ) => {
- return {
- value: `${ location.rate_id }`,
- onChange: jest.fn(),
- label: `${ location.name }`,
- description: `${ location.description }`,
- clientSelectedOption,
- };
- }
- );
+ const renderPickupLocationMock = jest
+ .fn()
+ .mockImplementation(
+ ( location, pickupLocationsCount, clientSelectedOption ) => {
+ return {
+ value: `${ location.rate_id }`,
+ onChange: jest.fn(),
+ label: `${ location.name }`,
+ description: `${ location.description }`,
+ clientSelectedOption,
+ };
+ }
+ );
const defaultPackageData = generateShippingPackage( {
packageId: 0,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/order-summary/order-summary-item.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/order-summary/order-summary-item.tsx
index b4e43c06105..9b2d22f9033 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/order-summary/order-summary-item.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/order-summary/order-summary-item.tsx
@@ -57,7 +57,7 @@ const OrderSummaryItem = ( {
// Prepare props to pass to the applyCheckoutFilter filter.
// We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { receiveCart, ...cart } = useStoreCart();
const arg = useMemo(
@@ -190,13 +190,13 @@ const OrderSummaryItem = ( {
? {
itemData,
variation,
- }
+ }
: {
itemData,
variation,
shortDescription,
fullDescription,
- };
+ };
return (
<div
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-details/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-details/index.tsx
index 17296e4a2ca..c3fe9b4b2f5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-details/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-details/index.tsx
@@ -56,7 +56,7 @@ const ProductDetails = ( {
( nameForClass
? `wc-block-components-product-details__${ kebabCase(
nameForClass
- ) }`
+ ) }`
: '' );
const isLast = index === filteredDetails.length - 1;
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-image/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-image/index.tsx
index a0d84d8f8ba..c9111767a64 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-image/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/product-image/index.tsx
@@ -43,13 +43,13 @@ const ProductImage = ( {
alt: rawAlt ? decodeEntities( rawAlt ) : 'Product Image',
srcSet: image.thumbnail_srcset || undefined,
sizes: sizesAttr,
- }
+ }
: {
src: PLACEHOLDER_IMG_SRC,
alt: '',
srcSet: undefined,
sizes: undefined,
- };
+ };
return (
<img
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/shipping-rates-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/shipping-rates-control/index.tsx
index cfddefe2e81..7784248d7c9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/shipping-rates-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/shipping-rates-control/index.tsx
@@ -160,7 +160,7 @@ const ShippingRatesControl = ( {
// Prepare props to pass to the ExperimentalOrderShippingPackages slot fill.
// We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const slotFillProps = {
className,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/test/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/test/index.tsx
index f27dce56eb4..944ee5095ae 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/test/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/coupon/test/index.tsx
@@ -221,8 +221,8 @@ describe( 'TotalsCoupon', () => {
// Input should retain value and stay focused on failure
await waitFor( () => {
expect( couponInput ).toHaveValue( '5fixedcheckout' );
- expect( couponInput ).toHaveFocus();
} );
+ expect( couponInput ).toHaveFocus();
} );
it( 'handles usage limit exceeded error', async () => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/footer-item/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/footer-item/index.tsx
index 8181824a58f..59575efc06a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/footer-item/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/footer-item/index.tsx
@@ -75,7 +75,7 @@ const TotalsFooterItem = ( {
// Prepare props to pass to the applyCheckoutFilter filter.
// We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { receiveCart, ...cart } = useStoreCart();
const { isLoading } = useOrderSummaryLoadingState();
@@ -132,7 +132,7 @@ const TotalsFooterItem = ( {
/* translators: %s is a list of tax rates */
__( 'Including %s', 'woocommerce' ),
'<TaxLines/>'
- )
+ )
: __( 'Including <TaxAmount/> in taxes', 'woocommerce' );
const hasSelectedRates = hasSelectedShippingRate( cart.shippingRates );
@@ -144,7 +144,10 @@ const TotalsFooterItem = ( {
height="1em"
width="45px"
tag="span"
- ariaMessage={ __( 'Loading price… ', 'woocommerce' ) }
+ ariaMessage={
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __( 'Loading price… ', 'woocommerce' )
+ }
/>
</>
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx
index 27c9ee3bad5..e648035afbe 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/totals/shipping/shipping-address.tsx
@@ -38,9 +38,9 @@ export const ShippingAddress = (): JSX.Element => {
const deliversToLabel = hasRates
? // Translators: <address/> is the formatted shipping address.
- __( 'Delivers to <address/>', 'woocommerce' )
+ __( 'Delivers to <address/>', 'woocommerce' )
: // Translators: <address/> is the formatted shipping address.
- __( 'No delivery options available for <address/>', 'woocommerce' );
+ __( 'No delivery options available for <address/>', 'woocommerce' );
const addressComplete = hasAllFieldsForShippingRates( shippingAddress );
@@ -54,7 +54,7 @@ export const ShippingAddress = (): JSX.Element => {
const addressLabel = prefersCollection
? // Translators: <address/> is the pickup location.
- __( 'Collection from <address/>', 'woocommerce' )
+ __( 'Collection from <address/>', 'woocommerce' )
: deliversToLabel;
const title = (
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/drawer/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/drawer/index.tsx
index 4d668bcfe98..14994ba30c2 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/drawer/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/drawer/index.tsx
@@ -62,7 +62,7 @@ const CloseButtonPortal = ( {
<Icon icon={ close } />
</Button>,
closeButtonWrapper
- )
+ )
: null;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/index.tsx
index eb95249fa81..6300db72350 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/price-slider/index.tsx
@@ -242,11 +242,11 @@ const PriceSlider = ( {
? [
Math.round( targetValue / stepValue ) * stepValue,
maxPrice,
- ]
+ ]
: [
minPrice,
Math.round( targetValue / stepValue ) * stepValue,
- ];
+ ];
const values = constrainRangeSliderValues(
currentValues,
minConstraint,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/product-list/product-list.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/product-list/product-list.tsx
index 2c851a7376e..0b8d93988f9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/product-list/product-list.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/product-list/product-list.tsx
@@ -82,7 +82,6 @@ const generateQuery: GenerateQuery = ( {
*/
const extractPaginationAndSortAttributes = ( query: Query ): TotalQuery => {
- /* eslint-disable-next-line no-unused-vars */
const { order, orderby, page, per_page: perPage, ...totalQuery } = query;
return totalQuery || {};
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/product-name/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/product-name/index.tsx
index 4f977dd7385..450c05067a1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/product-name/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/product-name/index.tsx
@@ -11,8 +11,7 @@ import './style.scss';
type DisabledTagNameType = 'span' | 'h3';
-export interface ProductNameProps
- extends AnchorHTMLAttributes< HTMLAnchorElement > {
+export interface ProductNameProps extends AnchorHTMLAttributes< HTMLAnchorElement > {
/**
* If `true` renders a `span` element instead of a link
*/
@@ -63,7 +62,7 @@ export const ProductName = ( {
<DisabledTagName
className={ classes }
{ ...disabledProps }
- // eslint-disable-next-line react/no-danger
+
dangerouslySetInnerHTML={ {
__html: name,
} }
@@ -76,7 +75,7 @@ export const ProductName = ( {
href={ permalink }
target={ target }
{ ...props }
- // eslint-disable-next-line react/no-danger
+
dangerouslySetInnerHTML={ {
__html: name,
} }
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/index.tsx
index 9aa81f021fb..ff3bd778deb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/index.tsx
@@ -42,10 +42,10 @@ export const Skeleton = ( {
? {
'aria-live': 'polite',
'aria-label': ariaMessage,
- }
+ }
: {
'aria-hidden': 'true',
- } ) }
+ } ) }
style={ {
width,
height,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/patterns/checkout-payment/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/patterns/checkout-payment/index.tsx
index 700680601bf..8827b3472d9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/patterns/checkout-payment/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/skeleton/patterns/checkout-payment/index.tsx
@@ -14,7 +14,10 @@ export const CheckoutPaymentSkeleton = () => {
<div
className="wc-block-components-skeleton wc-block-components-skeleton--checkout-payment"
aria-live="polite"
- aria-label={ __( 'Loading payment options… ', 'woocommerce' ) }
+ aria-label={
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __( 'Loading payment options… ', 'woocommerce' )
+ }
>
<div className="wc-block-components-skeleton--checkout-payment-container">
<Skeleton height="20px" width="20px" borderRadius="100%" />
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/summary/index.tsx b/plugins/woocommerce/client/blocks/assets/js/base/components/summary/index.tsx
index 8faeed41b18..0b8fc034e0b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/summary/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/summary/index.tsx
@@ -62,7 +62,6 @@ const allowedAttributes = [
* @param {string} props.countType One of words, characters_excluding_spaces, or characters_including_spaces.
* @param {string} props.className Class name for rendered component.
* @param {CSSProperties} props.style Style Object for rendered component.
- *
*/
export const Summary = ( {
source,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/event-emit/utils.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/event-emit/utils.ts
index 97aa0746695..c895812a849 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/event-emit/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/event-emit/utils.ts
@@ -15,7 +15,7 @@ export const getObserversByPriority = (
return observers[ eventType ]
? Array.from( observers[ eventType ].values() ).sort( ( a, b ) => {
return a.priority - b.priority;
- } )
+ } )
: [];
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-save-for-later.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-save-for-later.ts
index 54501e584bf..8b1c54fe069 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-save-for-later.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-save-for-later.ts
@@ -47,7 +47,7 @@ export const useSaveForLater = (): {
: __(
'There was a problem saving this item for later.',
'woocommerce'
- );
+ );
dispatch( noticesStore ).createNotice( 'error', message, {
context: 'wc/cart',
isDismissible: true,
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-store-cart.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-store-cart.ts
index 9f6c6180668..286390f8110 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-store-cart.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/cart/use-store-cart.ts
@@ -37,7 +37,6 @@ import { emptyHiddenAddressFields } from '@woocommerce/base-utils';
import { useStoreCartEventListeners } from './use-store-cart-event-listeners';
declare module '@wordpress/html-entities' {
- // eslint-disable-next-line @typescript-eslint/no-shadow
export function decodeEntities< T >( coupon: T ): T;
}
const defaultShippingAddress: CartResponseShippingAddress = {
@@ -117,7 +116,7 @@ const normalizeCoupons = ( coupons: CartResponseCouponItem[] ) => {
? coupons.map( ( coupon: CartResponseCouponItem ) => ( {
...coupon,
label: decodeEntities( coupon.code ),
- } ) )
+ } ) )
: EMPTY_CART_COUPONS;
};
@@ -136,9 +135,9 @@ const normalizeShippingRates = ( shippingRates: CartShippingRate[] ) => {
? shippingRate.shipping_rates.map(
( rate: CartShippingPackageShippingRate ) =>
decodeValues( rate )
- )
+ )
: [],
- } ) )
+ } ) )
: [];
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/collections/use-collection.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/collections/use-collection.ts
index d2a781e6e8d..f0066216ac3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/collections/use-collection.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/collections/use-collection.ts
@@ -108,7 +108,7 @@ export const useCollection = < T >(
: __(
'Something went wrong while loading data.',
'woocommerce'
- );
+ );
throwError( new Error( message ) );
}
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/payment-methods/use-payment-methods.ts b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/payment-methods/use-payment-methods.ts
index 906f949bb60..fda2dd411de 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/payment-methods/use-payment-methods.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/hooks/payment-methods/use-payment-methods.ts
@@ -94,7 +94,7 @@ const usePaymentMethodState = (
};
export const usePaymentMethods = ():
- | PaymentMethodState
- | ExpressPaymentMethodState => usePaymentMethodState( false );
+ PaymentMethodState | ExpressPaymentMethodState =>
+ usePaymentMethodState( false );
export const useExpressPaymentMethods = (): ExpressPaymentMethodState =>
usePaymentMethodState( true );
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 681a977b9a1..36f8173cb1f 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
@@ -24,8 +24,9 @@ export default function useProductAttributes( shouldLoadAttributes: boolean ) {
! shouldLoadAttributes ||
isLoadingAttributes ||
hasLoadedAttributes.current
- )
+ ) {
return;
+ }
async function fetchAttributesWithTerms() {
setIsLoadingAttributes( true );
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/add-to-cart-form/form-state/reducer.js b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/add-to-cart-form/form-state/reducer.js
index 6fe069913e1..2bbd8f129d9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/context/providers/add-to-cart-form/form-state/reducer.js
+++ b/plugins/woocommerce/client/blocks/assets/js/base/context/providers/add-to-cart-form/form-state/reducer.js
@@ -47,7 +47,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
? {
...state,
status: IDLE,
- }
+ }
: state;
break;
case SET_DISABLED:
@@ -56,7 +56,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
? {
...state,
status: DISABLED,
- }
+ }
: state;
break;
case SET_QUANTITY:
@@ -65,7 +65,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
? {
...state,
quantity,
- }
+ }
: state;
break;
case SET_REQUEST_PARAMS:
@@ -90,7 +90,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
...state,
status: PROCESSING,
hasError: false,
- }
+ }
: state;
// clear any error state.
newState =
@@ -105,7 +105,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
...state,
status: BEFORE_PROCESSING,
hasError: false,
- }
+ }
: state;
break;
case SET_AFTER_PROCESSING:
@@ -114,7 +114,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
? {
...state,
status: AFTER_PROCESSING,
- }
+ }
: state;
break;
case SET_HAS_ERROR:
@@ -123,14 +123,14 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
: {
...state,
hasError: true,
- };
+ };
newState =
state.status === PROCESSING ||
state.status === BEFORE_PROCESSING
? {
...newState,
status: IDLE,
- }
+ }
: newState;
break;
case SET_NO_ERROR:
@@ -138,7 +138,7 @@ export const reducer = ( state = DEFAULT_STATE, { quantity, type, data } ) => {
? {
...state,
hasError: false,
- }
+ }
: state;
break;
}
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 c2f3c6679ab..d6c04141681 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
@@ -255,7 +255,7 @@ const CheckoutProcessor = () => {
shouldSavePayment,
activePaymentMethod
),
- }
+ }
: {};
const billingAddressData = currentBillingAddress.current;
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/hooks/test/use-schema-parser.tsx b/plugins/woocommerce/client/blocks/assets/js/base/hooks/test/use-schema-parser.tsx
index 07af4778659..74880be8252 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/hooks/test/use-schema-parser.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/base/hooks/test/use-schema-parser.tsx
@@ -33,7 +33,7 @@ const mockSchemaParser = {
type DeepPartial< T > = T extends object
? {
[ P in keyof T ]?: DeepPartial< T[ P ] >;
- }
+ }
: T;
const getCurrentData = < T extends FormType | 'global' >( result: {
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-schema-parser.ts b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-schema-parser.ts
index 13e7f00026d..f24e25b22a6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-schema-parser.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-schema-parser.ts
@@ -130,7 +130,7 @@ const useDocumentObject = < T extends FormType | 'global' >(
formType === 'billing'
? billingAddress
: shippingAddress,
- }
+ }
: {} ),
},
};
@@ -221,8 +221,8 @@ export interface DocumentObject< T extends FormType | 'global' > {
address: T extends 'billing'
? AddressFormValues
: T extends 'shipping'
- ? AddressFormValues
- : null;
+ ? AddressFormValues
+ : null;
}
| Record< string, never >;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-style-props.ts b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-style-props.ts
index 7e064ff4ba2..1870cbb82f5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-style-props.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/hooks/use-style-props.ts
@@ -40,7 +40,7 @@ const parseStyleAttributes = ( rawProps: BlockAttributes ): StyleAttributes => {
? rawProps
: {
style: {},
- };
+ };
let style = props.style;
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/stores/store-notices.ts b/plugins/woocommerce/client/blocks/assets/js/base/stores/store-notices.ts
index 68a484baa95..bdcf88f50ed 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/stores/store-notices.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/stores/store-notices.ts
@@ -153,7 +153,9 @@ const { state } = store< Store >(
: getStoreNoticeContext()?.notice?.id;
// If noticeId is not found (e.g., context was null), do nothing.
- if ( ! resolvedId ) return;
+ if ( ! resolvedId ) {
+ return;
+ }
const index = notices.findIndex(
( { id } ) => id === resolvedId
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 d15da31aa05..ef22c04b48e 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
@@ -82,8 +82,7 @@ export type AddCartItemError = {
* success into a failure.
*/
export type AddCartItemOutcome =
- | { success: true }
- | { success: false; error: AddCartItemError };
+ { success: true } | { success: false; error: AddCartItemError };
export type Store = {
state: {
@@ -448,14 +447,14 @@ function emitSyncEvent( {
* import kicked off by {@link preloadA11y} resolves. `null` until then, or if
* the import never resolves (e.g. a chunk-load failure).
*/
-let speakFn: ( typeof import('@wordpress/a11y') )[ 'speak' ] | null = null;
+let speakFn: ( typeof import( '@wordpress/a11y' ) )[ 'speak' ] | null = null;
/**
* The in-flight (or already-settled) `@wordpress/a11y` import kicked off by
* {@link preloadA11y}, reused across calls so the module is only imported
* once per page load.
*/
-let a11yPromise: Promise< typeof import('@wordpress/a11y') > | null = null;
+let a11yPromise: Promise< typeof import( '@wordpress/a11y' ) > | null = null;
/**
* Kicks off (once) the dynamic import of `@wordpress/a11y` and stashes its
@@ -739,7 +738,7 @@ const { actions } = store< Store >(
cartItemsPendingQuantity: existingItem?.key
? [ existingItem.key ]
: [],
- }
+ }
: { productsPendingAdd: [ id ] };
// Prepare the item to send.
@@ -785,9 +784,7 @@ const { actions } = store< Store >(
type ProductCapture = {
id: number;
variation?:
- | CartVariationItem[]
- | SelectedAttributes[]
- | undefined;
+ CartVariationItem[] | SelectedAttributes[] | undefined;
preAddTotal: number;
deltaTotal: number;
preExistingKeys: string[];
@@ -1185,7 +1182,9 @@ const { actions } = store< Store >(
}
// Skips if there's a pending request.
- if ( pendingRefresh ) return;
+ if ( pendingRefresh ) {
+ return;
+ }
pendingRefresh = true;
@@ -1210,8 +1209,9 @@ const { actions } = store< Store >(
const json = ( yield res.json() ) as Cart;
// Checks if the response contains an error.
- if ( isApiErrorResponse( res, json ) )
+ if ( isApiErrorResponse( res, json ) ) {
throw generateError( json );
+ }
// If the batcher started a cycle while we were fetching,
// discard this response — the batcher will reconcile.
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 36ab31f8bcc..239312dd279 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
@@ -202,7 +202,9 @@ export function createMutationQueue< TState, TMeta = unknown >(
) {
responses.forEach( ( itemResponse, index ) => {
const requestId = requestIds[ index ];
- if ( ! requestId ) return;
+ if ( ! requestId ) {
+ return;
+ }
const isSuccess =
itemResponse.status >= 200 && itemResponse.status < 300;
@@ -246,7 +248,9 @@ export function createMutationQueue< TState, TMeta = unknown >(
const requests = requestIds
.map( ( id ) => {
const tracked = trackedRequests.get( id );
- if ( ! tracked ) return null;
+ if ( ! tracked ) {
+ return null;
+ }
return {
path: tracked.request.path,
method: tracked.request.method,
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 656b88f19b4..fbfd77e4b28 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
@@ -324,8 +324,7 @@ const { state, actions } = store< Store >(
// `packages/public-api/block-data/cart/thunks.ts::saveForLater`.
window.addEventListener( 'wc-blocks_store_sync_required', ( event: Event ) => {
const detail = ( event as CustomEvent ).detail as
- | { type?: string; slug?: string; item?: RawShopperListItem }
- | undefined;
+ { type?: string; slug?: string; item?: RawShopperListItem } | undefined;
if ( detail?.type !== 'shopper-list-item-added' ) {
return;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/utils/debounce.ts b/plugins/woocommerce/client/blocks/assets/js/base/utils/debounce.ts
index 378a9834c43..5e17235c7db 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/utils/debounce.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/utils/debounce.ts
@@ -14,12 +14,18 @@ export const debounce = < T extends ( ...args: any[] ) => any >(
const debounced = ( ( ...args: Parameters< T > ) => {
latestArgs = args;
- if ( timeout ) clearTimeout( timeout );
+ if ( timeout ) {
+ clearTimeout( timeout );
+ }
timeout = setTimeout( () => {
timeout = null;
- if ( ! immediate && latestArgs ) func( ...latestArgs );
+ if ( ! immediate && latestArgs ) {
+ func( ...latestArgs );
+ }
}, wait );
- if ( immediate && ! timeout ) func( ...args );
+ if ( immediate && ! timeout ) {
+ func( ...args );
+ }
} ) as DebouncedFunction< T >;
// Clear the debounce queue and execute any pending function immediately.
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/utils/shipping-rates.ts b/plugins/woocommerce/client/blocks/assets/js/base/utils/shipping-rates.ts
index aa7d27c2aa1..bf20ff7f83e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/utils/shipping-rates.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/base/utils/shipping-rates.ts
@@ -166,7 +166,7 @@ export const selectedRatesAreCollectable = (
( rate ) =>
! rate.selected || isPackageRateCollectable( rate )
);
- } )
+ } )
: false;
};
@@ -178,6 +178,6 @@ export const allRatesAreCollectable = (
return shippingPackage.shipping_rates.every( ( rate ) =>
isPackageRateCollectable( rate )
);
- } )
+ } )
: false;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-form/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-form/edit.tsx
index 6c76be01a4f..9e28eff3973 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-form/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-form/edit.tsx
@@ -75,7 +75,7 @@ const AddToCartFormEdit = ( props: BlockEditProps< Attributes > ) => {
boxSizing: 'unset',
borderRadius:
'unset',
- }
+ }
: {}
}
type="number"
@@ -116,7 +116,7 @@ const AddToCartFormEdit = ( props: BlockEditProps< Attributes > ) => {
boxSizing: 'unset',
borderRadius:
'unset',
- }
+ }
: {}
}
type="number"
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/edit/skeleton.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/edit/skeleton.tsx
index 24f369c33fd..f3973fd526f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/edit/skeleton.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/edit/skeleton.tsx
@@ -21,7 +21,7 @@ export const Skeleton = ( {
? __(
'Loading the Add to Cart + Options template part',
'woocommerce'
- )
+ )
: __( 'Add to Cart + Options form', 'woocommerce' )
}
>
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 758c41c1ce6..a68a483898b 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
@@ -33,7 +33,7 @@ type ProductItemWithContextProps = {
product?: ProductResponseItem | null;
blocks: BlockInstance[];
isSelected: boolean;
- onSelect(): void;
+ onSelect: () => void;
};
type ProductItemProps = {
@@ -41,7 +41,7 @@ type ProductItemProps = {
blocks: BlockInstance[];
isLoading: boolean;
isSelected: boolean;
- onSelect(): void;
+ onSelect: () => void;
};
const ProductItem = ( {
@@ -200,7 +200,7 @@ export default function ProductItemTemplateEdit(
}
onSelect={ () => setSelectedProductItem( productItem.id ) }
/>
- ) )
+ ) )
: previewProductResponseItems?.map( ( productItem ) => (
<ProductItem
key={ productItem.id }
@@ -214,7 +214,7 @@ export default function ProductItemTemplateEdit(
}
onSelect={ () => setSelectedProductItem( productItem.id ) }
/>
- ) );
+ ) );
return (
<div { ...blockProps }>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute-name/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute-name/edit.tsx
index c5a7107c105..9c96150bb19 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute-name/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute-name/edit.tsx
@@ -57,7 +57,9 @@ export default function AttributeNameEdit(
const { data: attribute } =
useCustomDataContext< ProductResponseAttributeItem >( 'attribute' );
- if ( ! attribute ) return;
+ if ( ! attribute ) {
+ return;
+ }
return (
<label { ...blockProps } htmlFor={ attribute.taxonomy }>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute/edit.tsx
index 9aea8d01fc6..ce22415f352 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/attribute/edit.tsx
@@ -77,7 +77,7 @@ interface Attributes {
type AttributeItemProps = {
blocks: BlockInstance[];
isSelected: boolean;
- onSelect(): void;
+ onSelect: () => void;
};
function AttributeItem( { blocks, isSelected, onSelect }: AttributeItemProps ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
index 3e0a59efe74..3b2ae95dcae 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/variation-selector/frontend.ts
@@ -307,8 +307,7 @@ const { actions, state } = store< VariableProductAddToCartWithOptionsStore >(
},
toggle(
itemArg?:
- | SelectableItem< { visual?: VisualAttributeTerm } >
- | Event
+ SelectableItem< { visual?: VisualAttributeTerm } > | Event
) {
const context = getContext< ToggleContext >();
const item =
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/edit.tsx
index 2e338baf26a..538f5129794 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/edit.tsx
@@ -229,11 +229,11 @@ const Edit = ( {
? __(
'Choose to return filter results for all of the attributes selected.',
'woocommerce'
- )
+ )
: __(
'Choose to return filter results for any of the attributes selected.',
'woocommerce'
- )
+ )
}
value={ queryType }
onChange={ ( value: string ) =>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/utils.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/utils.ts
index 8158f093179..60bcca45e60 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/attribute-filter/utils.ts
@@ -96,7 +96,7 @@ export const isQueryArgsEqual = (
: {
...acc,
[ key ]: value,
- };
+ };
},
{}
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/breadcrumbs/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/breadcrumbs/edit.tsx
index 2f33f2e339c..0b0cd6a9f4c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/breadcrumbs/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/breadcrumbs/edit.tsx
@@ -50,6 +50,7 @@ const Edit = ( { attributes }: BlockEditProps< Attributes > ) => {
<div { ...blockProps }>
<Disabled>
<a href="/">{ __( 'Breadcrumbs', 'woocommerce' ) }</a>
+ { /* eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace */ }
{ __( ' / Navigation / Path', 'woocommerce' ) }
</Disabled>
</div>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/incompatible-extensions-notice.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/incompatible-extensions-notice.tsx
index b7ea618ae52..5fca5040768 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/incompatible-extensions-notice.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/incompatible-extensions-notice.tsx
@@ -92,7 +92,7 @@ const IncompatibleExtensionsBanner = ( { block }: Props ) => {
const acknowledgedSlugs = Array.isArray( dismissedSlugs )
? dismissedSlugs.filter(
( slug ): slug is string => typeof slug === 'string'
- )
+ )
: [];
const { extensions, slugs, isKnown } = getIncompatibleExtensions();
@@ -150,7 +150,7 @@ const IncompatibleExtensionsBanner = ( { block }: Props ) => {
),
extensionNames[ 0 ],
blockLabel
- )
+ )
: sprintf(
/* translators: %s is block name */
__(
@@ -158,7 +158,7 @@ const IncompatibleExtensionsBanner = ( { block }: Props ) => {
'woocommerce'
),
blockLabel
- );
+ );
return (
<NoticeBanner
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 964abc0533c..bb8318ca610 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
@@ -42,7 +42,7 @@ const ExpressPaymentMethods = () => {
? {
height: buttonHeight,
borderRadius: buttonBorderRadius,
- }
+ }
: undefined;
const { activePaymentMethod, paymentMethodData } = useSelect(
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/checkout-express-payment.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/checkout-express-payment.tsx
index d578acf5321..9a06cb30670 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/checkout-express-payment.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/express-payment/checkout-express-payment.tsx
@@ -128,6 +128,7 @@ const CheckoutExpressPayment = () => {
) }
/>
) : (
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
__( ' Express Checkout', 'woocommerce' )
) }
</h2>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-options.js b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-options.js
index dc21356423d..2494108424c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-options.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/payment-methods/payment-method-options.js
@@ -55,7 +55,7 @@ const PaymentMethodOptions = () => {
? label
: cloneElement( label, {
components: paymentMethodInterface.components,
- } ),
+ } ),
name: `wc-saved-payment-method-token-${ name }`,
content: (
<PaymentMethodCard showSaveOption={ supports.showSaveOption }>
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 c92833c462b..8aeb4620a14 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
@@ -166,7 +166,7 @@ const SavedPaymentMethodOptions = () => {
// @ts-ignore - we know for sure that the savedTokenComponent is not null or undefined at this point.
paymentMethods[ activePaymentMethod ].savedTokenComponent,
{ token: activeSavedToken, ...paymentMethodInterface }
- )
+ )
: null;
return options.length > 0 ? (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/view-switcher/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/view-switcher/index.tsx
index 34f0f17b37b..e8ceb5f01b2 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/view-switcher/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart-checkout-shared/view-switcher/index.tsx
@@ -24,7 +24,7 @@ const withViewSwitcher =
views: blockAttributes.editorViews,
currentView: blockAttributes.currentView,
viewClientId: clientId,
- }
+ }
: findParentBlockEditorViews( clientId );
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx
index 42c39b3461b..75ba7a63134 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx
@@ -19,7 +19,9 @@ const CartCrossSellsProductList = ( {
columns,
}: CrossSellsProductListProps ): JSX.Element => {
const crossSellsProducts = products.map( ( product, i ) => {
- if ( i >= columns ) return null;
+ if ( i >= columns ) {
+ return null;
+ }
return (
<CartCrossSellsProduct
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/frontend.js b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/frontend.js
index ed80fce1af1..551fc593faa 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/frontend.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/frontend.js
@@ -27,7 +27,7 @@ const getProps = ( el ) => {
const Wrapper = ( { children } ) => {
// we need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
return Children.map( children, ( child ) => {
if ( isValidElement( child ) ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-block/slotfills.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-block/slotfills.tsx
index 7d571acc750..a18e342da60 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-block/slotfills.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-block/slotfills.tsx
@@ -6,7 +6,7 @@ import { useStoreCart } from '@woocommerce/base-context/hooks';
export const OrderMetaSlotFill = (): JSX.Element => {
// Prepare props to pass to the ExperimentalOrderMeta slot fill. We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const slotFillProps = {
extensions,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-discount/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-discount/block.tsx
index 1644c55991f..3c189b7d33f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-discount/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/cart-order-summary-discount/block.tsx
@@ -13,7 +13,7 @@ import { ExperimentalDiscountsMeta } from '@woocommerce/blocks-checkout';
const DiscountSlotFill = (): JSX.Element => {
// Prepare props to pass to the ExperimentalOrderMeta slot fill. We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const discountsSlotFillProps = {
extensions,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx
index f43d724c873..4b32b0fe212 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/empty-cart-block/edit.tsx
@@ -29,7 +29,7 @@ const returnToShopTemplate = SHOP_URL
},
],
],
- ]
+ ]
: null;
// Recent WordPress versions center headings through the typography support and no longer
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/register-components.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/register-components.ts
index aebf99f9237..80ef8c33b9c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/register-components.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/inner-blocks/register-components.ts
@@ -29,7 +29,7 @@ import CartOrderSummaryTotalsFrontend from './cart-order-summary-totals/frontend
import CartOrderSummaryTaxesFrontend from './cart-order-summary-taxes/frontend';
// Modify webpack publicPath at runtime based on location of WordPress Plugin.
-// eslint-disable-next-line no-undef,camelcase
+// eslint-disable-next-line no-undef
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;
registerCheckoutBlock( {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/test/slots.js b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/test/slots.js
index 74736a6c25a..8b4c2aa31b7 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/cart/test/slots.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/cart/test/slots.js
@@ -1,4 +1,3 @@
-/* eslint-disable jest/no-commented-out-tests */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/catalog-sorting/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/catalog-sorting/frontend.ts
index e77ff5f1b57..c267c7fd9d1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/catalog-sorting/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/catalog-sorting/frontend.ts
@@ -31,7 +31,7 @@ const catalogSortingStore = {
url.searchParams.set( 'paged', '1' );
// Client-side navigation.
- const routerModule: typeof import('@wordpress/interactivity-router') =
+ const routerModule: typeof import( '@wordpress/interactivity-router' ) =
yield import( '@wordpress/interactivity-router' );
yield routerModule.actions.navigate( url.href );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/frontend.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/frontend.tsx
index d3d3b7dbb9c..90a3f4f6bb8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/frontend.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/frontend.tsx
@@ -35,7 +35,7 @@ const Wrapper = ( {
children: React.ReactChildren;
} ): React.ReactNode => {
// we need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const checkoutExtensionData = useCheckoutExtensionData();
const validation = useValidation();
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/index.tsx
index 33805d52136..950c465cf0f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/index.tsx
@@ -123,14 +123,14 @@ const settings = {
'woocommerce/checkout-order-note-block',
{},
[]
- )
+ )
: false,
showPolicyLinks
? createBlock(
'woocommerce/checkout-terms-block',
{},
[]
- )
+ )
: false,
createBlock(
'woocommerce/checkout-actions-block',
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 47cba2f2a88..8c146e5602e 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
@@ -42,7 +42,7 @@ const CreateAccountUI = (): React.ReactElement | null => {
const showCreateAccountPassword = generatePassword
? false
: ( showCreateAccountCheckbox && shouldCreateAccount ) ||
- ! allowGuestCheckout;
+ ! allowGuestCheckout;
if (
! allowGuestCheckout &&
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/block.tsx
index 21e281ea0d9..fc14a2bd975 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/block.tsx
@@ -42,7 +42,7 @@ const Block = ( { className }: { className?: string } ): JSX.Element => {
? __(
'Notes about your order, e.g. special notes for delivery.',
'woocommerce'
- )
+ )
: __( 'Notes about your order.', 'woocommerce' )
}
value={ orderNotes }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/slotfills.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/slotfills.tsx
index fe9780929fd..6153db3cb6e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/slotfills.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/slotfills.tsx
@@ -10,7 +10,7 @@ import { useStoreCart } from '@woocommerce/base-context/hooks';
// @todo Consider deprecating OrderMetaSlotFill and DiscountSlotFill in favour of inner block areas.
export const OrderMetaSlotFill = (): JSX.Element => {
// Prepare props to pass to the ExperimentalOrderMeta slot fill. We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const slotFillProps = {
extensions,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/use-order-summary-toggle.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/use-order-summary-toggle.ts
index e439d3c75d4..bf9fc38c6a3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/use-order-summary-toggle.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/use-order-summary-toggle.ts
@@ -46,7 +46,7 @@ export const useOrderSummaryToggle = (): OrderSummaryToggle => {
setIsOpen( ! isOpen );
}
},
- }
+ }
: {};
return { isOpen, isLarge, ariaControlsId, toggleProps };
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-coupon-form/test/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-coupon-form/test/block.tsx
index 44f876a62a6..eec8d7a105e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-coupon-form/test/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-coupon-form/test/block.tsx
@@ -61,7 +61,6 @@ describe( 'Checkout Order Summary Coupon Form Block', () => {
} );
it( 'does not render when coupons are disabled', () => {
- // eslint-disable-next-line @typescript-eslint/no-var-requires -- Required for mocking
const getSetting = require( '@woocommerce/settings' ).getSetting;
getSetting.mockImplementation( ( setting, defaultValue ) => {
if ( setting === 'couponsEnabled' ) {
@@ -98,7 +97,6 @@ describe( 'Checkout Order Summary Coupon Form Block', () => {
it( 'passes correct context to useStoreCartCoupons hook', () => {
const useStoreCartCoupons =
- // eslint-disable-next-line @typescript-eslint/no-var-requires -- Required for mocking
require( '@woocommerce/base-context/hooks' ).useStoreCartCoupons;
render( <Block /> );
@@ -117,7 +115,6 @@ describe( 'Checkout Order Summary Coupon Form Block', () => {
it( 'integrates applyCoupon function from hook with TotalsCoupon', () => {
const TotalsCoupon =
- // eslint-disable-next-line @typescript-eslint/no-var-requires -- Required for mocking
require( '@woocommerce/base-components/cart-checkout' ).TotalsCoupon;
render( <Block /> );
@@ -135,7 +132,6 @@ describe( 'Checkout Order Summary Coupon Form Block', () => {
it( 'passes loading state from hook to TotalsCoupon', () => {
const useStoreCartCoupons =
- // eslint-disable-next-line @typescript-eslint/no-var-requires -- Required for mocking
require( '@woocommerce/base-context/hooks' ).useStoreCartCoupons;
// Mock loading state
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-discount/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-discount/block.tsx
index 08cdc4bc07b..6d7b2044e22 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-discount/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-discount/block.tsx
@@ -13,7 +13,7 @@ import { ExperimentalDiscountsMeta } from '@woocommerce/blocks-checkout';
const DiscountSlotFill = (): JSX.Element => {
// Prepare props to pass to the ExperimentalOrderMeta slot fill. We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const discountsSlotFillProps = {
extensions,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-shipping/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-shipping/block.tsx
index 16f499ffcdf..976ccfeca9f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-shipping/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-order-summary-shipping/block.tsx
@@ -48,11 +48,11 @@ const Block = ( {
? __(
'No available delivery option',
'woocommerce'
- )
+ )
: __(
'Enter address to calculate',
'woocommerce'
- ) }
+ ) }
</span>
}
/>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/edit.tsx
index a4dd7d0e56e..ef7e6ff9218 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-payment-block/edit.tsx
@@ -103,7 +103,7 @@ export const Edit = ( {
? {
warning:
incompatiblePaymentMethodMessage,
- }
+ }
: {} ) }
/>
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx
index 3c8b4a19d00..027830defb5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx
@@ -196,7 +196,7 @@ const Block = () => {
// Prepare props to pass to the ExperimentalOrderLocalPickupPackages slot fill.
// We need to pluck out receiveCart.
- // eslint-disable-next-line no-unused-vars
+
const { extensions, receiveCart, ...cart } = useStoreCart();
const slotFillProps = {
extensions,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/edit.tsx
index 417bec79b7e..fc72158350d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/edit.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @wordpress/no-unsafe-wp-apis */
/**
* External dependencies
*/
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 fa2eaa175cd..6bff8dd77a2 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
@@ -1,4 +1,3 @@
-/* eslint-disable @wordpress/no-unsafe-wp-apis */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/shared/rate-price.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/shared/rate-price.tsx
index 0c8defe1580..1da408c8b8d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/shared/rate-price.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/shared/rate-price.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable no-nested-ternary */
/**
* External dependencies
*/
@@ -48,7 +47,7 @@ export const RatePrice = ( {
{
price: priceElement,
}
- ) }
+ ) }
</span>
);
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx
index 92958a527c0..bf4d9a75991 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/block.tsx
@@ -113,7 +113,7 @@ const Block = ( {
)
),
};
- } )
+ } )
: shippingRates;
}, [ shippingRates, isCollectable ] );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/constants.js b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/constants.js
index 3fc92eda063..928d3213c2c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/constants.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/constants.js
@@ -8,14 +8,14 @@ const termsPageLink = TERMS_URL
? `<a href="${ TERMS_URL }" target="_blank">${ __(
'Terms and Conditions',
'woocommerce'
- ) }</a>`
+ ) }</a>`
: __( 'Terms and Conditions', 'woocommerce' );
const privacyPageLink = PRIVACY_URL
? `<a href="${ PRIVACY_URL }" target="_blank">${ __(
'Privacy Policy',
'woocommerce'
- ) }</a>`
+ ) }</a>`
: __( 'Privacy Policy', 'woocommerce' );
export const termsConsentDefaultText = sprintf(
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/edit.tsx
index dc27835e514..b4bbbaf5c73 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-terms-block/edit.tsx
@@ -107,7 +107,7 @@ export const Edit = ( {
text: '',
} ),
},
- ]
+ ]
: []
}
>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/register-components.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/register-components.ts
index 020354e235c..4bb3e785fdb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/register-components.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/register-components.ts
@@ -35,7 +35,7 @@ import CheckoutOrderSummaryShippingBlock from './checkout-order-summary-shipping
import CheckoutOrderSummaryTaxesBlock from './checkout-order-summary-taxes/frontend';
// Modify webpack publicPath at runtime based on location of WordPress Plugin.
-// eslint-disable-next-line no-undef,camelcase
+// eslint-disable-next-line no-undef
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;
// @todo When forcing all blocks at once, they will append based on the order they are registered. Introduce formal sorting param.
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 3015000dbd3..6593ab2d01e 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
@@ -199,7 +199,7 @@ const Edit = ( { clientId, attributes }: BlockEditProps< Attributes > ) => {
{
a: (
// Suppress the warning as this <a> will be interpolated into the string with content.
- // eslint-disable-next-line jsx-a11y/anchor-has-content
+
<ExternalLink href="https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/" />
),
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/constants.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/constants.ts
index a4c1f227127..8f04f72e946 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/constants.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/classic-template/constants.ts
@@ -34,6 +34,7 @@ export const TEMPLATES: TemplateDetails = {
'archive-product': {
type: TYPES.productCatalog,
title: __( 'Product Grid (Classic)', 'woocommerce' ),
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
description: __(
'Displays the PHP product grid page. ',
'woocommerce'
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 11d98a6f77a..fd0a39ac78c 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
@@ -106,9 +106,8 @@ const ConvertTemplate = ( { blockifyConfig, clientId, attributes } ) => {
{
label: __( 'Undo', 'woocommerce' ),
onClick: () => {
- const clientIds = pickBlockClientIds(
- getBlocks()
- );
+ const clientIds =
+ pickBlockClientIds( getBlocks() );
void replaceBlocks(
clientIds,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/customer-account/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/customer-account/block.tsx
index 3f42b2ec2d8..e9907522872 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/customer-account/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/customer-account/block.tsx
@@ -70,7 +70,7 @@ export const CustomerAccountBlock = ( {
displayStyle === DisplayStyle.ICON_ONLY
? {
'aria-label': __( 'My Account', 'woocommerce' ),
- }
+ }
: {};
const content = (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/block-controls.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/block-controls.tsx
index 5fcf7d42b84..f6edab5afde 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/block-controls.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/block-controls.tsx
@@ -32,14 +32,16 @@ interface WithBlockControlsRequiredProps< T > {
canEditItem: boolean;
}
-interface WithBlockControlsCategoryProps< T >
- extends WithBlockControlsRequiredProps< T > {
+interface WithBlockControlsCategoryProps<
+ T,
+> extends WithBlockControlsRequiredProps< T > {
category: WP_REST_API_Category;
product: never;
}
-interface WithBlockControlsProductProps< T >
- extends WithBlockControlsRequiredProps< T > {
+interface WithBlockControlsProductProps<
+ T,
+> extends WithBlockControlsRequiredProps< T > {
category: never;
product: ProductResponseItem;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/constrained-resizable.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/constrained-resizable.tsx
index 576e47f5be6..941921c4950 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/constrained-resizable.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/constrained-resizable.tsx
@@ -20,7 +20,9 @@ export const ConstrainedResizable = ( {
} );
const throttledResize = useThrottledCallback< ResizeCallback >(
( event, direction, elt, _delta ) => {
- if ( ! isResizing ) setIsResizing( true );
+ if ( ! isResizing ) {
+ setIsResizing( true );
+ }
onResize?.( event, direction, elt, _delta );
},
50,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/image-editor.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/image-editor.tsx
index a8d5980c5c4..c7b214b0211 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/image-editor.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/image-editor.tsx
@@ -26,14 +26,16 @@ interface WithImageEditorRequiredProps< T > {
useEditingImage: [ boolean, Dispatch< SetStateAction< boolean > > ];
}
-interface WithImageEditorCategoryProps< T >
- extends WithImageEditorRequiredProps< T > {
+interface WithImageEditorCategoryProps<
+ T,
+> extends WithImageEditorRequiredProps< T > {
category: WP_REST_API_Category;
product: never;
}
-interface WithImageEditorProductProps< T >
- extends WithImageEditorRequiredProps< T > {
+interface WithImageEditorProductProps<
+ T,
+> extends WithImageEditorRequiredProps< T > {
category: never;
product: ProductResponseItem;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/inspector-controls.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/inspector-controls.tsx
index 125e5f0b101..63d498c93b9 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/inspector-controls.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/inspector-controls.tsx
@@ -43,11 +43,10 @@ type InspectorControlRequiredKeys =
| 'overlayColor'
| 'overlayGradient';
-interface InspectorControlsRequiredAttributes
- extends LooselyMustHave<
- FeaturedItemRequiredAttributes,
- InspectorControlRequiredKeys
- > {
+interface InspectorControlsRequiredAttributes extends LooselyMustHave<
+ FeaturedItemRequiredAttributes,
+ InspectorControlRequiredKeys
+> {
alt: string;
backgroundImageSrc: string;
}
@@ -71,14 +70,16 @@ interface WithInspectorControlsRequiredProps< T > {
};
}
-interface WithInspectorControlsCategoryProps< T >
- extends WithInspectorControlsRequiredProps< T > {
+interface WithInspectorControlsCategoryProps<
+ T,
+> extends WithInspectorControlsRequiredProps< T > {
category: WP_REST_API_Category;
product: never;
}
-interface WithInspectorControlsProductProps< T >
- extends WithInspectorControlsRequiredProps< T > {
+interface WithInspectorControlsProductProps<
+ T,
+> extends WithInspectorControlsRequiredProps< T > {
category: never;
product: ProductResponseItem;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/types.ts
index 37b44c63c3f..88aad54daa5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/types.ts
@@ -24,7 +24,9 @@ export interface ImageObject {
}
export function isImageObject( obj: unknown ): obj is ImageObject {
- if ( ! obj ) return false;
+ if ( ! obj ) {
+ return false;
+ }
return (
isNumber( ( obj as ImageObject ).id ) &&
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/use-background-image.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/use-background-image.ts
index 3e137316698..99ceefd250b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/use-background-image.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/use-background-image.ts
@@ -109,7 +109,9 @@ export function useBackgroundImage( {
willReadFrequently: true,
} );
- if ( ! ctx ) return;
+ if ( ! ctx ) {
+ return;
+ }
ctx.drawImage( img, 0, 0, width, height );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/utils.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/utils.ts
index 1cd3e2f3a6e..956087ff53a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/utils.ts
@@ -16,7 +16,9 @@ import { BgImageDimensions } from './use-background-image';
* Useful for converting to a CSS-compatible position string.
*/
export function calculatePercentPositionFromCoordinates( coords: Coordinates ) {
- if ( ! coords ) return '';
+ if ( ! coords ) {
+ return '';
+ }
const x = Math.round( coords.x * 100 );
const y = Math.round( coords.y * 100 );
@@ -28,7 +30,9 @@ export function calculatePercentPositionFromCoordinates( coords: Coordinates ) {
* Given x and y coordinates between 0 and 1 returns a CSS `objectPosition`.
*/
export function calculateBackgroundImagePosition( coords: Coordinates ) {
- if ( ! coords ) return {};
+ if ( ! coords ) {
+ return {};
+ }
return {
objectPosition: calculatePercentPositionFromCoordinates( coords ),
@@ -110,11 +114,11 @@ export function getInvalidItemDescription( name: string ): string {
? __(
'Previously selected product is no longer available',
'woocommerce'
- )
+ )
: __(
'Previously selected category is no longer available',
'woocommerce'
- );
+ );
}
/**
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-api-error.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-api-error.tsx
index 03361f62f0d..75b4c630a75 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-api-error.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-api-error.tsx
@@ -21,17 +21,16 @@ interface APIErrorRequiredProps {
interface APIErrorProductProps extends APIErrorRequiredProps {
getCategory: never;
- getProduct(): void;
+ getProduct: () => void;
}
interface APIErrorCategoryProps extends APIErrorRequiredProps {
- getCategory(): void;
+ getCategory: () => void;
getProduct: never;
}
type APIErrorProps< T extends Block > =
- | ( T & APIErrorProductProps )
- | ( T & APIErrorCategoryProps );
+ ( T & APIErrorProductProps ) | ( T & APIErrorCategoryProps );
export const withApiError =
< T extends Block >( Component: ComponentType< T > ) =>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-edit-mode.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-edit-mode.tsx
index fb84f126d1c..9f859864ebc 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-edit-mode.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-edit-mode.tsx
@@ -92,9 +92,8 @@ export const withEditMode =
);
// Only show edit mode for newly inserted blocks without existing selection
- const [ editMode, setEditMode ] = useState< boolean >(
- ! hasFeaturedItemId
- );
+ const [ editMode, setEditMode ] =
+ useState< boolean >( ! hasFeaturedItemId );
const onDone = () => {
if ( selectedOptions ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-featured-item.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-featured-item.tsx
index 1bde796d976..06ab763962c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-featured-item.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/featured-items/with-featured-item.tsx
@@ -82,14 +82,12 @@ export interface FeaturedItemRequiredAttributes {
__woocommerceBlockVersion: number;
}
-interface FeaturedCategoryRequiredAttributes
- extends FeaturedItemRequiredAttributes {
+interface FeaturedCategoryRequiredAttributes extends FeaturedItemRequiredAttributes {
categoryId: number | 'preview';
productId: never;
}
-interface FeaturedProductRequiredAttributes
- extends FeaturedItemRequiredAttributes {
+interface FeaturedProductRequiredAttributes extends FeaturedItemRequiredAttributes {
categoryId: never;
productId: number | 'preview';
}
@@ -97,8 +95,7 @@ interface FeaturedProductRequiredAttributes
interface FeaturedItemRequiredProps< T > {
blockProps: ReturnType< typeof useBlockProps >;
attributes: (
- | FeaturedCategoryRequiredAttributes
- | FeaturedProductRequiredAttributes
+ FeaturedCategoryRequiredAttributes | FeaturedProductRequiredAttributes
) &
EditorBlock< T >[ 'attributes' ] & {
// This is hardcoded because border and color are not yet included
@@ -127,8 +124,7 @@ interface FeaturedProductProps< T > extends FeaturedItemRequiredProps< T > {
}
type FeaturedItemProps< T extends EditorBlock< T > > =
- | ( T & FeaturedCategoryProps< T > )
- | ( T & FeaturedProductProps< T > );
+ ( T & FeaturedCategoryProps< T > ) | ( T & FeaturedProductProps< T > );
function FeaturedItemInnerBlocks( {
className,
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 5a0dfeafb99..b833360a5a5 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
@@ -17,14 +17,16 @@ interface WithUpdateButtonAttributes< T > {
editMode?: boolean;
}
-interface WithUpdateButtonCategoryProps< T >
- extends WithUpdateButtonAttributes< T > {
+interface WithUpdateButtonCategoryProps<
+ T,
+> extends WithUpdateButtonAttributes< T > {
category: WP_REST_API_Category;
product: never;
}
-interface WithUpdateButtonProductProps< T >
- extends WithUpdateButtonAttributes< T > {
+interface WithUpdateButtonProductProps<
+ T,
+> extends WithUpdateButtonAttributes< T > {
category: never;
product: ProductResponseItem;
}
@@ -52,14 +54,18 @@ export const withUpdateButtonAttributes =
const findFirstButton = (
node?: BlockInstance
): BlockInstance | undefined => {
- if ( ! node ) return undefined;
+ if ( ! node ) {
+ return undefined;
+ }
if ( node.name === 'core/button' ) {
return node;
}
const children: BlockInstance[] = node.innerBlocks || [];
for ( const child of children ) {
const found = findFirstButton( child );
- if ( found ) return found;
+ if ( found ) {
+ return found;
+ }
}
return undefined;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/index.tsx
index 7985d74433e..8dcf2f34c06 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/index.tsx
@@ -246,7 +246,9 @@ registerBlockType( metadata, {
isFilterWidget( idBase ) && !! instance?.raw,
transform: ( { idBase, instance } ) => {
const filterBlockObject = getFilterBlockObject( idBase );
- if ( ! filterBlockObject ) return null;
+ if ( ! filterBlockObject ) {
+ return null;
+ }
return transformFilterBlock(
filterBlockObject.name,
getTransformAttributes(
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/register-components.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/register-components.ts
index 495e3757a52..1f0c4e20f13 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/register-components.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/filter-wrapper/register-components.ts
@@ -6,7 +6,7 @@ import { lazy } from '@wordpress/element';
import { WC_BLOCKS_BUILD_URL } from '@woocommerce/block-settings';
// Modify webpack publicPath at runtime based on location of WordPress Plugin.
-// eslint-disable-next-line no-undef,camelcase
+// eslint-disable-next-line no-undef
__webpack_public_path__ = WC_BLOCKS_BUILD_URL;
registerBlockComponent( {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/handpicked-products/inspector-controls.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/handpicked-products/inspector-controls.tsx
index 25dfb563daf..17f5484cce5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/handpicked-products/inspector-controls.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/handpicked-products/inspector-controls.tsx
@@ -39,7 +39,7 @@ export const HandpickedProductsInspectorControls = (
? __(
'Buttons are aligned vertically.',
'woocommerce'
- )
+ )
: __( 'Buttons follow content.', 'woocommerce' )
}
checked={ alignButtons }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts
index 8e939860e23..c01d54e7a85 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/migration-products-to-product-collection/migration-from-products-to-product-collection.ts
@@ -138,7 +138,7 @@ const getLayoutAttribute = (
return postTemplateHasSupportForGridView
? mapLayoutPropertiesFromPostTemplateToProductCollection(
postTemplateLayout
- )
+ )
: attributes.displayLayout;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
index 820b6ba3d3d..036ef5c0398 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/frontend.ts
@@ -164,7 +164,7 @@ const getFocusableElements = ( container: HTMLElement | null ) =>
container
? Array.from(
container.querySelectorAll< HTMLElement >( focusableSelectors )
- ).filter( ( el ) => el.offsetParent !== null )
+ ).filter( ( el ) => el.offsetParent !== null )
: [];
const { state: woocommerceState, actions } = store< WooCommerce >(
@@ -223,10 +223,10 @@ store< MiniCart >(
const subtotal = displayCartPriceIncludingTax
? parseInt( woocommerceState.cart.totals.total_items, 10 ) +
- parseInt(
+ parseInt(
woocommerceState.cart.totals.total_items_tax,
10
- )
+ )
: parseInt( woocommerceState.cart.totals.total_items, 10 );
const normalizedCurrency = normalizeCurrencyResponse(
@@ -725,7 +725,7 @@ const { state: cartItemState } = store(
const totalLinePrice = displayCartPriceIncludingTax
? parseInt( totals.line_subtotal, 10 ) +
- parseInt( totals.line_subtotal_tax, 10 )
+ parseInt( totals.line_subtotal_tax, 10 )
: parseInt( totals.line_subtotal, 10 );
const price = formatPriceWithCurrency(
@@ -775,16 +775,18 @@ const { state: cartItemState } = store(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return ( window.wc as any )?.blocksCheckout?.applyCheckoutFilter
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
- ( window.wc as any ).blocksCheckout.applyCheckoutFilter( {
- filterName: 'showRemoveItemLink',
- defaultValue: true,
- extensions: cartItemState.cartItem.extensions,
- arg: {
- context: 'cart',
- cartItem: cartItemState.cartItem,
- cart: woocommerceState.cart,
- },
- } )
+ ( window.wc as any ).blocksCheckout.applyCheckoutFilter(
+ {
+ filterName: 'showRemoveItemLink',
+ defaultValue: true,
+ extensions: cartItemState.cartItem.extensions,
+ arg: {
+ context: 'cart',
+ cartItem: cartItemState.cartItem,
+ cart: woocommerceState.cart,
+ },
+ }
+ )
: true;
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx
index 58d7784aadb..c54592f79b8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/edit.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable jsdoc/check-alignment */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx
index a781d210b49..0eebf4091ca 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks-style.tsx
@@ -41,7 +41,9 @@ export const MiniCartInnerBlocksStyle = ( {
.map( ( { property, value } ) => `${ property }: ${ value };` )
.join( '' );
- if ( rules ) return `${ selector } { ${ rules } }`;
+ if ( rules ) {
+ return `${ selector } { ${ rules } }`;
+ }
return '';
} )
.join( '' )
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx
index 5d308924596..ef9c249809f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/edit.tsx
@@ -34,7 +34,7 @@ export const Edit = (): JSX.Element => {
const { cartTotals } = useStoreCart();
const subTotal = getSetting( 'displayCartPricesIncludingTax', false )
? parseInt( cartTotals.total_items, 10 ) +
- parseInt( cartTotals.total_items_tax, 10 )
+ parseInt( cartTotals.total_items_tax, 10 )
: parseInt( cartTotals.total_items, 10 );
const TEMPLATE = [
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/types.ts
index 34d7bd9b865..c1ca67e8dd7 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/types.ts
@@ -1,9 +1,6 @@
export type IconType = 'cart' | 'bag' | 'bag-alt' | undefined;
export type productCountVisibilityType =
- | 'always'
- | 'never'
- | 'greater_than_zero'
- | undefined;
+ 'always' | 'never' | 'greater_than_zero' | undefined;
export interface ColorItem {
color: string;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/utils/data.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/utils/data.ts
index 8cce47149b2..1fd391ec88d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/utils/data.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/utils/data.ts
@@ -8,11 +8,10 @@ import type { ColorPaletteOption } from '@woocommerce/editor-components/color-pa
*/
import { Attributes } from '../edit';
-interface MaybeInCompatibleAttributes
- extends Omit<
- Attributes,
- 'priceColor' | 'iconColor' | 'productCountColor'
- > {
+interface MaybeInCompatibleAttributes extends Omit<
+ Attributes,
+ 'priceColor' | 'iconColor' | 'productCountColor'
+> {
priceColorValue?: string;
iconColorValue?: string;
productCountColorValue?: string;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/order-confirmation/create-account/test/frontend-block.test.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/order-confirmation/create-account/test/frontend-block.test.tsx
index f78deba74f0..cc7ff084bdc 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/order-confirmation/create-account/test/frontend-block.test.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/order-confirmation/create-account/test/frontend-block.test.tsx
@@ -51,7 +51,7 @@ describe( 'CreateAccountFrontendBlock - Automatic password generation off', () =
await act( async () => {
expect(
- await queryByText(
+ queryByText(
textContentMatcher( 'Set a password for test@test.com' )
)
).toBeInTheDocument();
@@ -112,7 +112,7 @@ describe( 'CreateAccountFrontendBlock - Automatic password generation on', () =>
await act( async () => {
expect(
- await queryByText(
+ queryByText(
textContentMatcher( 'Set a password for test@test.com' )
)
).not.toBeInTheDocument();
@@ -147,7 +147,7 @@ describe( 'CreateAccountFrontendBlock - Automatic password generation on', () =>
await act( async () => {
expect(
- await queryByText(
+ queryByText(
textContentMatcher(
'Check your email at test@test.com for the link to set up an account password.'
)
@@ -176,12 +176,12 @@ describe( 'CreateAccountFrontendBlock - Editor mode', () => {
await act( async () => {
expect(
- await queryByText( textContentMatcher( 'Create account' ) )
+ queryByText( textContentMatcher( 'Create account' ) )
).toBeInTheDocument();
} );
expect(
- await queryByText(
+ queryByText(
textContentMatcher( 'Set a password for customer@email.com' )
)
).toBeInTheDocument();
@@ -334,7 +334,7 @@ describe( 'CreateAccountFrontendBlock - Email handling', () => {
await act( async () => {
expect(
- await queryByText(
+ queryByText(
textContentMatcher(
'Set a password for test+special@example.com'
)
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-categories/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-categories/block.tsx
index 62841956dc2..0d5f3d14728 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-categories/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-categories/block.tsx
@@ -112,11 +112,11 @@ const ProductCategoriesBlock = ( {
? __(
'Category images are visible.',
'woocommerce'
- )
+ )
: __(
'Category images are hidden.',
'woocommerce'
- )
+ )
}
checked={ hasImage }
onChange={ () =>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
index 8202fb58741..3b493e8a0d0 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/cart-reference-frontend.ts
@@ -114,7 +114,7 @@ const cartReferenceStorePart = {
// to the same URL can share the prefetch request.
const pageUrl =
window.location.href === pendingRefreshUrl
- ? pendingPageUrl ?? window.location.href
+ ? ( pendingPageUrl ?? window.location.href )
: window.location.href;
const url = new URL( pageUrl );
// Fetching markup must not repeat a classic add-to-cart action.
@@ -127,9 +127,8 @@ const cartReferenceStorePart = {
pendingPageUrl = pageUrl;
try {
- const { actions: routerActions } = yield import(
- '@wordpress/interactivity-router'
- );
+ const { actions: routerActions } =
+ yield import( '@wordpress/interactivity-router' );
yield routerActions.prefetch( url.href );
} catch {
if ( pendingRefreshUrl === url.href ) {
@@ -157,7 +156,7 @@ const cartReferenceStorePart = {
try {
const {
actions: routerActions,
- }: typeof import('@wordpress/interactivity-router') =
+ }: typeof import( '@wordpress/interactivity-router' ) =
yield import( '@wordpress/interactivity-router' );
if (
window.location.href !== restoreUrl ||
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/collection-chooser.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/collection-chooser.tsx
index 2de675b8de2..7a56c858398 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/collection-chooser.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/collection-chooser.tsx
@@ -57,7 +57,7 @@ export const applyCollection = (
createBlocksFromInnerBlocksTemplate(
collection.innerBlocks
)
- );
+ );
replaceBlock( clientId, newBlock );
};
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 640e4f3392d..ca6f1e8c8dd 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
@@ -61,11 +61,11 @@ function useProducts(
// user needs to type more characters to get closer to actual
// product name.
per_page: 40,
- }
+ }
: {
// For a small catalog we fetch all the products.
per_page: 100,
- },
+ },
};
void getProducts( query ).then( ( results ) => {
const newProductsMap = new Map();
@@ -100,8 +100,9 @@ export const HandPickedProductsControlField = ( {
// Filter out any selected product IDs that no longer exist
const validSelectedProductIds = useMemo( () => {
- if ( ! selectedProductIds?.length || ! productsMap.size )
+ if ( ! selectedProductIds?.length || ! productsMap.size ) {
return selectedProductIds || [];
+ }
return selectedProductIds.filter( ( id ) => {
const product = productsMap.get( Number( id ) );
return !! product;
@@ -125,7 +126,9 @@ export const HandPickedProductsControlField = ( {
const product =
productsMap.get( nameOrId ) ||
productsMap.get( Number( nameOrId ) );
- if ( product ) acc.add( String( product.id ) );
+ if ( product ) {
+ acc.add( String( product.id ) );
+ }
return acc;
},
new Set< string >()
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/linked-product-control.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/linked-product-control.tsx
index 87eda1f8f8a..fffc588fc75 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/linked-product-control.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/linked-product-control.tsx
@@ -235,11 +235,11 @@ const LinkedProductControl = ( {
? __(
'Linked products will be pulled from the product a shopper is currently viewing',
'woocommerce'
- )
+ )
: __(
'Select a product to pull the linked products from',
'woocommerce'
- );
+ );
const handleRadioControlChange = ( newValue: string ) => {
if ( ! isProductReferenceType( newValue ) ) {
@@ -262,7 +262,7 @@ const LinkedProductControl = ( {
? {
...restQuery,
productReference: prevReference.current,
- }
+ }
: restQuery,
} );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/single-product-picker.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/single-product-picker.tsx
index 5a39de6a2d1..b54358402f3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/single-product-picker.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/edit/single-product-picker.tsx
@@ -37,7 +37,7 @@ const SingleProductPicker = (
? __(
'Previously selected product is no longer available.',
'woocommerce'
- )
+ )
: createInterpolateElement(
sprintf(
/* translators: %s: collection title */
@@ -48,7 +48,7 @@ const SingleProductPicker = (
collection.title
),
{ strong: <strong /> }
- );
+ );
return (
<div { ...blockProps }>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/frontend.ts
index 0f4e9404e43..c5cdc40bada 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/frontend.ts
@@ -169,9 +169,8 @@ const productCollectionStore = {
.closest( '[data-wp-router-region]' )
?.getAttribute( 'data-wp-router-region' );
- const { actions } = yield import(
- '@wordpress/interactivity-router'
- );
+ const { actions } =
+ yield import( '@wordpress/interactivity-router' );
yield actions.navigate( ref.href );
@@ -197,9 +196,8 @@ const productCollectionStore = {
const { ref } = getElement();
if ( isValidLink( ref ) ) {
- const { actions } = yield import(
- '@wordpress/interactivity-router'
- );
+ const { actions } =
+ yield import( '@wordpress/interactivity-router' );
yield actions.prefetch( ref.href );
}
@@ -249,9 +247,8 @@ const productCollectionStore = {
const context = getContext< ProductCollectionStoreContext >();
if ( isValidLink( ref ) && context.isPrefetchNextOrPreviousLink ) {
- const { actions } = yield import(
- '@wordpress/interactivity-router'
- );
+ const { actions } =
+ yield import( '@wordpress/interactivity-router' );
yield actions.prefetch( ref.href );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/carousel-layout-adjustments.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/carousel-layout-adjustments.ts
index 1b33b1a6970..91aed313ad8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/carousel-layout-adjustments.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/test/carousel-layout-adjustments.ts
@@ -64,11 +64,11 @@ async function setup( {
[ headingBlockName ],
[ productTemplateBlockName ],
INNER_BLOCKS_PAGINATION_TEMPLATE,
- ]
+ ]
: [
[ productTemplateBlockName ],
INNER_BLOCKS_PAGINATION_TEMPLATE,
- ],
+ ],
};
return initializeEditor( [ productCollectionBlock ] );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/types.ts
index 61ecd8b0df1..fd22f318f6a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/types.ts
@@ -155,11 +155,7 @@ export type ProductCollectionContentProps =
export type TProductCollectionOrder = 'asc' | 'desc';
export type TProductCollectionOrderBy =
- | 'date'
- | 'title'
- | 'popularity'
- | 'price'
- | 'rating';
+ 'date' | 'title' | 'popularity' | 'price' | 'rating';
export type ProductCollectionSetAttributes = (
attrs: Partial< ProductCollectionAttributes >
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 e193990baf6..efde7531d0c 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
@@ -79,8 +79,7 @@ export function setQueryAttribute(
) {
const currentBlock = select( blockEditorStore ).getBlock( block.clientId );
const currentAttributes = currentBlock?.attributes as
- | ProductCollectionAttributes
- | undefined;
+ ProductCollectionAttributes | undefined;
const query = currentAttributes?.query || block.attributes.query;
block.setAttributes( {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/utils.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/utils.ts
index 0c2a5f57d8c..4f598985673 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-details/utils.ts
@@ -113,7 +113,7 @@ export const getTemplate = (
],
],
],
- ]
+ ]
: [] ),
[
blockNames.item,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/block.tsx
index b9958778623..be3fb7d3804 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/block.tsx
@@ -145,7 +145,7 @@ export const AddToCartButton = ( {
cartQuantity,
productCartDetails,
isDescendantOfAddToCartWithOptions,
- } );
+ } );
const ButtonTag = allowAddToCart && ! isCartContents ? 'button' : 'a';
const buttonProps = {} as HTMLAnchorElement & { onClick: () => void };
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
index 0a6d21111fc..162b07cd4a4 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/frontend.ts
@@ -134,7 +134,9 @@ const productButtonStore = {
},
get displayViewCart(): boolean {
const { displayViewCart } = getContext< Context >();
- if ( ! displayViewCart ) return false;
+ if ( ! displayViewCart ) {
+ return false;
+ }
return state.quantity > 0;
},
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/index.tsx
index 8e595e38798..c509885cec8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/button/index.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @wordpress/no-unsafe-wp-apis */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/component-init.js b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/component-init.js
index b2f45d50982..83d3bf000df 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/component-init.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/component-init.js
@@ -11,94 +11,106 @@ __webpack_public_path__ = WC_BLOCKS_BUILD_URL;
registerBlockComponent( {
blockName: 'woocommerce/product-price',
- component: lazy( () =>
- import( /* webpackChunkName: "product-price" */ './price/block' )
+ component: lazy(
+ () => import( /* webpackChunkName: "product-price" */ './price/block' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-image',
- component: lazy( () =>
- import( /* webpackChunkName: "product-image" */ './image/frontend' )
+ component: lazy(
+ () =>
+ import( /* webpackChunkName: "product-image" */ './image/frontend' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-title',
- component: lazy( () =>
- import( /* webpackChunkName: "product-title" */ './title/frontend' )
+ component: lazy(
+ () =>
+ import( /* webpackChunkName: "product-title" */ './title/frontend' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-rating',
- component: lazy( () =>
- import( /* webpackChunkName: "product-rating" */ './rating/block' )
+ component: lazy(
+ () =>
+ import( /* webpackChunkName: "product-rating" */ './rating/block' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-rating-stars',
- component: lazy( () =>
- import(
- /* webpackChunkName: "product-rating-stars" */ './rating-stars/block'
- )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-rating-stars" */ './rating-stars/block'
+ )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-rating-counter',
- component: lazy( () =>
- import(
- /* webpackChunkName: "product-rating-counter" */ './rating-counter/block'
- )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-rating-counter" */ './rating-counter/block'
+ )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-average-rating',
- component: lazy( () =>
- import(
- /* webpackChunkName: "product-average-rating" */ './average-rating/block'
- )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-average-rating" */ './average-rating/block'
+ )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-button',
- component: lazy( () =>
- import( /* webpackChunkName: "product-button" */ './button/block' )
+ component: lazy(
+ () =>
+ import( /* webpackChunkName: "product-button" */ './button/block' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-summary',
- component: lazy( () =>
- import( /* webpackChunkName: "product-summary" */ './summary/block' )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-summary" */ './summary/block'
+ )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-sale-badge',
- component: lazy( () =>
- import(
- /* webpackChunkName: "product-sale-badge" */ './sale-badge/block'
- )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-sale-badge" */ './sale-badge/block'
+ )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-sku',
- component: lazy( () =>
- import( /* webpackChunkName: "product-sku" */ './sku/block' )
+ component: lazy(
+ () => import( /* webpackChunkName: "product-sku" */ './sku/block' )
),
} );
registerBlockComponent( {
blockName: 'woocommerce/product-stock-indicator',
- component: lazy( () =>
- import(
- /* webpackChunkName: "product-stock-indicator" */ './stock-indicator/block'
- )
+ component: lazy(
+ () =>
+ import(
+ /* webpackChunkName: "product-stock-indicator" */ './stock-indicator/block'
+ )
),
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/block.tsx
index 8c64f57f678..1b81f87a5f8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/block.tsx
@@ -231,7 +231,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
const ParentComponent = showProductLink ? 'a' : Fragment;
const anchorLabel = product?.name
? // translators: %s is the product name.
- sprintf( __( 'Link to %s', 'woocommerce' ), product.name )
+ sprintf( __( 'Link to %s', 'woocommerce' ), product.name )
: '';
const anchorProps = {
href: showProductLink ? product?.permalink : undefined,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/edit.tsx
index 3adba3f0908..364b8607838 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/image/edit.tsx
@@ -57,7 +57,6 @@ const Edit = ( {
( select ) => {
return {
wasBlockJustInserted:
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error method exists but not typed
select( blockEditorStore ).wasBlockJustInserted( clientId ),
isInProductGallery:
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/price/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/price/block.tsx
index 53179b18f3a..09729857bd7 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/price/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/price/block.tsx
@@ -86,7 +86,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
? {
isAdmin,
product: productData,
- }
+ }
: undefined
);
@@ -164,7 +164,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
product?.sale_price,
currency
),
- }
+ }
: {} ),
...( product?.regular_price
? {
@@ -172,7 +172,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
product?.regular_price,
currency
),
- }
+ }
: {} ),
currency_minor_unit: SITE_CURRENCY.minorUnit,
price_range:
@@ -186,7 +186,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
product.max_price,
currency
),
- }
+ }
: null,
};
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-image-gallery/upgrade-notice.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-image-gallery/upgrade-notice.tsx
index c4711ceb77b..723a29c0dc4 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-image-gallery/upgrade-notice.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-image-gallery/upgrade-notice.tsx
@@ -21,7 +21,7 @@ export const UpgradeNotice = ( {
? __(
'The classic Product Image Gallery block is not compatible with the Add to Cart + Options block in this template. Switch to the new Product Gallery block for a better experience.',
'woocommerce'
- )
+ )
: createInterpolateElement(
__(
'Upgrade to the <strongText /> for more flexibility.',
@@ -34,7 +34,7 @@ export const UpgradeNotice = ( {
</strong>
),
}
- );
+ );
const buttonLabel = __( 'Use the Product Gallery block', 'woocommerce' );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-meta/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-meta/edit.tsx
index 05841aa2ddd..36ecc060f97 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-meta/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/product-meta/edit.tsx
@@ -20,6 +20,7 @@ const Edit = () => {
[
'core/post-terms',
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
prefix: __( 'Category: ', 'woocommerce' ),
term: 'product_cat',
},
@@ -27,6 +28,7 @@ const Edit = () => {
[
'core/post-terms',
{
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
prefix: __( 'Tags: ', 'woocommerce' ),
term: 'product_tag',
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/rating-counter/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/rating-counter/block.tsx
index 82971214e8e..1b5a21e2497 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/rating-counter/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/rating-counter/block.tsx
@@ -33,7 +33,7 @@ const ReviewsCount = ( props: { reviews: number } ): JSX.Element => {
'woocommerce'
),
reviews
- )
+ )
: __( '(X customer reviews)', 'woocommerce' );
return (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/sale-badge/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/sale-badge/block.tsx
index 76e47991ab2..9674dde77b4 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/sale-badge/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/sale-badge/block.tsx
@@ -65,11 +65,11 @@ export const Block = ( props: Props ): ReactElement | null => {
/* translators: %s: discount percentage. %% is the percent sign. */
__( '%s%%', 'woocommerce' ),
percentage
- )
+ )
: formatPrice(
discount,
getCurrencyFromPriceResponse( prices )
- );
+ );
// Parent prices are independent minima, so the editor preview may differ from the largest variation discount.
label =
product.type === 'variable'
@@ -77,10 +77,10 @@ export const Block = ( props: Props ): ReactElement | null => {
/* translators: %s: approximate discount for a variable product in the editor. */
__( 'Up to %s', 'woocommerce' ),
value
- )
+ )
: `${ props.prefix ?? '' }${ value }${
props.suffix ?? ''
- }`;
+ }`;
}
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/stock-indicator/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/stock-indicator/block.tsx
index 24d9e1a66ed..f404354733d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/stock-indicator/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/stock-indicator/block.tsx
@@ -85,8 +85,7 @@ export const Block = ( props: Props ): JSX.Element | null => {
// When inside All products block
...( props.isDescendantOfAllProducts && {
[ styleProps.className ]: styleProps.className,
- 'wc-block-components-product-stock-indicator wp-block-woocommerce-product-stock-indicator':
- true,
+ 'wc-block-components-product-stock-indicator wp-block-woocommerce-product-stock-indicator': true,
} ),
} ) }
// When inside All products block
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/title/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/title/index.tsx
index 1b4cc562b73..9e314b3e4fb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/title/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-elements-blocks/title/index.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @wordpress/no-unsafe-wp-apis */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/__tests__/frontend.test.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/__tests__/frontend.test.ts
index 691e68ca930..a8838296a4e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/__tests__/frontend.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/__tests__/frontend.test.ts
@@ -336,7 +336,7 @@ describe( 'product filters interactivity store', () => {
actions: {
navigate: routerNavigate,
},
- } as unknown as typeof import('@wordpress/interactivity-router') );
+ } as unknown as typeof import( '@wordpress/interactivity-router' ) );
expect( routerNavigate ).toHaveBeenCalledTimes( 1 );
const [ navigatedUrl ] = routerNavigate.mock.calls[ 0 ];
@@ -500,7 +500,7 @@ describe( 'product filters interactivity store', () => {
expect( firstYield.done ).toBe( false );
iterator.next( {
actions: { navigate: routerNavigate },
- } as unknown as typeof import('@wordpress/interactivity-router') );
+ } as unknown as typeof import( '@wordpress/interactivity-router' ) );
expect( mockReload ).not.toHaveBeenCalled();
expect( routerNavigate ).toHaveBeenCalledTimes( 1 );
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 9ebb0e83df9..d8429c182a6 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
@@ -82,8 +82,9 @@ const productFiltersStore = {
const params: Record< string, string > = {};
function addParam( key: string, value: string ) {
- if ( key in params && params[ key ].length > 0 )
+ if ( key in params && params[ key ].length > 0 ) {
return ( params[ key ] = `${ params[ key ] },${ value }` );
+ }
params[ key ] = value;
}
@@ -94,12 +95,18 @@ const productFiltersStore = {
// todo: refactor this to use params data from Automattic\WooCommerce\Internal\ProductFilters\Params.
const { type, value } = filter;
- if ( ! value ) return;
+ if ( ! value ) {
+ return;
+ }
if ( type === 'price' ) {
const [ min, max ] = value.split( '|' );
- if ( min ) params.min_price = min;
- if ( max ) params.max_price = max;
+ if ( min ) {
+ params.min_price = min;
+ }
+ if ( max ) {
+ params.max_price = max;
+ }
}
if ( type === 'status' ) {
@@ -149,7 +156,9 @@ const productFiltersStore = {
? getServerContext< ProductFiltersContext >()
: getContext< ProductFiltersContext >();
const items = server.items;
- if ( ! Array.isArray( items ) ) return [];
+ if ( ! Array.isArray( items ) ) {
+ return [];
+ }
return items.map( ( item ) => ( {
...item,
selected: state.activeFilters.some(
@@ -204,7 +213,9 @@ const productFiltersStore = {
itemArg && ! ( itemArg instanceof Event )
? itemArg
: context.item;
- if ( ! item || ! isValidFilterOptionItem( item ) ) return;
+ if ( ! item || ! isValidFilterOptionItem( item ) ) {
+ return;
+ }
const isSelected = state.activeFilters.some(
( f ) => f.type === item.type && f.value === item.value
);
@@ -265,7 +276,7 @@ const productFiltersStore = {
return;
}
- const routerModule: typeof import('@wordpress/interactivity-router') =
+ const routerModule: typeof import( '@wordpress/interactivity-router' ) =
yield import( '@wordpress/interactivity-router' );
yield routerModule.actions.navigate( url.href );
@@ -274,7 +285,9 @@ const productFiltersStore = {
callbacks: {
initColors: () => {
const el = getElement();
- if ( ! el.ref ) return;
+ if ( ! el.ref ) {
+ return;
+ }
const style = el.ref.style;
const hasBg = style.getPropertyValue(
@@ -309,7 +322,9 @@ const productFiltersStore = {
}
},
syncActiveFiltersWithServer: () => {
- if ( ! getServerContext ) return;
+ if ( ! getServerContext ) {
+ return;
+ }
const context = getContext< ProductFiltersContext >();
const serverContext = getServerContext< ProductFiltersContext >();
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 631a2f74578..79945261ea0 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
@@ -60,7 +60,7 @@ const activeFiltersStore = {
};
// Compile-time protocol conformance check.
-// eslint-disable-next-line @typescript-eslint/no-unused-expressions
+
activeFiltersStore satisfies RemovableItemsParentStore;
const { state, actions } = store<
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/edit.tsx
index 1826cdb0c76..b00214a0d5c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/edit.tsx
@@ -83,7 +83,9 @@ const Edit = ( props: EditProps ) => {
} );
useEffect( () => {
- if ( isTermsLoading || isFilterCountsLoading ) return;
+ if ( isTermsLoading || isFilterCountsLoading ) {
+ return;
+ }
const termIdHasProducts =
objectHasProp( filteredCounts, 'attribute_counts' ) &&
@@ -96,8 +98,9 @@ const Edit = ( props: EditProps ) => {
} else {
const filteredOptions = attributeTerms
.filter( ( term ) => {
- if ( hideEmpty )
+ if ( hideEmpty ) {
return termIdHasProducts.includes( term.id );
+ }
return true;
} )
.map( ( term, index ) => ( {
@@ -158,7 +161,7 @@ const Edit = ( props: EditProps ) => {
const isLoading =
isTermsLoading || isFilterCountsLoading || isOptionsLoading;
- if ( Object.keys( ATTRIBUTES ).length === 0 )
+ if ( Object.keys( ATTRIBUTES ).length === 0 ) {
return (
<div { ...innerBlocksProps }>
<Inspector { ...props } />
@@ -172,8 +175,9 @@ const Edit = ( props: EditProps ) => {
</Notice>
</div>
);
+ }
- if ( ! attributeId || ! attributeObject )
+ if ( ! attributeId || ! attributeObject ) {
return (
<div { ...innerBlocksProps }>
<Inspector { ...props } />
@@ -187,8 +191,9 @@ const Edit = ( props: EditProps ) => {
</Notice>
</div>
);
+ }
- if ( ! isLoading && attributeTerms.length === 0 )
+ if ( ! isLoading && attributeTerms.length === 0 ) {
return (
<div { ...innerBlocksProps }>
<Inspector { ...props } />
@@ -202,6 +207,7 @@ const Edit = ( props: EditProps ) => {
</Notice>
</div>
);
+ }
return (
<div { ...innerBlocksProps }>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx
index 78bb15bcf62..5718bc87b32 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx
@@ -128,11 +128,11 @@ export const Inspector = ( {
{
b: <strong />,
}
- )
+ )
: __(
"Display products that match any of the selected attributes (they don't need to match all).",
'woocommerce'
- )
+ )
}
>
<ToggleGroupControlOption
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/edit.tsx
index cbc06929129..a3b3a08d623 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/edit.tsx
@@ -147,7 +147,7 @@ const CheckboxListEdit = ( props: EditProps ): JSX.Element => {
{ typeof item.label === 'string'
? decodeHtmlEntities(
item.label
- )
+ )
: item.label }
</span>
{ item.count !== undefined && (
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/frontend.ts
index e0820352f30..bfad06a8e23 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/checkbox-list/frontend.ts
@@ -43,7 +43,9 @@ type CheckboxListStore = {
};
function getParentStore( storeNamespace?: string ) {
- if ( ! storeNamespace ) return undefined;
+ if ( ! storeNamespace ) {
+ return undefined;
+ }
return store<
SelectableItemsParentStore< { visual?: VisualAttributeTerm } >
>( storeNamespace );
@@ -71,7 +73,9 @@ const { state }: CheckboxListStore = store< CheckboxListStore >(
getContext< CheckboxListContext >();
const parentItems =
getParentStore( storeNamespace )?.state?.selectableItems;
- if ( ! Array.isArray( parentItems ) ) return [];
+ if ( ! Array.isArray( parentItems ) ) {
+ return [];
+ }
const normalizedDisplayLimit =
normalizeDisplayLimit( displayLimit );
return parentItems.map( ( item, index ) => ( {
@@ -86,7 +90,9 @@ const { state }: CheckboxListStore = store< CheckboxListStore >(
},
get ratingStyle(): string {
const item = getCurrentItem();
- if ( ! item ) return '';
+ if ( ! item ) {
+ return '';
+ }
return `width: ${ Number( item.value ) * 20 }%`;
},
get colorSwatchStyle(): string {
@@ -101,7 +107,9 @@ const { state }: CheckboxListStore = store< CheckboxListStore >(
actions: {
toggle() {
const item = getCurrentItem();
- if ( ! item ) return;
+ if ( ! item ) {
+ return;
+ }
const { storeNamespace } = getContext< CheckboxListContext >();
getParentStore( storeNamespace )?.actions?.toggle?.( item );
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/edit.tsx
index 6bf968f9fe0..0e49ef593b7 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/edit.tsx
@@ -176,7 +176,7 @@ const Edit = ( props: EditProps ): JSX.Element => {
{ typeof item.label === 'string'
? decodeHtmlEntities(
item.label
- )
+ )
: item.label }
</span>
{ item.count !== undefined && (
@@ -225,7 +225,7 @@ const Edit = ( props: EditProps ): JSX.Element => {
} );
},
},
- ]
+ ]
: [] ),
{
label: __(
@@ -299,7 +299,7 @@ const Edit = ( props: EditProps ): JSX.Element => {
} );
},
},
- ]
+ ]
: [] ),
{
label: __(
@@ -351,7 +351,7 @@ const Edit = ( props: EditProps ): JSX.Element => {
} );
},
},
- ]
+ ]
: [] ),
] }
panelId={ clientId }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
index 0427b31b22d..9f49795118d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/chips/frontend.ts
@@ -48,7 +48,9 @@ type ChipsStore = {
};
function getParentStore( storeNamespace?: string ) {
- if ( ! storeNamespace ) return undefined;
+ if ( ! storeNamespace ) {
+ return undefined;
+ }
return store<
SelectableItemsParentStore< { visual?: VisualAttributeTerm } >
>( storeNamespace );
@@ -101,7 +103,9 @@ const { state }: ChipsStore = store< ChipsStore >(
getContext< ChipsContext >();
const parentItems =
getParentStore( storeNamespace )?.state?.selectableItems;
- if ( ! Array.isArray( parentItems ) ) return [];
+ if ( ! Array.isArray( parentItems ) ) {
+ return [];
+ }
const normalizedDisplayLimit =
normalizeDisplayLimit( displayLimit );
return parentItems.map( ( item, index ) => ( {
@@ -126,7 +130,9 @@ const { state }: ChipsStore = store< ChipsStore >(
actions: {
toggle() {
const item = getCurrentItem();
- if ( ! item ) return;
+ if ( ! item ) {
+ return;
+ }
const { storeNamespace } = getContext< ChipsContext >();
getParentStore( storeNamespace )?.actions?.toggle?.( item );
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-filter/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-filter/frontend.ts
index 6493ab95a19..d12133bb00f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-filter/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/price-filter/frontend.ts
@@ -71,7 +71,7 @@ const productFilterPriceStore = {
? getServerContext< ProductFilterPriceContext >()
: getContext< ProductFilterPriceContext >();
const { activePriceLabelTemplates } = getConfig();
- if ( min && min > minRange && max && max < maxRange )
+ if ( min && min > minRange && max && max < maxRange ) {
return {
activeValue: `${ min }|${ max }`,
activeLabel: activePriceLabelTemplates.minAndMax
@@ -84,6 +84,7 @@ const productFilterPriceStore = {
formatPrice( max, getCurrency( { minorUnit: 0 } ) )
),
};
+ }
if ( min && min > minRange ) {
return {
@@ -140,8 +141,12 @@ const productFilterPriceStore = {
price.max = value;
}
- if ( price.min === minRange ) price.min = 0;
- if ( price.max === maxRange ) price.max = 0;
+ if ( price.min === minRange ) {
+ price.min = 0;
+ }
+ if ( price.max === maxRange ) {
+ price.max = 0;
+ }
context.activeFilters = context.activeFilters.filter(
( item ) => item.type !== 'price'
@@ -173,7 +178,7 @@ const productFilterPriceStore = {
};
// Compile-time protocol conformance check.
-// eslint-disable-next-line @typescript-eslint/no-unused-expressions
+
productFilterPriceStore satisfies RangeInputParentStore;
export type ProductFilterPriceStore = typeof productFilterPriceStore;
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 4cbd554059b..5129b2d4e54 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
@@ -22,7 +22,9 @@ function debounceWithScope< Args extends unknown[] >(
) {
let timer: ReturnType< typeof setTimeout > | null;
return function ( this: unknown, ...args: Args ) {
- if ( timer ) clearTimeout( timer );
+ if ( timer ) {
+ clearTimeout( timer );
+ }
timer = setTimeout(
withScope( () => {
func.apply( this, args );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/edit.tsx
index 8ef910508ef..9a2948fe89d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/status-filter/edit.tsx
@@ -60,7 +60,9 @@ const Edit = ( props: EditProps ) => {
const items = useMemo( () => {
return Object.entries( stockStatusOptions )
.filter( ( [ key ] ) => {
- if ( ! hideEmpty ) return true;
+ if ( ! hideEmpty ) {
+ return true;
+ }
const count =
filteredCounts?.stock_status_counts?.find(
( item ) => item.status === key
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/taxonomy-filter/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/taxonomy-filter/edit.tsx
index f8b535c5423..3e398d55caa 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/taxonomy-filter/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/taxonomy-filter/edit.tsx
@@ -117,9 +117,8 @@ const Edit = ( props: EditProps ) => {
? sortFilterOptions( [ ...termOptionsPreview ], sortOrder )
: []
);
- const [ isOptionsLoading, setIsOptionsLoading ] = useState< boolean >(
- ! isPreview
- );
+ const [ isOptionsLoading, setIsOptionsLoading ] =
+ useState< boolean >( ! isPreview );
// Fetch taxonomy terms using WordPress core data
const { taxonomyTerms, isTermsLoading } = useSelect(
@@ -140,8 +139,7 @@ const Edit = ( props: EditProps ) => {
return {
taxonomyTerms:
( getEntityRecords( 'taxonomy', taxonomy, selectArgs ) as
- | WPTaxonomyTerm[]
- | null ) || EMPTY_TAXONOMY_TERMS,
+ WPTaxonomyTerm[] | null ) || EMPTY_TAXONOMY_TERMS,
isTermsLoading: ! hasFinishedResolution( 'getEntityRecords', [
'taxonomy',
taxonomy,
@@ -270,7 +268,7 @@ const Edit = ( props: EditProps ) => {
? false
: isTermsLoading || isFilterCountsLoading || isOptionsLoading;
- if ( ! taxonomy )
+ if ( ! taxonomy ) {
return (
<div { ...innerBlocksProps }>
<TaxonomyFilterInspectorControls { ...props } />
@@ -284,8 +282,9 @@ const Edit = ( props: EditProps ) => {
</Notice>
</div>
);
+ }
- if ( ! isLoading && ! isPreview && taxonomyTerms.length === 0 )
+ if ( ! isLoading && ! isPreview && taxonomyTerms.length === 0 ) {
return (
<div { ...innerBlocksProps }>
<TaxonomyFilterInspectorControls { ...props } />
@@ -303,6 +302,7 @@ const Edit = ( props: EditProps ) => {
</Notice>
</div>
);
+ }
return (
<div { ...innerBlocksProps }>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/frontend.ts
index 778e4cf9d27..2e0907f77e6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/frontend.ts
@@ -836,7 +836,7 @@ const productGallery = {
: getVariationImageSetByCurrentImage(
productImageSet,
currentImageId
- );
+ );
if ( variationImageSet?.image_ids?.length ) {
actions.setImageData(
@@ -1026,7 +1026,9 @@ const productGallery = {
// See https://github.com/woocommerce/woocommerce/issues/59810.
hideGhostOverflow: () => {
const element = getElement()?.ref as HTMLElement;
- if ( ! element ) return;
+ if ( ! element ) {
+ return;
+ }
const { clientWidth, scrollWidth } = element;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/inner-blocks/product-gallery-thumbnails/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/inner-blocks/product-gallery-thumbnails/edit.tsx
index 54480087296..86558e14928 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/inner-blocks/product-gallery-thumbnails/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/inner-blocks/product-gallery-thumbnails/edit.tsx
@@ -58,7 +58,7 @@ export const Edit = ( {
: Array( MAX_THUMBNAILS ).fill( {
src: PLACEHOLDER_IMG_SRC,
alt: '',
- } );
+ } );
const renderThumbnails = noProductContext || ! hasOneOrNoImages;
const scrollableRef = useRef< HTMLDivElement >( null );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls.tsx
index f8282e08740..303ef053784 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls.tsx
@@ -74,7 +74,7 @@ function useDefaultWooQueryParamsForVariation(
...NAMESPACED_CONTROLS.map( ( key ) => ( {
[ key ]: variationAttributes.query[ key ],
} ) )
- )
+ )
: {};
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/attributes-filter.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/attributes-filter.tsx
index 85c867b7812..3c3b85c99b8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/attributes-filter.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/attributes-filter.tsx
@@ -43,7 +43,6 @@ export const AttributesFilter = ( props: ProductQueryBlock ) => {
selected={ selected }
onChange={ ( attributes ) => {
const __woocommerceAttributes = attributes.map(
- // eslint-disable-next-line @typescript-eslint/naming-convention
( { id, value } ) => ( {
termId: id,
taxonomy: value,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/popular-presets.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/popular-presets.tsx
index ab16668db89..5400d80f43c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/popular-presets.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-query/inspector-controls/popular-presets.tsx
@@ -42,7 +42,9 @@ export function PopularPresets( props: ProductQueryBlock ) {
hideLabelFromVision={ true }
label={ __( 'Choose among these pre-sets', 'woocommerce' ) }
onChange={ ( option ) => {
- if ( ! option.selectedItem?.key ) return;
+ if ( ! option.selectedItem?.key ) {
+ return;
+ }
const [ orderBy, order ] = option.selectedItem?.key?.split(
'/'
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 38208c6c103..359f54bcd19 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
@@ -82,7 +82,7 @@ export const ProductSelector = ( props: ProductQueryBlock ) => {
? token
: productsList.find(
( product ) => product.id === Number( token )
- )?.name || ''
+ )?.name || ''
}
label={ __( 'Pick some products', 'woocommerce' ) }
onChange={ onTokenChange }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/frontend.ts
index 4f6b78c2b02..3f8eb3e40c6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/frontend.ts
@@ -23,18 +23,17 @@ const productReviewsStore = {
return;
}
- const { actions } = yield import(
- '@wordpress/interactivity-router'
- );
+ const { actions } =
+ yield import( '@wordpress/interactivity-router' );
yield actions.navigate( ref.href );
- ref
- .closest( '.wp-block-woocommerce-product-details' )
- ?.scrollIntoView( {
- behavior: 'smooth',
- block: 'start',
- } );
+ ref.closest(
+ '.wp-block-woocommerce-product-details'
+ )?.scrollIntoView( {
+ behavior: 'smooth',
+ block: 'start',
+ } );
},
},
};
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 97ed6bc71e9..4086f8fc3de 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
@@ -83,7 +83,9 @@ const CommentsForm = ( {
);
const setReviewsAllowed = ( allowed: boolean ) => {
- if ( ! postId ) return;
+ if ( ! postId ) {
+ return;
+ }
void updateProduct( Number( postId ), {
reviews_allowed: allowed,
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/edit.tsx
index 75f7932ba14..8c9ce5b1565 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/edit.tsx
@@ -169,7 +169,7 @@ export default function ReviewTemplateEdit( {
const { commentOrder, commentsPerPage, pageComments } = useSelect(
( select ) => {
const { getSettings } = select( blockEditorStore ) as unknown as {
- getSettings(): {
+ getSettings: () => {
// eslint-disable-next-line @typescript-eslint/naming-convention
__experimentalDiscussionSettings: {
commentOrder: string;
@@ -191,7 +191,7 @@ export default function ReviewTemplateEdit( {
( select ) => {
const { getEntityRecords } = select( coreStore );
const { getBlocks } = select( blockEditorStore ) as unknown as {
- getBlocks( clientId: string ): BlockInstance[];
+ getBlocks: ( clientId: string ) => BlockInstance[];
};
return {
topLevelComments: commentQuery
@@ -199,10 +199,10 @@ export default function ReviewTemplateEdit( {
'root',
'comment',
commentQuery
- ) as ( WPComment & {
+ ) as ( WPComment & {
// eslint-disable-next-line @typescript-eslint/naming-convention
_embedded?: { children?: WPComment[][] };
- } )[] )
+ } )[] )
: null,
blocks: getBlocks( clientId ),
};
@@ -231,7 +231,7 @@ export default function ReviewTemplateEdit( {
return {
id: comment.id,
};
- } )
+ } )
: [],
commentOrder
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/hooks.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/hooks.tsx
index 04028ce75ac..01fe40293b6 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/hooks.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/review-template/hooks.tsx
@@ -115,7 +115,7 @@ export const useCommentQueryArgs = ( { postId }: { postId: number } ) => {
defaultCommentsPage: defaultPage,
} = useSelect( ( select ) => {
const { getSettings } = select( blockEditorStore ) as unknown as {
- getSettings(): {
+ getSettings: () => {
// eslint-disable-next-line @typescript-eslint/naming-convention
__experimentalDiscussionSettings: {
pageComments: boolean;
@@ -153,7 +153,7 @@ export const useCommentQueryArgs = ( { postId }: { postId: number } ) => {
post: postId,
per_page: perPage,
page,
- }
+ }
: null;
}, [ page, queryArgs, postId, perPage ] );
};
@@ -176,7 +176,7 @@ export const useCommentTree = (
children: Array.isArray( children )
? children.map( ( child ) => ( {
commentId: child.id,
- } ) )
+ } ) )
: [],
};
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/reviews-title/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/reviews-title/edit.tsx
index e7e3f4515ac..f627b5cb359 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/reviews-title/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-reviews/inner-blocks/reviews-title/edit.tsx
@@ -35,7 +35,7 @@ function getProductReviewsTitle(
/* translators: %s: Product title. */
__( 'One review for %s', 'woocommerce' ),
productTitle
- )
+ )
: sprintf(
/* translators: 1: Number of comments, 2: Product title. */
_n(
@@ -46,7 +46,7 @@ function getProductReviewsTitle(
),
reviewsCount,
productTitle
- );
+ );
}
if ( ! showReviewsCount && showProductTitle ) {
@@ -55,12 +55,12 @@ function getProductReviewsTitle(
/* translators: %s: Product title. */
__( 'Review for %s', 'woocommerce' ),
productTitle
- )
+ )
: sprintf(
/* translators: %s: Product title. */
__( 'Reviews for %s', 'woocommerce' ),
productTitle
- );
+ );
}
if ( showReviewsCount && ! showProductTitle ) {
@@ -75,7 +75,7 @@ function getProductReviewsTitle(
'woocommerce'
),
reviewsCount
- );
+ );
}
if ( reviewsCount === 1 ) {
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 4f23a341365..0028624f552 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
@@ -170,7 +170,7 @@ registerBlockType( SEARCH_VARIATION_NAME, {
function registerProductSearchNamespace( props: BlockType, blockName: string ) {
if ( blockName === 'core/search' ) {
// Gracefully handle if settings.attributes is undefined.
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+
// @ts-ignore -- We need this because `attributes` is marked as `readonly`
props.attributes = {
...props.attributes,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/types.ts
index 290523ae727..969b72e7b63 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-search/types.ts
@@ -4,10 +4,7 @@
import type { EditorBlock } from '@woocommerce/types';
export type ButtonPositionProps =
- | 'button-outside'
- | 'button-inside'
- | 'no-button'
- | 'button-only';
+ 'button-outside' | 'button-inside' | 'no-button' | 'button-only';
export interface SearchBlockAttributes {
buttonPosition: ButtonPositionProps;
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-specifications/edit.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-specifications/edit.tsx
index 0e14dad5e84..f6154317a76 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-specifications/edit.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-specifications/edit.tsx
@@ -29,7 +29,9 @@ const getFormattedDimensions = (
dimensions: Product[ 'dimensions' ],
dimensionUnit: string
) => {
- if ( ! dimensions ) return '';
+ if ( ! dimensions ) {
+ return '';
+ }
const dimensionKeys = [
'length',
@@ -44,7 +46,9 @@ const getFormattedDimensions = (
typeof value === 'string' && value.length > 0
);
- if ( validDimensions.length === 0 ) return '';
+ if ( validDimensions.length === 0 ) {
+ return '';
+ }
return `${ validDimensions.join( ' × ' ) } ${ dimensionUnit }`;
};
@@ -90,7 +94,9 @@ const Edit = ( {
const { product, isLoadingProduct } = useSelect(
( select ) => {
- if ( ! postId ) return EMPTY_PRODUCT_RESULT;
+ if ( ! postId ) {
+ return EMPTY_PRODUCT_RESULT;
+ }
const { getProduct } = select( productsStore );
return {
product: getProduct( Number( postId ) ),
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/test/utils.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/test/utils.tsx
index f3597291bee..d0ad1b9c6d5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/test/utils.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-template/test/utils.tsx
@@ -47,7 +47,7 @@ beforeAll( () => {
type: 'boolean',
default: false,
},
- }
+ }
: {},
edit: () => null,
save: () => null,
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/rating-filter/test/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/rating-filter/test/block.tsx
index bda6721078d..36f04a783bf 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/rating-filter/test/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/rating-filter/test/block.tsx
@@ -6,6 +6,8 @@
* External dependencies
*/
import React from '@wordpress/element';
+import { dispatch } from '@wordpress/data';
+import { QUERY_STATE_STORE_KEY } from '@woocommerce/block-data';
import {
act,
cleanup,
@@ -79,6 +81,7 @@ const selectors = {
const setup = ( params: SetupParams ) => {
cleanup();
+ dispatch( QUERY_STATE_STORE_KEY ).setValueForQueryContext( 'page', {} );
const url = `http://woo.local/${
params.filterRating ? '?rating_filter=' + params.filterRating : ''
}`;
@@ -115,7 +118,7 @@ const setup = ( params: SetupParams ) => {
chipsContainer
? within( chipsContainer ).queryByLabelText(
`Rated ${ value } out of 5`
- )
+ )
: false
);
@@ -234,63 +237,64 @@ describe( 'Filter by Rating block', () => {
} );
test( 'replaces chosen option when another one is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '2';
- const {
- getDropdown,
- getRating2Chips,
- getRating4Chips,
- getRating4Suggestion,
- } = setupSingleChoiceDropdown( ratingParam );
+ const ratingParam = '2';
+ const {
+ getDropdown,
+ getRating2Chips,
+ getRating4Chips,
+ getRating4Suggestion,
+ } = setupSingleChoiceDropdown( ratingParam );
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeNull();
+ expect( getRating2Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeNull();
- const dropdown = getDropdown();
+ const dropdown = getDropdown();
- if ( dropdown ) {
+ if ( dropdown ) {
+ await act( async () => {
await userEvent.click( dropdown );
- acceptErrorWithDuplicatedKeys();
- }
+ } );
+ acceptErrorWithDuplicatedKeys();
+ }
- const rating4Suggestion = getRating4Suggestion();
+ const rating4Suggestion = getRating4Suggestion();
- if ( rating4Suggestion ) {
+ if ( rating4Suggestion ) {
+ await act( async () => {
await userEvent.click( rating4Suggestion );
- }
+ } );
+ }
- expect( getRating2Chips() ).toBeNull();
- expect( getRating4Chips() ).toBeInTheDocument();
- } );
+ expect( getRating4Chips() ).toBeInTheDocument();
+ expect( getRating2Chips() ).toBeNull();
} );
test( 'removes the option when the X button is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '4';
- const {
- getRating2Chips,
- getRating4Chips,
- getRating5Chips,
- getRemoveButtonFromChips,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getRating2Chips() ).toBeNull();
- expect( getRating4Chips() ).toBeInTheDocument();
- expect( getRating5Chips() ).toBeNull();
-
- const removeRating4Button = getRemoveButtonFromChips(
- getRating4Chips()
- );
-
- if ( removeRating4Button ) {
+ const ratingParam = '4';
+ const {
+ getRating2Chips,
+ getRating4Chips,
+ getRating5Chips,
+ getRemoveButtonFromChips,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getRating2Chips() ).toBeNull();
+ expect( getRating4Chips() ).toBeInTheDocument();
+ expect( getRating5Chips() ).toBeNull();
+
+ const removeRating4Button =
+ getRemoveButtonFromChips( getRating4Chips() );
+
+ if ( removeRating4Button ) {
+ await act( async () => {
await userEvent.click( removeRating4Button );
- acceptErrorWithDuplicatedKeys();
- }
+ } );
+ acceptErrorWithDuplicatedKeys();
+ }
- expect( getRating2Chips() ).toBeNull();
- expect( getRating4Chips() ).toBeNull();
- expect( getRating5Chips() ).toBeNull();
- } );
+ expect( getRating5Chips() ).toBeNull();
+ expect( getRating4Chips() ).toBeNull();
+ expect( getRating2Chips() ).toBeNull();
} );
} );
@@ -314,76 +318,79 @@ describe( 'Filter by Rating block', () => {
} );
test( 'adds chosen option to another one that is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '2';
- const {
- getDropdown,
- getRating2Chips,
- getRating4Chips,
- getRating5Chips,
- getRating4Suggestion,
- getRating5Suggestion,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeNull();
- expect( getRating5Chips() ).toBeNull();
-
- const dropdown = getDropdown();
-
- if ( dropdown ) {
+ const ratingParam = '2';
+ const {
+ getDropdown,
+ getRating2Chips,
+ getRating4Chips,
+ getRating5Chips,
+ getRating4Suggestion,
+ getRating5Suggestion,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getRating2Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeNull();
+ expect( getRating5Chips() ).toBeNull();
+
+ const dropdown = getDropdown();
+
+ if ( dropdown ) {
+ await act( async () => {
await userEvent.click( dropdown );
- acceptErrorWithDuplicatedKeys();
- }
+ } );
+ acceptErrorWithDuplicatedKeys();
+ }
- const rating4Suggestion = getRating4Suggestion();
+ const rating4Suggestion = getRating4Suggestion();
- if ( rating4Suggestion ) {
+ if ( rating4Suggestion ) {
+ await act( async () => {
await userEvent.click( rating4Suggestion );
- }
+ } );
+ }
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeInTheDocument();
- expect( getRating5Chips() ).toBeNull();
+ expect( getRating2Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeInTheDocument();
+ expect( getRating5Chips() ).toBeNull();
- const rating5Suggestion = getRating5Suggestion();
+ const rating5Suggestion = getRating5Suggestion();
- if ( rating5Suggestion ) {
+ if ( rating5Suggestion ) {
+ await act( async () => {
await userEvent.click( rating5Suggestion );
- }
+ } );
+ }
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeInTheDocument();
- expect( getRating5Chips() ).toBeInTheDocument();
- } );
+ expect( getRating5Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeInTheDocument();
+ expect( getRating2Chips() ).toBeInTheDocument();
} );
test( 'removes the option when the X button is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '2,4,5';
- const {
- getRating2Chips,
- getRating4Chips,
- getRating5Chips,
- getRemoveButtonFromChips,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeInTheDocument();
- expect( getRating5Chips() ).toBeInTheDocument();
-
- const removeRating4Button = getRemoveButtonFromChips(
- getRating4Chips()
- );
-
- if ( removeRating4Button ) {
+ const ratingParam = '2,4,5';
+ const {
+ getRating2Chips,
+ getRating4Chips,
+ getRating5Chips,
+ getRemoveButtonFromChips,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getRating2Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeInTheDocument();
+ expect( getRating5Chips() ).toBeInTheDocument();
+
+ const removeRating4Button =
+ getRemoveButtonFromChips( getRating4Chips() );
+
+ if ( removeRating4Button ) {
+ await act( async () => {
await userEvent.click( removeRating4Button );
- }
+ } );
+ }
- expect( getRating2Chips() ).toBeInTheDocument();
- expect( getRating4Chips() ).toBeNull();
- expect( getRating5Chips() ).toBeInTheDocument();
- } );
+ expect( getRating5Chips() ).toBeInTheDocument();
+ expect( getRating4Chips() ).toBeNull();
+ expect( getRating2Chips() ).toBeInTheDocument();
} );
} );
@@ -410,55 +417,53 @@ describe( 'Filter by Rating block', () => {
} );
test( 'replaces chosen option when another one is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '2';
- const {
- getRating2Checkbox,
- getRating4Checkbox,
- getRating5Checkbox,
- } = setupSingleChoiceList( ratingParam );
+ const ratingParam = '2';
+ const {
+ getRating2Checkbox,
+ getRating4Checkbox,
+ getRating5Checkbox,
+ } = setupSingleChoiceList( ratingParam );
- expect( getRating2Checkbox()?.checked ).toBeTruthy();
- expect( getRating4Checkbox()?.checked ).toBeFalsy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating2Checkbox()?.checked ).toBeTruthy();
+ expect( getRating4Checkbox()?.checked ).toBeFalsy();
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
- const rating4checkbox = getRating4Checkbox();
+ const rating4checkbox = getRating4Checkbox();
- if ( rating4checkbox ) {
- await act( async () => {
- await userEvent.click( rating4checkbox );
- } );
- }
+ if ( rating4checkbox ) {
+ await act( async () => {
+ await userEvent.click( rating4checkbox );
+ } );
+ }
- expect( getRating2Checkbox()?.checked ).toBeFalsy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
- } );
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating2Checkbox()?.checked ).toBeFalsy();
} );
test( 'removes the option when it is clicked again', async () => {
- await waitFor( async () => {
- const ratingParam = '4';
- const {
- getRating2Checkbox,
- getRating4Checkbox,
- getRating5Checkbox,
- } = setupMultipleChoiceList( ratingParam );
+ const ratingParam = '4';
+ const {
+ getRating2Checkbox,
+ getRating4Checkbox,
+ getRating5Checkbox,
+ } = setupMultipleChoiceList( ratingParam );
- expect( getRating2Checkbox()?.checked ).toBeFalsy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating2Checkbox()?.checked ).toBeFalsy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
- const rating4checkbox = getRating4Checkbox();
+ const rating4checkbox = getRating4Checkbox();
- if ( rating4checkbox ) {
+ if ( rating4checkbox ) {
+ await act( async () => {
await userEvent.click( rating4checkbox );
- }
+ } );
+ }
- expect( getRating2Checkbox()?.checked ).toBeFalsy();
- expect( getRating4Checkbox()?.checked ).toBeFalsy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
- } );
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating4Checkbox()?.checked ).toBeFalsy();
+ expect( getRating2Checkbox()?.checked ).toBeFalsy();
} );
} );
@@ -485,53 +490,53 @@ describe( 'Filter by Rating block', () => {
} );
test( 'adds chosen option to another one that is clicked', async () => {
- await waitFor( async () => {
- const ratingParam = '2,4';
- const {
- getRating2Checkbox,
- getRating4Checkbox,
- getRating5Checkbox,
- } = setupMultipleChoiceList( ratingParam );
+ const ratingParam = '2,4';
+ const {
+ getRating2Checkbox,
+ getRating4Checkbox,
+ getRating5Checkbox,
+ } = setupMultipleChoiceList( ratingParam );
- expect( getRating2Checkbox()?.checked ).toBeTruthy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating2Checkbox()?.checked ).toBeTruthy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
- const rating5checkbox = getRating5Checkbox();
+ const rating5checkbox = getRating5Checkbox();
- if ( rating5checkbox ) {
+ if ( rating5checkbox ) {
+ await act( async () => {
await userEvent.click( rating5checkbox );
- }
+ } );
+ }
- expect( getRating2Checkbox()?.checked ).toBeTruthy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeTruthy();
- } );
+ expect( getRating5Checkbox()?.checked ).toBeTruthy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating2Checkbox()?.checked ).toBeTruthy();
} );
test( 'removes the option when it is clicked again', async () => {
- await waitFor( async () => {
- const ratingParam = '2,4';
- const {
- getRating2Checkbox,
- getRating4Checkbox,
- getRating5Checkbox,
- } = setupMultipleChoiceList( ratingParam );
+ const ratingParam = '2,4';
+ const {
+ getRating2Checkbox,
+ getRating4Checkbox,
+ getRating5Checkbox,
+ } = setupMultipleChoiceList( ratingParam );
- expect( getRating2Checkbox()?.checked ).toBeTruthy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating2Checkbox()?.checked ).toBeTruthy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
- const rating2checkbox = getRating2Checkbox();
+ const rating2checkbox = getRating2Checkbox();
- if ( rating2checkbox ) {
+ if ( rating2checkbox ) {
+ await act( async () => {
await userEvent.click( rating2checkbox );
- }
+ } );
+ }
- expect( getRating2Checkbox()?.checked ).toBeFalsy();
- expect( getRating4Checkbox()?.checked ).toBeTruthy();
- expect( getRating5Checkbox()?.checked ).toBeFalsy();
- } );
+ expect( getRating5Checkbox()?.checked ).toBeFalsy();
+ expect( getRating4Checkbox()?.checked ).toBeTruthy();
+ expect( getRating2Checkbox()?.checked ).toBeFalsy();
} );
} );
} );
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/edit-utils.js b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/edit-utils.js
index b4ce4c5f80d..cb4228c37dd 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/edit-utils.js
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/edit-utils.js
@@ -333,7 +333,7 @@ export const getSharedReviewListControls = (
? {
...state,
value: String( defaultOffset ),
- }
+ }
: state
}
label={ __( 'Offset', 'woocommerce' ) }
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.tsx
index 8e4777b5ba7..ee3af15604c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.tsx
@@ -27,11 +27,11 @@ const NoReviewsPlaceholder = ( {
? __(
'No reviews are visible with the current offset. Reduce the offset to display reviews.',
'woocommerce'
- )
+ )
: __(
'This block lists reviews for products from selected categories. The selected categories do not have any reviews yet, but they will show up here when they do.',
'woocommerce'
- ) }
+ ) }
</Placeholder>
);
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.tsx
index 7a3350dd790..5401386df47 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.tsx
@@ -48,7 +48,7 @@ const NoReviewsPlaceholder = ( {
? __(
'No reviews are visible with the current offset. Reduce the offset to display reviews.',
'woocommerce'
- )
+ )
: undefined;
if ( ! content ) {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/types.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/types.ts
index cf57d287774..2312e16b686 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/reviews-by-product/types.ts
@@ -9,8 +9,7 @@ interface ReviewByProductAttributes {
productId: number;
}
-export interface ReviewsByProductEditorProps
- extends BlockEditProps< ReviewByProductAttributes > {
+export interface ReviewsByProductEditorProps extends BlockEditProps< ReviewByProductAttributes > {
attributes: ReviewByProductAttributes;
debouncedSpeak: ( message: string ) => void;
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/test/review-contracts.test.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/test/review-contracts.test.tsx
index 050ed872760..2ed36881b29 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/test/review-contracts.test.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/reviews/test/review-contracts.test.tsx
@@ -65,7 +65,7 @@ jest.mock( '@wordpress/components', () => {
const state = __unstableStateReducer
? __unstableStateReducer( {
value: event.target.value,
- } )
+ } )
: { value: event.target.value };
onChange( state.value );
},
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
index d08acabdfdb..81c9ad590fe 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/saved-for-later/test/frontend.ts
@@ -77,7 +77,6 @@ async function runAction( action: unknown ): Promise< void > {
const iterator = action as Iterator< unknown, unknown, unknown >;
let next = iterator.next();
while ( ! next.done ) {
- // eslint-disable-next-line no-await-in-loop
const resolved = await next.value;
next = iterator.next( resolved );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/stock-filter/test/block.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/stock-filter/test/block.tsx
index 6dee6318cea..d24222e1bff 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/stock-filter/test/block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/stock-filter/test/block.tsx
@@ -14,6 +14,8 @@ import {
within,
} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
+import { dispatch } from '@wordpress/data';
+import { QUERY_STATE_STORE_KEY } from '@woocommerce/block-data';
import { server } from '@woocommerce/test-utils/msw';
import { allSettings } from '@woocommerce/settings';
@@ -86,6 +88,7 @@ const selectors = {
const setup = ( params: SetupParams = {} ) => {
cleanup();
+ dispatch( QUERY_STATE_STORE_KEY ).setValueForQueryContext( 'page', {} );
const url = `http://woo.local/${
params.filterStock ? '?filter_stock_status=' + params.filterStock : ''
}`;
@@ -123,7 +126,7 @@ const setup = ( params: SetupParams = {} ) => {
? within( chipsContainer ).queryByText( value, {
exact: false,
ignore: '.components-visually-hidden',
- } )
+ } )
: false
);
@@ -286,69 +289,64 @@ describe( 'Filter by Stock block', () => {
} );
test( 'replaces chosen option when another one is clicked', async () => {
- await waitFor( async () => {
- const user = userEvent.setup();
- const ratingParam = 'instock';
- const {
- getDropdown,
- getInStockChips,
- getOutOfStockChips,
- getOutOfStockSuggestion,
- } = setupSingleChoiceDropdown( ratingParam );
-
- expect( getInStockChips() ).toBeInTheDocument();
- expect( getOutOfStockChips() ).toBeNull();
-
- const dropdown = getDropdown();
-
- if ( dropdown ) {
- await act( async () => {
- await user.click( dropdown );
- } );
- }
+ const user = userEvent.setup();
+ const ratingParam = 'instock';
+ const {
+ getDropdown,
+ getInStockChips,
+ getOutOfStockChips,
+ getOutOfStockSuggestion,
+ } = setupSingleChoiceDropdown( ratingParam );
+
+ expect( getInStockChips() ).toBeInTheDocument();
+ expect( getOutOfStockChips() ).toBeNull();
+
+ const dropdown = getDropdown();
+
+ if ( dropdown ) {
+ await act( async () => {
+ await user.click( dropdown );
+ } );
+ }
- const outOfStockSuggestion = getOutOfStockSuggestion();
+ const outOfStockSuggestion = getOutOfStockSuggestion();
- if ( outOfStockSuggestion ) {
- await act( async () => {
- await user.click( outOfStockSuggestion );
- } );
- }
+ if ( outOfStockSuggestion ) {
+ await act( async () => {
+ await user.click( outOfStockSuggestion );
+ } );
+ }
- expect( getInStockChips() ).toBeNull();
- expect( getOutOfStockChips() ).toBeInTheDocument();
- } );
+ expect( getOutOfStockChips() ).toBeInTheDocument();
+ expect( getInStockChips() ).toBeNull();
} );
test( 'removes the option when the X button is clicked', async () => {
- await waitFor( async () => {
- const user = userEvent.setup();
- const ratingParam = 'outofstock';
- const {
- getInStockChips,
- getOutOfStockChips,
- getOnBackorderChips,
- getRemoveButtonFromChips,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getInStockChips() ).toBeNull();
- expect( getOutOfStockChips() ).toBeInTheDocument();
- expect( getOnBackorderChips() ).toBeNull();
-
- const removeOutOfStockButton = getRemoveButtonFromChips(
- getOutOfStockChips()
- );
-
- if ( removeOutOfStockButton ) {
- await act( async () => {
- await user.click( removeOutOfStockButton );
- } );
- }
+ const user = userEvent.setup();
+ const ratingParam = 'outofstock';
+ const {
+ getInStockChips,
+ getOutOfStockChips,
+ getOnBackorderChips,
+ getRemoveButtonFromChips,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getInStockChips() ).toBeNull();
+ expect( getOutOfStockChips() ).toBeInTheDocument();
+ expect( getOnBackorderChips() ).toBeNull();
+
+ const removeOutOfStockButton =
+ getRemoveButtonFromChips( getOutOfStockChips() );
+
+ if ( removeOutOfStockButton ) {
+ await act( async () => {
+ await user.click( removeOutOfStockButton );
+ } );
+ }
- expect( getInStockChips() ).toBeNull();
- expect( getOutOfStockChips() ).toBeNull();
- expect( getOnBackorderChips() ).toBeNull();
- } );
+ expect( getOnBackorderChips() ).toBeNull();
+ expect( getOutOfStockChips() ).toBeNull();
+ expect( getInStockChips() ).toBeNull();
} );
} );
@@ -375,84 +373,87 @@ describe( 'Filter by Stock block', () => {
} );
test( 'adds chosen option to another one that is clicked', async () => {
- await waitFor( async () => {
- const user = userEvent.setup();
- const ratingParam = 'onbackorder';
- const {
- getDropdown,
- getInStockChips,
- getOutOfStockChips,
- getOnBackorderChips,
- getInStockSuggestion,
- getOutOfStockSuggestion,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getInStockChips() ).toBeNull();
- expect( getOutOfStockChips() ).toBeNull();
- expect( getOnBackorderChips() ).toBeInTheDocument();
-
- const dropdown = getDropdown();
-
- if ( dropdown ) {
+ const user = userEvent.setup();
+ const ratingParam = 'onbackorder';
+ const {
+ getDropdown,
+ getInStockChips,
+ getOutOfStockChips,
+ getOnBackorderChips,
+ getInStockSuggestion,
+ getOutOfStockSuggestion,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getInStockChips() ).toBeNull();
+ expect( getOutOfStockChips() ).toBeNull();
+ expect( getOnBackorderChips() ).toBeInTheDocument();
+
+ const dropdown = getDropdown();
+
+ if ( dropdown ) {
+ await act( async () => {
await user.click( dropdown );
- }
+ } );
+ }
- const inStockSuggestion = getInStockSuggestion();
+ const inStockSuggestion = getInStockSuggestion();
- if ( inStockSuggestion ) {
+ if ( inStockSuggestion ) {
+ await act( async () => {
await user.click( inStockSuggestion );
- }
+ } );
+ }
- expect( getInStockChips() ).toBeInTheDocument();
- expect( getOutOfStockChips() ).toBeNull();
- expect( getOnBackorderChips() ).toBeInTheDocument();
+ expect( getInStockChips() ).toBeInTheDocument();
+ expect( getOutOfStockChips() ).toBeNull();
+ expect( getOnBackorderChips() ).toBeInTheDocument();
- const freshDropdown = getDropdown();
- if ( freshDropdown ) {
+ const freshDropdown = getDropdown();
+ if ( freshDropdown ) {
+ await act( async () => {
await user.click( freshDropdown );
- }
+ } );
+ }
- const outOfStockSuggestion = getOutOfStockSuggestion();
+ const outOfStockSuggestion = getOutOfStockSuggestion();
- if ( outOfStockSuggestion ) {
+ if ( outOfStockSuggestion ) {
+ await act( async () => {
await userEvent.click( outOfStockSuggestion );
- }
+ } );
+ }
- expect( getInStockChips() ).toBeInTheDocument();
- expect( getOutOfStockChips() ).toBeInTheDocument();
- expect( getOnBackorderChips() ).toBeInTheDocument();
- } );
+ expect( getOnBackorderChips() ).toBeInTheDocument();
+ expect( getOutOfStockChips() ).toBeInTheDocument();
+ expect( getInStockChips() ).toBeInTheDocument();
} );
test( 'removes the option when the X button is clicked', async () => {
- await waitFor( async () => {
- const user = userEvent.setup();
- const ratingParam = 'instock,outofstock,onbackorder';
- const {
- getInStockChips,
- getOutOfStockChips,
- getOnBackorderChips,
- getRemoveButtonFromChips,
- } = setupMultipleChoiceDropdown( ratingParam );
-
- expect( getInStockChips() ).toBeInTheDocument();
- expect( getOutOfStockChips() ).toBeInTheDocument();
- expect( getOnBackorderChips() ).toBeInTheDocument();
-
- const removeOutOfStockButton = getRemoveButtonFromChips(
- getOutOfStockChips()
- );
-
- if ( removeOutOfStockButton ) {
- await act( async () => {
- await user.click( removeOutOfStockButton );
- } );
- }
+ const user = userEvent.setup();
+ const ratingParam = 'instock,outofstock,onbackorder';
+ const {
+ getInStockChips,
+ getOutOfStockChips,
+ getOnBackorderChips,
+ getRemoveButtonFromChips,
+ } = setupMultipleChoiceDropdown( ratingParam );
+
+ expect( getInStockChips() ).toBeInTheDocument();
+ expect( getOutOfStockChips() ).toBeInTheDocument();
+ expect( getOnBackorderChips() ).toBeInTheDocument();
+
+ const removeOutOfStockButton =
+ getRemoveButtonFromChips( getOutOfStockChips() );
+
+ if ( removeOutOfStockButton ) {
+ await act( async () => {
+ await user.click( removeOutOfStockButton );
+ } );
+ }
- expect( getInStockChips() ).toBeInTheDocument();
- expect( getOutOfStockChips() ).toBeNull();
- expect( getOnBackorderChips() ).toBeInTheDocument();
- } );
+ expect( getOnBackorderChips() ).toBeInTheDocument();
+ expect( getOutOfStockChips() ).toBeNull();
+ expect( getInStockChips() ).toBeInTheDocument();
} );
} );
@@ -479,31 +480,29 @@ describe( 'Filter by Stock block', () => {
} );
test( 'replaces chosen option when another one is clicked', async () => {
- await waitFor( async () => {
- const user = userEvent.setup();
- const ratingParam = 'outofstock';
- const {
- getInStockCheckbox,
- getOutOfStockCheckbox,
- getOnBackorderCheckbox,
- } = setupSingleChoiceList( ratingParam );
-
- expect( getInStockCheckbox()?.checked ).toBeFalsy();
- expect( getOutOfStockCheckbox()?.checked ).toBeTruthy();
- expect( getOnBackorderCheckbox()?.checked ).toBeFalsy();
-
- const onBackorderCheckbox = getOnBackorderCheckbox();
-
- if ( onBackorderCheckbox ) {
- await act( async () => {
- await user.click( onBackorderCheckbox );
- } );
- }
+ const user = userEvent.setup();
+ const ratingParam = 'outofstock';
+ const {
+ getInStockCheckbox,
+ getOutOfStockCheckbox,
+ getOnBackorderCheckbox,
+ } = setupSingleChoiceList( ratingParam );
+
+ expect( getInStockCheckbox()?.checked ).toBeFalsy();
+ expect( getOutOfStockCheckbox()?.checked ).toBeTruthy();
+ expect( getOnBackorderCheckbox()?.checked ).toBeFalsy();
+
+ const onBackorderCheckbox = getOnBackorderCheckbox();
+
+ if ( onBackorderCheckbox ) {
+ await act( async () => {
+ await user.click( onBackorderCheckbox );
+ } );
+ }
- expect( getInStockCheckbox()?.checked ).toBeFalsy();
- expect( getOutOfStockCheckbox()?.checked ).toBeFalsy();
- expect( getOnBackorderCheckbox()?.checked ).toBeTruthy();
- } );
+ expect( getOnBackorderCheckbox()?.checked ).toBeTruthy();
+ expect( getOutOfStockCheckbox()?.checked ).toBeFalsy();
+ expect( getInStockCheckbox()?.checked ).toBeFalsy();
} );
test( 'removes the option when it is clicked again', async () => {
@@ -522,7 +521,7 @@ describe( 'Filter by Stock block', () => {
const onBackorderCheckbox = getOnBackorderCheckbox();
if ( onBackorderCheckbox ) {
- userEvent.click( onBackorderCheckbox );
+ await userEvent.click( onBackorderCheckbox );
}
await waitFor( () => {
@@ -572,7 +571,7 @@ describe( 'Filter by Stock block', () => {
const inStockCheckbox = getInStockCheckbox();
if ( inStockCheckbox ) {
- userEvent.click( inStockCheckbox );
+ await userEvent.click( inStockCheckbox );
}
await waitFor( () => {
@@ -599,7 +598,7 @@ describe( 'Filter by Stock block', () => {
const inStockCheckbox = getInStockCheckbox();
if ( inStockCheckbox ) {
- userEvent.click( inStockCheckbox );
+ await userEvent.click( inStockCheckbox );
}
await waitFor( () => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
index 8c44df5827d..2c6564e33f4 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/wishlist/test/frontend.ts
@@ -77,7 +77,6 @@ async function runAction( action: unknown ): Promise< void > {
const iterator = action as Iterator< unknown, unknown, unknown >;
let next = iterator.next();
while ( ! next.done ) {
- // eslint-disable-next-line no-await-in-loop
const resolved = await next.value;
next = iterator.next( resolved );
}
diff --git a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/index.ts b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/index.ts
index e31efc088e9..22ba6f35d69 100644
--- a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/index.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/index.ts
@@ -22,9 +22,9 @@ import {
} from './utils';
declare global {
- // eslint-disable-next-line no-var, @typescript-eslint/naming-convention
+ // eslint-disable-next-line @typescript-eslint/naming-convention
var __WC_GLOBAL_EXPORTS_PLACEHOLDER__: WcGlobalExportsMap;
- // eslint-disable-next-line no-var, @typescript-eslint/naming-convention
+ // eslint-disable-next-line @typescript-eslint/naming-convention
var __WC_PLUGIN_URL_PLACEHOLDER__: string;
}
@@ -48,7 +48,7 @@ interface PendingCheck {
// Maps window.wc.* property names to their required script handles.
// Injected by PHP from DependencyDetection::WC_GLOBAL_EXPORTS (source of truth).
- // eslint-disable-next-line no-undef
+
const WC_GLOBAL_EXPORTS: WcGlobalExportsMap =
__WC_GLOBAL_EXPORTS_PLACEHOLDER__;
diff --git a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/test/utils.test.ts b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/test/utils.test.ts
index a7f86753f8b..959b12de6c0 100644
--- a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/test/utils.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/test/utils.test.ts
@@ -664,7 +664,7 @@ setTimeout handler*@https://store.local/wp-content/plugins/wc-dependency-test/ba
);
// Access blocksCheckout which internally accesses wcSettings
- // eslint-disable-next-line no-unused-expressions
+
proxy.blocksCheckout;
// checkDependency should only be called once (for blocksCheckout),
@@ -696,10 +696,10 @@ setTimeout handler*@https://store.local/wp-content/plugins/wc-dependency-test/ba
);
// First access
- // eslint-disable-next-line no-unused-expressions
+
proxy.blocksCheckout;
// Second independent access should also trigger check
- // eslint-disable-next-line no-unused-expressions
+
proxy.wcSettings;
expect( checkDependency ).toHaveBeenCalledTimes( 2 );
diff --git a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/utils.ts b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/utils.ts
index 8875ca7bc32..d9d0d5562ee 100644
--- a/plugins/woocommerce/client/blocks/assets/js/dependency-detection/utils.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/dependency-detection/utils.ts
@@ -310,7 +310,9 @@ export function parseStackForCallerUrl(
const line = lines[ i ];
// Skip internal lines (our script, webpack).
- if ( shouldSkipLine( line, currentPage ) ) continue;
+ if ( shouldSkipLine( line, currentPage ) ) {
+ continue;
+ }
// Found an external URL - return it.
const url = extractJsUrl( line, format );
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 4bcb172bc78..7252f7f0074 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
@@ -146,7 +146,9 @@ export const DisplayStyleSwitcher = ( {
const [ displayStyleBlocksAttributes, setDisplayStyleBlocksAttributes ] =
useState< Record< string, Record< string, unknown > > >( {} );
- if ( displayStyleOptions.length === 0 ) return null;
+ if ( displayStyleOptions.length === 0 ) {
+ return null;
+ }
return (
<ToggleGroupControl
@@ -227,7 +229,9 @@ export function resetDisplayStyleBlock(
contextKey = SELECTABLE_ITEMS_CONTEXT
) {
const parentBlock = select( 'core/block-editor' ).getBlock( clientId );
- if ( ! parentBlock ) return;
+ if ( ! parentBlock ) {
+ return;
+ }
const displayStyleOptions = getDisplayStyleOptions(
parentBlock.name,
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/editable-button/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/editable-button/index.tsx
index cfbcd817b58..0ebb795a009 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/editable-button/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/editable-button/index.tsx
@@ -4,8 +4,10 @@
import Button, { ButtonProps } from '@woocommerce/base-components/button';
import { RichText } from '@wordpress/block-editor';
-export interface EditableButtonProps
- extends Omit< ButtonProps, 'onChange' | 'placeholder' | 'value' > {
+export interface EditableButtonProps extends Omit<
+ ButtonProps,
+ 'onChange' | 'placeholder' | 'value'
+> {
/**
* On change callback.
*/
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.stories.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.stories.tsx
index 45ab99d1ced..9456f8fbf57 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.stories.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.stories.tsx
@@ -26,7 +26,7 @@ const Template: StoryFn< ErrorPlaceholderProps > = ( args ) => {
() => setArgs( { isLoading: false } ),
INTERACTION_TIMEOUT
);
- }
+ }
: undefined;
return (
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/grid-layout-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/grid-layout-control/index.tsx
index dabd5c0c18c..cd2317d82fa 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/grid-layout-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/grid-layout-control/index.tsx
@@ -94,11 +94,11 @@ const GridLayoutControl = ( {
? __(
'Align the last block to the bottom.',
'woocommerce'
- )
+ )
: __(
'The last inner block will follow other content.',
'woocommerce'
- )
+ )
}
checked={ alignButtons }
onChange={ () =>
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/index.tsx
index d8b1451cc7f..0f270d2cead 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/index.tsx
@@ -56,7 +56,7 @@ export function IncompatibleExtensionsNotice( {
<ExternalLink href="https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/" />
),
}
- )
+ )
: createInterpolateElement(
sprintf(
// translators: %s is the name of the extension.
@@ -72,7 +72,7 @@ export function IncompatibleExtensionsNotice( {
<ExternalLink href="https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#incompatible-extensions/" />
),
}
- ) }
+ ) }
</>
);
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/test/use-combined-incompatibility-notice.ts b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/test/use-combined-incompatibility-notice.ts
index 6836f77005f..1c7a1ce91ea 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/test/use-combined-incompatibility-notice.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/test/use-combined-incompatibility-notice.ts
@@ -25,8 +25,7 @@ let mockPaymentMethodsLoaded = true;
// themselves, so a `woocommerce_shared_settings` callback that trims the
// settings drops it and `getSetting` falls back to what the caller passed.
let mockIncompatibleExtensions:
- | Array< { id: string; title: string } >
- | undefined = [];
+ Array< { id: string; title: string } > | undefined = [];
const SITE_A = 1;
const SITE_B = 2;
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/use-combined-incompatibility-notice.ts b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/use-combined-incompatibility-notice.ts
index b2faf4492b8..d9278b79f33 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/use-combined-incompatibility-notice.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/incompatible-extension-notice/use-combined-incompatibility-notice.ts
@@ -172,7 +172,7 @@ export const useCombinedIncompatibilityNotice = (
! isSubsetOf( dismissedItemSlugs, allIncompatibleItemSlugs )
? dismissedItemSlugs.filter( ( slug ) =>
allIncompatibleItemSlugs.includes( slug )
- )
+ )
: null;
// Deliberately no dependency array: a pruned set is always strictly smaller
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-attribute-term-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-attribute-term-control/index.tsx
index 34c5534d343..09bd2f46e5c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-attribute-term-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-attribute-term-control/index.tsx
@@ -25,8 +25,10 @@ import type { AttributeObject, AttributeTerm } from '@woocommerce/types';
*/
import './style.scss';
-interface Props
- extends Omit< SearchListControlProps, 'isSingle' | 'list' | 'selected' > {
+interface Props extends Omit<
+ SearchListControlProps,
+ 'isSingle' | 'list' | 'selected'
+> {
instanceId?: string;
/**
* Callback to update the category operator. If not passed in, setting is not used.
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-brand-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-brand-control/index.tsx
index 219b0820528..be705fae752 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-brand-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-brand-control/index.tsx
@@ -10,7 +10,10 @@ import { SelectControl } from '@wordpress/components';
import { withSearchedBrands } from '@woocommerce/block-hocs';
import ErrorMessage from '@woocommerce/editor-components/error-placeholder/error-message';
import clsx from 'clsx';
-import type { RenderItemArgs } from '@woocommerce/editor-components/search-list-control/types';
+import type {
+ RenderItemArgs,
+ SearchListItem as SearchListItemProps,
+} from '@woocommerce/editor-components/search-list-control/types';
import type {
ProductBrandResponseItem,
WithInjectedSearchedBrands,
@@ -21,7 +24,6 @@ import { convertProductBrandResponseItemToSearchItem } from '@woocommerce/utils'
* Internal dependencies
*/
import './style.scss';
-import type { SearchListItem as SearchListItemProps } from '../search-list-control/types';
interface ProductBrandControlProps {
/**
@@ -80,7 +82,7 @@ const ProductBrandControl = ( {
),
accessibleName,
item.details?.review_count || 0
- )
+ )
: sprintf(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
_n(
@@ -91,7 +93,7 @@ const ProductBrandControl = ( {
),
accessibleName,
item.details?.count || 0
- );
+ );
const listItemCountLabel = showReviewCount
? sprintf(
@@ -103,7 +105,7 @@ const ProductBrandControl = ( {
'woocommerce'
),
item.details?.review_count || 0
- )
+ )
: sprintf(
/* translators: %d is the count of products. */
_n(
@@ -113,7 +115,7 @@ const ProductBrandControl = ( {
'woocommerce'
),
item.details?.count || 0
- );
+ );
return (
<SearchListItem
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-category-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-category-control/index.tsx
index 5512b908aa9..dfc72f592bf 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-category-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-category-control/index.tsx
@@ -81,7 +81,7 @@ const ProductCategoryControl = ( {
),
accessibleName,
item.details?.review_count || 0
- )
+ )
: sprintf(
/* translators: %1$s is the item name, %2$d is the count of products for the item. */
_n(
@@ -92,7 +92,7 @@ const ProductCategoryControl = ( {
),
accessibleName,
item.details?.count || 0
- );
+ );
const listItemCountLabel = showReviewCount
? sprintf(
@@ -104,7 +104,7 @@ const ProductCategoryControl = ( {
'woocommerce'
),
item.details?.review_count || 0
- )
+ )
: sprintf(
/* translators: %d is the count of products. */
_n(
@@ -114,7 +114,7 @@ const ProductCategoryControl = ( {
'woocommerce'
),
item.details?.count || 0
- );
+ );
return (
<SearchListItem
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-control/index.tsx
index 75dd2fe4570..00db44e196f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-control/index.tsx
@@ -127,7 +127,7 @@ const ProductControl = (
} = args;
const [ expandedPanelId, setExpandedPanelId ] = useExpandedPanelId ?? [
null,
- // eslint-disable-next-line @typescript-eslint/no-empty-function
+
() => {},
];
const isExpanded = isExpandedOrDescendantIsExpanded(
@@ -178,7 +178,7 @@ const ProductControl = (
/* translators: %1$d is the number of variations of a product product. */
__( '%1$d variations', 'woocommerce' ),
item.details?.variations.length
- )
+ )
: null
}
name={ `products-${ instanceId }` }
@@ -195,7 +195,7 @@ const ProductControl = (
),
item.name,
item.details?.variations.length
- )
+ )
: undefined
}
/>
@@ -211,7 +211,7 @@ const ProductControl = (
name: item.details?.variation as string,
},
'aria-label': `${ item.breadcrumbs[ 0 ] }: ${ item.details?.variation }`,
- };
+ };
return (
<SearchListItem
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-stock-control/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-stock-control/index.tsx
index cfb3b0bf74a..24a7daf03f8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/product-stock-control/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/product-stock-control/index.tsx
@@ -85,11 +85,11 @@ const ProductStockControl = ( {
? /* translators: %s stock status. */ __(
'Stock status "%s" visible.',
'woocommerce'
- )
+ )
: /* translators: %s stock status. */ __(
'Stock status "%s" hidden.',
'woocommerce'
- );
+ );
return (
<ToggleControl
label={ option.label }
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/item.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/item.tsx
index 506f1bc7e87..a55487137bd 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/item.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/item.tsx
@@ -241,7 +241,7 @@ export const SearchListItem = < T extends object = object >( {
) : (
// Items can be enabled via the radios and checkboxes. But we make the
// whole row clickable for convenience.
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events
<div
className={ classes }
onClick={ disabled ? undefined : onSelect( item ) }
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/search-list-control.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/search-list-control.tsx
index 99a0f4d41ea..c14a1372cf3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/search-list-control.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/search-list-control.tsx
@@ -206,7 +206,7 @@ const ListItemsContainer = < T extends object = object >( {
<span className="woocommerce-search-list__not-found-text">
{ search
? // eslint-disable-next-line @wordpress/valid-sprintf
- sprintf( messages.noResults, search )
+ sprintf( messages.noResults, search )
: messages.noItems }
</span>
</div>
@@ -369,7 +369,7 @@ export const SearchListControl = < T extends object = object >(
: selected.map( ( token ) => ( {
...token,
value: token.name,
- } ) )
+ } ) )
}
__experimentalShowHowTo={ false }
/>
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/hierarchy-interaction.test.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/hierarchy-interaction.test.tsx
index 14da6af650e..6f5f63bd7dc 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/hierarchy-interaction.test.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/hierarchy-interaction.test.tsx
@@ -29,8 +29,7 @@ const renderHierarchicalControl = ( {
selected = [] as SearchListItemType[],
onChange = jest.fn(),
renderItem = undefined as
- | ( ( args: RenderItemArgs ) => JSX.Element )
- | undefined,
+ ( ( args: RenderItemArgs ) => JSX.Element ) | undefined,
} = {} ) =>
render(
<SearchListControl
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/index.js b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/index.js
index 3bd73660326..08b6e390955 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/index.js
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/test/index.js
@@ -191,7 +191,7 @@ describe( 'SearchListControl', () => {
test( 'should render a search box and list of options, with a custom render callback for each item', () => {
const renderItem = ( { item } ) => (
<div key={ item.id }>{ item.name }!</div>
- ); // eslint-disable-line
+ );
const component = render(
<SearchListControl
instanceId={ 1 }
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/types.ts b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/types.ts
index 19cf6c5dc6f..b8134b7bd4a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/search-list-control/types.ts
@@ -38,8 +38,7 @@ interface SearchListProps< T extends object = object > {
}
export interface ListItemsProps
- extends Require< SearchListProps, 'renderItem' >,
- ItemProps {
+ extends Require< SearchListProps, 'renderItem' >, ItemProps {
instanceId: string | number;
}
@@ -55,8 +54,7 @@ export type SearchListItem< T extends object = object > = {
};
export interface SearchListItemsContainerProps< T extends object = object >
- extends SearchListControlProps,
- ItemProps {
+ extends SearchListControlProps, ItemProps {
instanceId: string | number;
filteredList: SearchListItem< T >[];
messages: SearchListMessages;
@@ -78,7 +76,8 @@ export interface SearchListMessages {
}
export interface RenderItemArgs< T extends object = object >
- extends ItemProps,
+ extends
+ ItemProps,
Partial<
Omit<
InputHTMLAttributes< HTMLInputElement >,
@@ -141,8 +140,7 @@ export interface SearchListControlProps< T extends object = object > {
onSearch?: ( ( search: string ) => void ) | undefined;
// Callback to render each item in the selection list, allows any custom object-type rendering.
renderItem?:
- | ( ( args: RenderItemArgs< T > ) => JSX.Element | null )
- | undefined;
+ ( ( args: RenderItemArgs< T > ) => JSX.Element | null ) | undefined;
// The list of currently selected items.
selected: SearchListItem< T >[];
// Whether to show a text field or a token field as search
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/upgrade-downgrade-notice/types.ts b/plugins/woocommerce/client/blocks/assets/js/editor-components/upgrade-downgrade-notice/types.ts
index ecf11c57a43..7351ec39cdb 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/upgrade-downgrade-notice/types.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/upgrade-downgrade-notice/types.ts
@@ -5,5 +5,5 @@ import { NoticeProps } from '@wordpress/components/build-types/notice/types';
export type UpgradeDowngradeNoticeProps = Omit< NoticeProps, 'actions' > & {
actionLabel: string;
- onActionClick(): void;
+ onActionClick: () => void;
};
diff --git a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx
index 0c688038c9b..b980f81b65c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx
@@ -139,10 +139,10 @@ const LocationSettings = () => {
postcode: '',
country: readOnlySettings.storeCountry,
},
- }
+ }
: pickupLocations.find( ( { id } ) => {
return id === editingLocation;
- } ) || null
+ } ) || null
}
editingLocation={ editingLocation }
onSave={ ( values ) => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/shared-components/settings-section/index.tsx b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/shared-components/settings-section/index.tsx
index 5ad57bdcc6e..ceb4bfc76e5 100644
--- a/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/shared-components/settings-section/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/extensions/shipping-methods/shared-components/settings-section/index.tsx
@@ -52,7 +52,6 @@ const SettingsSection = ( {
children,
...props
}: {
- // eslint-disable-next-line @typescript-eslint/naming-convention
Description?: () => JSX.Element | null;
children: React.ReactNode;
} ): JSX.Element => (
diff --git a/plugins/woocommerce/client/blocks/assets/js/global.d.ts b/plugins/woocommerce/client/blocks/assets/js/global.d.ts
index 12cbebc2079..bee2e1dd7a8 100644
--- a/plugins/woocommerce/client/blocks/assets/js/global.d.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/global.d.ts
@@ -1,2 +1 @@
-// eslint-disable-next-line camelcase
declare let __webpack_public_path__: string;
diff --git a/plugins/woocommerce/client/blocks/assets/js/hocs/with-transform-single-select-to-multiple-select.tsx b/plugins/woocommerce/client/blocks/assets/js/hocs/with-transform-single-select-to-multiple-select.tsx
index 4cc5b371dd0..73e6ed1f502 100644
--- a/plugins/woocommerce/client/blocks/assets/js/hocs/with-transform-single-select-to-multiple-select.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/hocs/with-transform-single-select-to-multiple-select.tsx
@@ -3,7 +3,7 @@
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - Ignoring because @wordpress/element library does not have type definition for FunctionComponent
-// eslint-disable-next-line
+
import { FunctionComponent } from '@wordpress/element';
export type SelectedOption = number | string | null | number[] | string[];
diff --git a/plugins/woocommerce/client/blocks/assets/js/previews/shipping-rates.ts b/plugins/woocommerce/client/blocks/assets/js/previews/shipping-rates.ts
index 99840807da3..cb53dfa31c1 100644
--- a/plugins/woocommerce/client/blocks/assets/js/previews/shipping-rates.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/previews/shipping-rates.ts
@@ -25,7 +25,7 @@ const localPickupLocations = localPickupEnabled
formatted_address: string;
details: string;
}[]
- >( 'localPickupLocations', [] )
+ >( 'localPickupLocations', [] )
: [];
const localPickupRates = localPickupLocations
@@ -56,7 +56,7 @@ const localPickupRates = localPickupLocations
method_id: 'pickup_location',
selected: false,
} )
- )
+ )
: [];
export const previewShippingRates: CartResponseShippingRate[] = [
diff --git a/plugins/woocommerce/client/blocks/assets/js/settings/blocks/constants.ts b/plugins/woocommerce/client/blocks/assets/js/settings/blocks/constants.ts
index 515effcbab7..fff676e190e 100644
--- a/plugins/woocommerce/client/blocks/assets/js/settings/blocks/constants.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/settings/blocks/constants.ts
@@ -14,9 +14,7 @@ import type {
} from '@woocommerce/settings';
export type WordCountType =
- | 'words'
- | 'characters_excluding_spaces'
- | 'characters_including_spaces';
+ 'words' | 'characters_excluding_spaces' | 'characters_including_spaces';
export interface WcBlocksConfig {
pluginUrl: string;
diff --git a/plugins/woocommerce/client/blocks/assets/js/settings/blocks/test/constants.ts b/plugins/woocommerce/client/blocks/assets/js/settings/blocks/test/constants.ts
index a566e05cd42..774f7e3cd2f 100644
--- a/plugins/woocommerce/client/blocks/assets/js/settings/blocks/test/constants.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/settings/blocks/test/constants.ts
@@ -3,7 +3,7 @@
*/
import type { CountryData } from '@woocommerce/types';
-type Constants = typeof import('../constants');
+type Constants = typeof import( '../constants' );
const countryData: Record< string, CountryData > = {
US: {
diff --git a/plugins/woocommerce/client/blocks/assets/js/utils/get-inner-block-by-name.ts b/plugins/woocommerce/client/blocks/assets/js/utils/get-inner-block-by-name.ts
index 5228c016c61..cca10274854 100644
--- a/plugins/woocommerce/client/blocks/assets/js/utils/get-inner-block-by-name.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/utils/get-inner-block-by-name.ts
@@ -15,14 +15,22 @@ export const getInnerBlockBy = (
block: BlockInstance | null,
callback: ( innerBlock: BlockInstance ) => boolean
): BlockInstance | null => {
- if ( ! block ) return null;
+ if ( ! block ) {
+ return null;
+ }
- if ( block.innerBlocks.length === 0 ) return null;
+ if ( block.innerBlocks.length === 0 ) {
+ return null;
+ }
for ( const innerBlock of block.innerBlocks ) {
- if ( callback( innerBlock ) ) return innerBlock;
+ if ( callback( innerBlock ) ) {
+ return innerBlock;
+ }
const innerInnerBlock = getInnerBlockBy( innerBlock, callback );
- if ( innerInnerBlock ) return innerInnerBlock;
+ if ( innerInnerBlock ) {
+ return innerInnerBlock;
+ }
}
return null;
diff --git a/plugins/woocommerce/client/blocks/assets/js/utils/register-product-block-type.ts b/plugins/woocommerce/client/blocks/assets/js/utils/register-product-block-type.ts
index dd55107c1a7..7e03da672f3 100644
--- a/plugins/woocommerce/client/blocks/assets/js/utils/register-product-block-type.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/utils/register-product-block-type.ts
@@ -373,8 +373,7 @@ export const registerProductBlockType = < T extends BlockAttributes >(
const metaDataWithoutName =
typeof blockNameOrMetadata === 'string'
? {}
- : // eslint-disable-next-line @typescript-eslint/no-unused-vars
- ( ( { name, ...metadata } ) => metadata )( blockNameOrMetadata );
+ : ( ( { name, ...metadata } ) => metadata )( blockNameOrMetadata );
// Extract settings without custom properties
const {
diff --git a/plugins/woocommerce/client/blocks/assets/js/utils/render-parent-block.tsx b/plugins/woocommerce/client/blocks/assets/js/utils/render-parent-block.tsx
index 4835dfcff04..40d34b5740a 100644
--- a/plugins/woocommerce/client/blocks/assets/js/utils/render-parent-block.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/utils/render-parent-block.tsx
@@ -193,7 +193,7 @@ const renderInnerBlocks = ( {
children: node.childNodes,
depth: depth + 1,
blockWrapper,
- } )
+ } )
: undefined;
// We pass props here rather than componentProps to avoid the data attributes being renamed.
@@ -205,11 +205,11 @@ const renderInnerBlocks = ( {
...( parsedElement?.props || {} ),
},
renderedChildren
- )
+ )
: cloneElement( parsedElement, {
key: componentKey,
...( parsedElement?.props || {} ),
- } );
+ } );
}
// This will wrap inner blocks with the provided wrapper. If no wrapper is provided, we default to Fragment.
diff --git a/plugins/woocommerce/client/blocks/assets/js/utils/test/html-entities.test.ts b/plugins/woocommerce/client/blocks/assets/js/utils/test/html-entities.test.ts
index b0c3027e27b..7410fbef3bf 100644
--- a/plugins/woocommerce/client/blocks/assets/js/utils/test/html-entities.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/utils/test/html-entities.test.ts
@@ -207,9 +207,7 @@ describe( 'decodeHtmlEntities', () => {
'&<>"'©®™£€¥';
const result = decodeHtmlEntities( complexString );
// Some browsers might handle ' differently
- expect( [ '&<>"\'©®™£€¥', '&<>"\'©®™£€¥' ] ).toContain(
- result
- );
+ expect( [ '&<>"\'©®™£€¥', '&<>"\'©®™£€¥' ] ).toContain( result );
} );
it( 'handles unusual but valid entity formats', () => {
diff --git a/plugins/woocommerce/client/blocks/assets/js/utils/test/register-product-block-type.test.ts b/plugins/woocommerce/client/blocks/assets/js/utils/test/register-product-block-type.test.ts
index ce19ed252c1..b2c66c1829d 100644
--- a/plugins/woocommerce/client/blocks/assets/js/utils/test/register-product-block-type.test.ts
+++ b/plugins/woocommerce/client/blocks/assets/js/utils/test/register-product-block-type.test.ts
@@ -50,7 +50,7 @@ const getDataMock = () => ( {
} );
type RegisterProductBlockType =
- typeof import('../register-product-block-type').registerProductBlockType;
+ typeof import( '../register-product-block-type' ).registerProductBlockType;
const blockSettings = {
title: 'Test product block',
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/example.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/example.js
index 83ad1e111ca..d140cd3b1b7 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/example.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/example.js
@@ -43,7 +43,7 @@ const example = ( hookDoc ) => {
return exampleContent
? {
html: exampleContent,
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/exceptions.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/exceptions.js
index 50fc6278625..507b2d51d66 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/exceptions.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/exceptions.js
@@ -9,7 +9,7 @@ const exceptions = ( hookDoc ) => {
p: `\`${ throwsDoc.types.join( ', ' ) }\` ${
throwsDoc.content
}`,
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/files.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/files.js
index 7b5c8a1c450..88baefbdaca 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/files.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/files.js
@@ -7,7 +7,7 @@ const files = ( sources ) => {
ul: sources.map( ( file ) => {
return `[${ file }](../../../../../../src/${ file })`;
} ),
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/params.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/params.js
index 5e65620c0b5..b08d9109a20 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/params.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/params.js
@@ -21,7 +21,7 @@ const params = ( hookDoc ) => {
),
],
},
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/related.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/related.js
index b45093fcd85..18567e5521c 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/related.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/related.js
@@ -16,7 +16,7 @@ const related = ( hookDoc ) => {
const reference = linkify( refers );
return content ? reference + ' - ' + content : reference;
} ),
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/returns.js b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/returns.js
index 9994b523d1c..7e61fc8cb15 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/returns.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/format-hook-doc/returns.js
@@ -9,7 +9,7 @@ const returns = ( hookDoc ) => {
p: `\`${ returnDoc.types.join( ', ' ) }\` ${
returnDoc.content
}`.trim(),
- }
+ }
: null;
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/content-with-heading.js b/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/content-with-heading.js
index f5a13baaa0d..aa0de1469be 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/content-with-heading.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/content-with-heading.js
@@ -8,7 +8,7 @@ const contentWithHeading = ( content, heading, headingLevel = 'h3' ) => {
? [
{ [ headingLevel ]: heading },
{ html: docblockToMarkdown( content ) },
- ]
+ ]
: [];
};
diff --git a/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/generate-introduction.js b/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/generate-introduction.js
index 1379aeb7808..2ce73a547b8 100644
--- a/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/generate-introduction.js
+++ b/plugins/woocommerce/client/blocks/bin/hook-docs/utilities/generate-introduction.js
@@ -56,7 +56,7 @@ const generateIntroduction = ( hook ) => {
? deprecated.content
: 'This hook is deprecated and will be removed'
}`,
- }
+ }
: null,
internal
? {
@@ -65,7 +65,7 @@ const generateIntroduction = ( hook ) => {
? internal.content
: 'This hook is for internal use only'
}`,
- }
+ }
: null,
];
};
diff --git a/plugins/woocommerce/client/blocks/bin/webpack-config-block-editor-unified-assets.js b/plugins/woocommerce/client/blocks/bin/webpack-config-block-editor-unified-assets.js
index ef3e34d217f..a1c34422903 100644
--- a/plugins/woocommerce/client/blocks/bin/webpack-config-block-editor-unified-assets.js
+++ b/plugins/woocommerce/client/blocks/bin/webpack-config-block-editor-unified-assets.js
@@ -254,9 +254,7 @@ const getUnifiedMainConfig = ( options = {} ) => {
presets: [ '@wordpress/babel-preset-default' ],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
diff --git a/plugins/woocommerce/client/blocks/bin/webpack-configs.js b/plugins/woocommerce/client/blocks/bin/webpack-configs.js
index 0969ad3f962..8ab09d10525 100644
--- a/plugins/woocommerce/client/blocks/bin/webpack-configs.js
+++ b/plugins/woocommerce/client/blocks/bin/webpack-configs.js
@@ -63,7 +63,7 @@ const getSharedPlugins = ( {
exclude: /[\/\\](node_modules|build|docs|vendor)[\/\\]/,
cwd: process.cwd(),
failOnError: 'warn',
- } )
+ } )
: false,
// The WP_BUNDLE_ANALYZER global variable enables a utility that represents bundle
// content as a convenient interactive zoomable treemap.
@@ -193,9 +193,7 @@ const getMainConfig = ( options = {} ) => {
presets: [ '@wordpress/babel-preset-default' ],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -256,8 +254,9 @@ const getMainConfig = ( options = {} ) => {
if (
metadata.parent &&
! genericBlocks[ blockName ]
- )
+ ) {
return `./inner-blocks/${ blockName }/block.json`;
+ }
return `./${ blockName }/block.json`;
},
},
@@ -321,9 +320,7 @@ const getFrontConfig = ( options = {} ) => {
],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -413,9 +410,7 @@ const getPaymentsConfig = ( options = {} ) => {
],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -494,9 +489,7 @@ const getExtensionsConfig = ( options = {} ) => {
],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -575,9 +568,7 @@ const getSiteEditorConfig = ( options = {} ) => {
],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -696,9 +687,7 @@ const getStylingConfig = ( options = {} ) => {
presets: [ '@wordpress/babel-preset-default' ],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
@@ -830,9 +819,7 @@ const getCartAndCheckoutFrontendConfig = ( options = {} ) => {
],
plugins: [
isProduction
- ? require.resolve(
- 'babel-plugin-transform-react-remove-prop-types'
- )
+ ? require.resolve( 'babel-plugin-transform-react-remove-prop-types' )
: false,
].filter( Boolean ),
cacheDirectory: BABEL_CACHE_DIR,
diff --git a/plugins/woocommerce/client/blocks/package.json b/plugins/woocommerce/client/blocks/package.json
index b17a89a8be9..0c491c4642b 100644
--- a/plugins/woocommerce/client/blocks/package.json
+++ b/plugins/woocommerce/client/blocks/package.json
@@ -64,7 +64,7 @@
"lint:css-fix": "stylelint '**/*.scss' --fix",
"lint:js": "WP_EXPERIMENTAL_MODULES=true wp-scripts lint-js --cache --cache-location=node_modules/.cache/eslint",
"lint:js:report": "pnpm run lint:js -- --output-file eslint_report.json --format json",
- "lint:js-fix": "eslint assets/js --fix",
+ "lint:js-fix": "pnpm lint:js --fix",
"lint:md:docs": "wp-scripts lint-md-docs",
"pre-commit": "lint-staged",
"reformat-files": "prettier --write \"**/*.{js,jsx,ts,tsx,css,scss}\"",
@@ -195,7 +195,7 @@
"postcss": "catalog:tooling",
"postcss-color-function": "4.1.0",
"postcss-loader": "4.3.x",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"progress-bar-webpack-plugin": "2.1.x",
"react": "18.3.x",
"react-docgen": "5.4.3",
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/thunks.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/thunks.ts
index 9a0a4902e2c..c5e10777e82 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/thunks.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/thunks.ts
@@ -179,11 +179,11 @@ export const applyExtensionCartUpdate =
? {
shipping_address: raw.shipping_address === true,
billing_address: raw.billing_address === true,
- }
+ }
: {
shipping_address: raw === true,
billing_address: raw === true,
- };
+ };
const isDirty = getIsCustomerDataDirty();
@@ -593,11 +593,7 @@ const quantityAbortControllers = new Map< string, AbortController >();
* @param {number} quantity Specified (new) quantity.
*/
export const changeCartItemQuantity =
- (
- cartItemKey: string,
- quantity: number
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- unclear how to represent multiple different yields as type
- ) =>
+ ( cartItemKey: string, quantity: number ) =>
async ( { dispatch, select }: CartThunkArgs ) => {
const cartItem = select.getCartItem( cartItemKey );
if ( cartItem?.quantity === quantity ) {
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/utils.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/utils.ts
index 152d632ea89..b696dc884fc 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/utils.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/cart/utils.ts
@@ -48,8 +48,7 @@ export const shippingAddressHasValidationErrors = () => {
};
export type BaseAddressKey =
- | keyof CartBillingAddress
- | keyof CartShippingAddress;
+ keyof CartBillingAddress | keyof CartShippingAddress;
/**
* Normalizes address values before push.
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/reducers.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/reducers.ts
index 44be74be18d..44e260b85ea 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/reducers.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/reducers.ts
@@ -21,7 +21,7 @@ const reducer: Reducer< CheckoutState > = ( state = defaultState, action ) => {
? {
...state,
status: STATUS.IDLE,
- }
+ }
: state;
break;
@@ -32,7 +32,7 @@ const reducer: Reducer< CheckoutState > = ( state = defaultState, action ) => {
? {
...state,
redirectUrl: action.redirectUrl,
- }
+ }
: state;
break;
@@ -200,7 +200,7 @@ const reducer: Reducer< CheckoutState > = ( state = defaultState, action ) => {
: {
...state.extensionData[ action.namespace ],
...action.extensionData,
- },
+ },
},
};
}
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/utils.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/utils.ts
index 8c39a1cfc06..3cccbd2182a 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/utils.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/checkout/utils.ts
@@ -65,7 +65,7 @@ export const handleErrorResponse = ( {
isString( response.messageContext )
? {
context: response.messageContext,
- }
+ }
: undefined;
errorResponse = response;
createErrorNotice( response.message, errorOptions );
@@ -151,9 +151,7 @@ export const runCheckoutSuccessObservers = ( {
} ) => {
let successResponse = null as null | ObserverSuccessResponse;
let errorResponse = null as
- | null
- | ObserverErrorResponse
- | ObserverFailResponse;
+ null | ObserverErrorResponse | ObserverFailResponse;
observerResponses.forEach( ( response ) => {
if ( isSuccessResponse( response ) ) {
@@ -175,7 +173,7 @@ export const runCheckoutSuccessObservers = ( {
isString( errorResponse.messageContext )
? {
context: errorResponse.messageContext,
- }
+ }
: undefined;
createErrorNotice( errorResponse.message, errorOptions );
}
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/default-state.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/default-state.ts
index fd238eadfe8..01c4a4f8db3 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/default-state.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/default-state.ts
@@ -82,8 +82,7 @@ export interface PaymentState {
// Registered express payment methods are all express payment methods from the registry (before filtering).
registeredExpressPaymentMethods: PlainExpressPaymentMethods;
savedPaymentMethods:
- | Record< string, SavedPaymentMethod[] >
- | EmptyObjectType;
+ Record< string, SavedPaymentMethod[] > | EmptyObjectType;
paymentMethodData: Record< string, unknown >;
paymentResult: PaymentResult | null;
paymentMethodsInitialized: boolean;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/default-state.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/default-state.ts
index e5d14cc6a27..98f40bf8c7c 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/default-state.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/default-state.ts
@@ -51,7 +51,7 @@ const getDefaultPaymentStateWithMocks = ( {
} ) );
// Get a fresh copy of the state
- // eslint-disable-next-line @typescript-eslint/no-var-requires -- Cloning using structuredClone is not supported in jsdom and Object.assign won't work as the state contains objects that need to be reset too. This is a clean way to get a fresh copy of the state.
+
state = require( '../default-state' ).defaultPaymentState;
} );
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/set-default-payment-method.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/set-default-payment-method.ts
index 8872affd89f..cf05d2d99f9 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/set-default-payment-method.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/test/set-default-payment-method.ts
@@ -1,4 +1,3 @@
-/* eslint-disable no-unused-expressions */
/**
* External dependencies
*/
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/types.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/types.ts
index 063079cbb9c..8be6c65d0e1 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/types.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/types.ts
@@ -38,8 +38,7 @@ export interface SavedPaymentMethod {
actions: ObjectType;
}
export type SavedPaymentMethods =
- | Record< string, SavedPaymentMethod[] >
- | EmptyObjectType;
+ Record< string, SavedPaymentMethod[] > | EmptyObjectType;
export interface PaymentMethodDispatchers {
setRegisteredPaymentMethods: (
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/utils/check-payment-methods.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/utils/check-payment-methods.ts
index 6f597724fe7..842677743ef 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/utils/check-payment-methods.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/payment/utils/check-payment-methods.ts
@@ -141,8 +141,7 @@ export const getCanMakePaymentArg = (): CanMakePaymentArgument => {
const registrationErrorNotice = (
paymentMethod:
- | ExpressPaymentMethodConfigInstance
- | PaymentMethodConfigInstance,
+ ExpressPaymentMethodConfigInstance | PaymentMethodConfigInstance,
errorMessage: string,
express = false
) => {
@@ -173,8 +172,7 @@ export const checkPaymentMethodsCanPay = async ( express = false ) => {
const addAvailablePaymentMethod = (
paymentMethod:
- | PaymentMethodConfigInstance
- | ExpressPaymentMethodConfigInstance
+ PaymentMethodConfigInstance | ExpressPaymentMethodConfigInstance
) => {
if ( express ) {
const {
@@ -217,7 +215,7 @@ export const checkPaymentMethodsCanPay = async ( express = false ) => {
...( getSetting( 'paymentMethodSortOrder', [] ) as [] ),
...Object.keys( paymentMethods ),
] )
- );
+ );
const canPayArgument = getCanMakePaymentArg();
const cartPaymentMethods = canPayArgument.paymentMethods as string[];
const isEditor = !! select( 'core/editor' );
@@ -239,9 +237,9 @@ export const checkPaymentMethodsCanPay = async ( express = false ) => {
const canPay = isEditor
? true
: validForCart &&
- ( await Promise.resolve(
+ ( await Promise.resolve(
paymentMethod.canMakePayment( canPayArgument )
- ) );
+ ) );
if ( canPay ) {
if ( typeof canPay === 'object' && canPay.error ) {
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/schema/selectors.js b/plugins/woocommerce/client/blocks/packages/public-api/block-data/schema/selectors.js
index 2687317418f..220702fce76 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/schema/selectors.js
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/schema/selectors.js
@@ -50,7 +50,7 @@ const getRouteFromResourceEntries = ( stateSlice, ids = [] ) => {
matchingRoute,
routePlaceholders,
ids
- );
+ );
}
return '';
};
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/block-data/utils/process-error-response.ts b/plugins/woocommerce/client/blocks/packages/public-api/block-data/utils/process-error-response.ts
index 2e4cb9fefd5..0ddad803871 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/block-data/utils/process-error-response.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/block-data/utils/process-error-response.ts
@@ -88,7 +88,7 @@ export const getErrorDetails = (
];
}
return errorObject;
- } )
+ } )
: [] ),
];
},
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/blocks-registry/get-registered-blocks.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/blocks-registry/get-registered-blocks.ts
index 9572a05d085..2ba82cb98ea 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/blocks-registry/get-registered-blocks.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/blocks-registry/get-registered-blocks.ts
@@ -22,6 +22,6 @@ export const getRegisteredBlocks = (
return hasInnerBlocks( block )
? Object.values( registeredBlocks ).filter( ( { metadata } ) =>
( metadata?.parent || [] ).includes( block )
- )
+ )
: [];
};
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/components/order-local-pickup-packages/index.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/components/order-local-pickup-packages/index.tsx
index 30ea5d477f8..e836edef877 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/components/order-local-pickup-packages/index.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/components/order-local-pickup-packages/index.tsx
@@ -18,7 +18,6 @@ const slotName = '__experimentalOrderLocalPickupPackages';
const {
Fill: ExperimentalOrderLocalPickupPackages,
Slot: OrderLocalPickupPackagesSlot,
- // eslint-disable-next-line @typescript-eslint/naming-convention
} = createSlotFill( slotName );
interface ExperimentalOrderLocalPickupPackagesProps {
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/index.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/index.tsx
index 875ddee8c2d..8868844ce8f 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/index.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/index.tsx
@@ -5,7 +5,7 @@ import { CURRENT_USER_IS_ADMIN } from '@woocommerce/settings';
import { Children, cloneElement } from '@wordpress/element';
// It is very important to export this directly from the build module to avoid introducing side-effects
// from importing the index of the @wordpress/components package.
-// eslint-disable-next-line -- When adding comments to imports it breaks the external/internal dependencies lint.
+
import {
createSlotFill as baseCreateSlotFill,
useSlot,
@@ -92,7 +92,6 @@ export const createSlotFill = ( slotName: string, onError = null ) => {
* @param {string} props.className Class name to be used on slot.
* @param {Object} props.fillProps Props to be passed to fills.
* @param {Element|string} props.as Element used to render the slot, defaults to div.
- *
*/
const Slot = ( props: object ) => (
<BaseSlot { ...props } bubblesVirtually />
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/test-utils.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/test-utils.tsx
index bee29d66682..b5f938d09f1 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/test-utils.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/slot/test-utils.tsx
@@ -2,7 +2,7 @@
* External dependencies
*/
import { render } from '@testing-library/react';
-import { Provider as SlotFillProvider } from 'wordpress-components-slotfill/build-module/slot-fill'; // eslint-disable-line @typescript-eslint/no-unused-vars -- Provider is used as JSX.
+import { Provider as SlotFillProvider } from 'wordpress-components-slotfill/build-module/slot-fill';
type SlotFillComponent = {
( props: { children: React.ReactNode } ): JSX.Element;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/utils/validation/test/index.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/utils/validation/test/index.tsx
index 5e130416357..47a25346ee0 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/utils/validation/test/index.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-checkout/utils/validation/test/index.tsx
@@ -13,9 +13,9 @@ describe( 'getValidityMessageForInput', () => {
it( 'Returns nothing if the input is valid', async () => {
render( <input type="text" data-testid="custom-input" /> );
- const textInputElement = ( await screen.getByTestId(
+ const textInputElement = screen.getByTestId(
'custom-input'
- ) ) as HTMLInputElement;
+ ) as HTMLInputElement;
const validityMessage = getValidityMessageForInput(
'Test',
@@ -26,9 +26,9 @@ describe( 'getValidityMessageForInput', () => {
it( 'Returns error message if a required input is empty', async () => {
render( <input type="text" required data-testid="custom-input" /> );
- const textInputElement = ( await screen.getByTestId(
+ const textInputElement = screen.getByTestId(
'custom-input'
- ) ) as HTMLInputElement;
+ ) as HTMLInputElement;
const validityMessage = getValidityMessageForInput(
'Test',
@@ -49,9 +49,9 @@ describe( 'getValidityMessageForInput', () => {
/>
);
- const textInputElement = ( await screen.getByTestId(
+ const textInputElement = screen.getByTestId(
'custom-input'
- ) ) as HTMLInputElement;
+ ) as HTMLInputElement;
await act( async () => {
await userEvent.type( textInputElement, 'Invalid Value' );
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/checkbox-control/validated-checkbox-control.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/checkbox-control/validated-checkbox-control.tsx
index 9df4083d664..c64b63321d8 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/checkbox-control/validated-checkbox-control.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/checkbox-control/validated-checkbox-control.tsx
@@ -23,8 +23,10 @@ import './style.scss';
import { ValidationInputError } from '../validation-input-error';
import { getValidityMessageForInput } from '../../blocks-checkout/utils';
-export interface ValidatedCheckboxControlProps
- extends Omit< InputHTMLAttributes< HTMLInputElement >, 'onChange' > {
+export interface ValidatedCheckboxControlProps extends Omit<
+ InputHTMLAttributes< HTMLInputElement >,
+ 'onChange'
+> {
// Unique instance ID. id will be used instead if provided.
instanceId?: string;
// id to use for the error message. If not provided, an id will be generated.
@@ -39,8 +41,7 @@ export interface ValidatedCheckboxControlProps
errorMessage?: string;
// Custom validation function that is run on change. Use setCustomValidity to set an error message.
customValidation?:
- | ( ( inputObject: HTMLInputElement ) => boolean )
- | undefined;
+ ( ( inputObject: HTMLInputElement ) => boolean ) | undefined;
// Custom validation message to display when validity is false. Given the input element. Expected to use inputObject.validity.
customValidityMessage?: ( validity: ValidityState ) => string;
// Whether validation should run on mount.
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/chip/removable-chip.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/chip/removable-chip.tsx
index d6acf873d4f..22a9c35a6cc 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/chip/removable-chip.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/chip/removable-chip.tsx
@@ -65,12 +65,12 @@ export const RemovableChip = ( {
ariaLabel =
typeof ariaLabelText !== 'string'
? /* translators: Remove chip. */
- __( 'Remove', 'woocommerce' )
+ __( 'Remove', 'woocommerce' )
: sprintf(
/* translators: %s text of the chip to remove. */
__( 'Remove "%s"', 'woocommerce' ),
ariaLabelText
- );
+ );
}
const clickableElementProps = {
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/formatted-monetary-amount/index.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/formatted-monetary-amount/index.tsx
index 7dc0886ad4a..38dfacb2535 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/formatted-monetary-amount/index.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/formatted-monetary-amount/index.tsx
@@ -17,8 +17,10 @@ import { decodeHtmlEntities } from '@woocommerce/utils';
*/
import './style.scss';
-export interface FormattedMonetaryAmountProps
- extends Omit< NumericFormatProps, 'onValueChange' | 'displayType' > {
+export interface FormattedMonetaryAmountProps extends Omit<
+ NumericFormatProps,
+ 'onValueChange' | 'displayType'
+> {
className?: string;
displayType?: NumericFormatProps[ 'displayType' ] | undefined;
allowNegative?: boolean;
@@ -231,7 +233,7 @@ const FormattedMonetaryAmount = ( {
? ( values: NumberFormatValues ) => {
const minorUnitValue = +values.value * 10 ** currency.minorUnit;
onValueChange( minorUnitValue );
- }
+ }
: () => void 0;
return (
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/radio-control/option.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/radio-control/option.tsx
index 5882db3c202..749e06f54a0 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/radio-control/option.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/radio-control/option.tsx
@@ -30,7 +30,6 @@ const Option = ( {
onChange( event.target.value );
return (
- // eslint-disable-next-line jsx-a11y/label-has-associated-control
<label
className={ clsx( 'wc-block-components-radio-control__option', {
'wc-block-components-radio-control__option-checked': checked,
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/store-notices-container/store-notices.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/store-notices-container/store-notices.tsx
index aff3b28b901..f6747da1c56 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/store-notices-container/store-notices.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/store-notices-container/store-notices.tsx
@@ -187,7 +187,7 @@ const StoreNotices = ( {
'Please fix the following errors before continuing',
uniqueNotices.length,
'woocommerce'
- )
+ )
: ''
}
>
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/test/validated-text-input.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/test/validated-text-input.tsx
index 04b5e23eaff..fb2a00d3016 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/test/validated-text-input.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/test/validated-text-input.tsx
@@ -53,7 +53,7 @@ describe( 'ValidatedTextInput', () => {
select( validationStore ).getValidationError( 'test-input' )
).not.toBe( undefined );
- const textInputElement = await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await act( async () => {
await user.type( textInputElement, 'New value' );
@@ -85,7 +85,7 @@ describe( 'ValidatedTextInput', () => {
await expect(
select( validationStore ).getValidationError( 'textinput-1' )
).not.toBe( undefined );
- const textInputElement = await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await act( async () => {
await userEvent.type( textInputElement, 'New value' );
@@ -114,7 +114,7 @@ describe( 'ValidatedTextInput', () => {
},
} )
);
- const customErrorMessageElement = await screen.getByText(
+ const customErrorMessageElement = screen.getByText(
'Custom error message'
);
expect(
@@ -143,7 +143,7 @@ describe( 'ValidatedTextInput', () => {
},
} )
);
- const errorMessageElement = await screen.getByText( 'Error message 3' );
+ const errorMessageElement = screen.getByText( 'Error message 3' );
await expect( errorMessageElement ).toBeInTheDocument();
expect( screen.getByRole( 'textbox' ) ).toHaveAccessibleErrorMessage(
'Error message 3'
@@ -203,7 +203,7 @@ describe( 'ValidatedTextInput', () => {
};
render( <TestComponent /> );
- const textInputElement = await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await act( async () => {
await user.type( textInputElement, 'Invalid Value' );
} );
@@ -238,7 +238,7 @@ describe( 'ValidatedTextInput', () => {
);
};
render( <TestComponent /> );
- const textInputElement = await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await act( async () => {
await user.type( textInputElement, 'invalid-email' );
@@ -266,7 +266,7 @@ describe( 'ValidatedTextInput', () => {
);
};
render( <TestComponent /> );
- const textInputElement = await screen.getByLabelText( 'Pattern Input' );
+ const textInputElement = screen.getByLabelText( 'Pattern Input' );
await act( async () => {
await user.type( textInputElement, '123456' );
@@ -295,7 +295,7 @@ describe( 'ValidatedTextInput', () => {
);
};
render( <TestComponent /> );
- const textInputElement = await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await act( async () => {
await user.type( textInputElement, 'test' );
@@ -374,8 +374,7 @@ describe( 'ValidatedTextInput', () => {
);
};
await render( <TestComponent /> );
- const textInputElement =
- await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await expect( textInputElement ).toHaveFocus();
await expect( setValidationErrors ).toHaveBeenCalledWith( {
'test-input': {
@@ -418,8 +417,7 @@ describe( 'ValidatedTextInput', () => {
);
};
const { rerender } = await render( <TestComponent /> );
- const textInputElement =
- await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await expect( textInputElement ).toHaveFocus();
await expect( setValidationErrors ).not.toHaveBeenCalled();
@@ -461,8 +459,7 @@ describe( 'ValidatedTextInput', () => {
);
};
await render( <TestComponent /> );
- const textInputElement =
- await screen.getByLabelText( 'Test Input' );
+ const textInputElement = screen.getByLabelText( 'Test Input' );
await expect( textInputElement ).toHaveFocus();
await expect( setValidationErrors ).not.toHaveBeenCalled();
} );
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/text-input.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/text-input.tsx
index c6bbbcc63ff..2943b615dc8 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/text-input.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/text-input.tsx
@@ -12,11 +12,10 @@ import type { InputHTMLAttributes, ReactNode } from 'react';
import Label from '../label';
import './style.scss';
-export interface TextInputProps
- extends Omit<
- InputHTMLAttributes< HTMLInputElement >,
- 'onChange' | 'onBlur'
- > {
+export interface TextInputProps extends Omit<
+ InputHTMLAttributes< HTMLInputElement >,
+ 'onChange' | 'onBlur'
+> {
id: string;
ariaLabel?: string;
label?: string | undefined;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/types.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/types.ts
index 23db4b465bc..b4874d0db81 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/types.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/text-input/types.ts
@@ -3,11 +3,10 @@
*/
import type { InputHTMLAttributes, ReactNode } from 'react';
-export interface ValidatedTextInputProps
- extends Omit<
- InputHTMLAttributes< HTMLInputElement >,
- 'onChange' | 'onBlur'
- > {
+export interface ValidatedTextInputProps extends Omit<
+ InputHTMLAttributes< HTMLInputElement >,
+ 'onChange' | 'onBlur'
+> {
// Unique instance ID. id will be used instead if provided.
instanceId?: string;
// aria-describedby attribute to add to the input.
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/totals/item/index.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/totals/item/index.tsx
index c67845961bb..8e03452c533 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/totals/item/index.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/totals/item/index.tsx
@@ -67,10 +67,10 @@ const TotalsItem = ( {
<Skeleton
width="45px"
height="1em"
- ariaMessage={ __(
- 'Loading price… ',
- 'woocommerce'
- ) }
+ ariaMessage={
+ // eslint-disable-next-line @wordpress/i18n-no-flanking-whitespace
+ __( 'Loading price… ', 'woocommerce' )
+ }
/>
</>
}
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/validation-input-error/stories/index.stories.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/validation-input-error/stories/index.stories.tsx
index 6b77ea6c59f..bd85c2773bf 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/validation-input-error/stories/index.stories.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-components/validation-input-error/stories/index.stories.tsx
@@ -8,7 +8,6 @@ import type { StoryFn, Meta } from '@storybook/react-webpack5';
*/
import ValidationInputError, { type ValidationInputErrorProps } from '..';
import '../style.scss';
-import '../../validation-input-error/style.scss';
export default {
title: 'External Components/ValidationInputError',
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/express-payment-method-config.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/express-payment-method-config.ts
index 35c8510a8c9..95785c06888 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/express-payment-method-config.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/express-payment-method-config.ts
@@ -15,9 +15,7 @@ import type {
import { getCanMakePayment } from './payment-method-config-helper';
import { assertConfigHasProperties, assertValidElement } from './assertions';
-export default class ExpressPaymentMethodConfig
- implements ExpressPaymentMethodConfigInstance
-{
+export default class ExpressPaymentMethodConfig implements ExpressPaymentMethodConfigInstance {
public name: string;
public title: string;
public description: string;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/extensions-config.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/extensions-config.ts
index 58dc9756f6e..3cc19aceee4 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/extensions-config.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/extensions-config.ts
@@ -16,7 +16,7 @@ export type ExtensionNamespace =
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;
// Keeps callbacks registered by extensions for different payment methods
-// eslint-disable-next-line prefer-const
+
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks =
{};
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config-helper.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config-helper.ts
index 3e7d5b0741e..dbe7dd5c4f7 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config-helper.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config-helper.ts
@@ -101,6 +101,6 @@ export const getCanMakePayment = (
canPay,
extensionsConfig.canMakePayment,
paymentMethodName
- )
+ )
: canPay;
};
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config.tsx
index 6ecf9825279..2be0737671a 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/payment-method-config.tsx
@@ -26,9 +26,7 @@ const NullComponent = () => {
return null;
};
-export default class PaymentMethodConfig
- implements PaymentMethodConfigInstance
-{
+export default class PaymentMethodConfig implements PaymentMethodConfigInstance {
public name: string;
public content: ReactNode;
public edit: ReactNode;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/test/registry.ts b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/test/registry.ts
index eb071e7ac14..f40819f3bdd 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/test/registry.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/payment-methods/test/registry.ts
@@ -17,7 +17,6 @@ describe( 'registerPaymentMethodExtensionCallbacks', () => {
}
);
- // eslint-disable-next-line no-console
expect( console ).not.toHaveErrored();
registerPaymentMethodExtensionCallbacks(
'woocommerce-marketplace-extension',
@@ -40,7 +39,6 @@ describe( 'registerPaymentMethodExtensionCallbacks', () => {
}
);
- // eslint-disable-next-line no-console
expect( console ).not.toHaveErrored();
registerPaymentMethodExtensionCallbacks(
'overwrite-marketplace-extension',
@@ -65,7 +63,6 @@ describe( 'registerPaymentMethodExtensionCallbacks', () => {
}
);
- // eslint-disable-next-line no-console
expect( console ).toHaveErrored();
expect( canMakePaymentExtensionsCallbacks ).toHaveProperty(
'other-woocommerce-marketplace-extension'
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/product-collection/register-product-collection.tsx b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/product-collection/register-product-collection.tsx
index 5ba5032cc79..0e171b6e4df 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/product-collection/register-product-collection.tsx
+++ b/plugins/woocommerce/client/blocks/packages/public-api/blocks-registry/product-collection/register-product-collection.tsx
@@ -464,7 +464,7 @@ export const __experimentalRegisterProductCollection = (
setPreviewState,
initialPreviewState,
},
- }
+ }
: {} ) }
usesReference={ usesReference }
/>
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/settings/settings-init.ts b/plugins/woocommerce/client/blocks/packages/public-api/settings/settings-init.ts
index a094464dd24..4051ae42bd8 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/settings/settings-init.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/settings/settings-init.ts
@@ -121,8 +121,7 @@ const globalSharedSettings =
typeof window.wcSettings === 'object' ? window.wcSettings : {};
interface AllSettings
- extends WooCommerceSharedSettings,
- Record< string, unknown > {
+ extends WooCommerceSharedSettings, Record< string, unknown > {
currency: WooCommerceSiteCurrency;
}
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/address-autocomplete.ts b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/address-autocomplete.ts
index ed495ee7720..0a5c3a93870 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/address-autocomplete.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/address-autocomplete.ts
@@ -10,7 +10,9 @@ declare global {
addressAutocomplete: {
providers: Record< string, ClientAddressAutocompleteProvider >;
activeProvider: {
- [ key in AddressFormType ]?: ClientAddressAutocompleteProvider | null;
+ [
+ key in AddressFormType
+ ]?: ClientAddressAutocompleteProvider | null;
};
registerAddressAutocompleteProvider: (
provider: ClientAddressAutocompleteProvider
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart-response.ts b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart-response.ts
index 8f8d652e95e..3d9db51e9fb 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart-response.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart-response.ts
@@ -16,8 +16,7 @@ export interface CartResponseCouponItem {
totals: CartResponseTotalsItem;
}
-export interface CartResponseCouponItemWithLabel
- extends CartResponseCouponItem {
+export interface CartResponseCouponItemWithLabel extends CartResponseCouponItem {
label: string;
}
@@ -49,11 +48,9 @@ export interface MetaKeyValue {
}
export type ExtensionsData =
- | Record< string, unknown >
- | Record< string, never >;
+ Record< string, unknown > | Record< string, never >;
-export interface CartResponseShippingPackageShippingRate
- extends CurrencyResponse {
+export interface CartResponseShippingPackageShippingRate extends CurrencyResponse {
rate_id: string;
name: string;
description: string;
@@ -69,14 +66,12 @@ export interface CartResponseShippingPackageShippingRate
export type CartResponseShippingRate = CartShippingRate;
export interface CartResponseShippingAddress
- extends ResponseBaseAddress,
- ResponseFirstNameLastName {
+ extends ResponseBaseAddress, ResponseFirstNameLastName {
company: string;
phone: string;
}
-export interface CartResponseBillingAddress
- extends CartResponseShippingAddress {
+export interface CartResponseBillingAddress extends CartResponseShippingAddress {
email: string;
}
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart.js b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart.js
index fb42fb618b8..fe6d8363d65 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart.js
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/cart.js
@@ -99,7 +99,6 @@
* applicable (in subunits).
* @property {CartItemPriceRange|null} price_range Price range, if
* applicable.
- *
*/
/**
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/contexts.js b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/contexts.js
index 02e64d65392..e041cbc7e69 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/contexts.js
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/contexts.js
@@ -150,7 +150,6 @@
* @property {number} id Error ID.
* @property {string} message Error message.
* @property {boolean} hidden Error visibility.
- *
*/
/**
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/hooks.js b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/hooks.js
index 6a84bef00b6..72fc71ff0c1 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/hooks.js
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/hooks.js
@@ -94,7 +94,6 @@
* @property {string} EXPRESS_PAYMENTS Notices for the express payments step.
*/
-/* eslint-disable jsdoc/valid-types */
// Enum format below triggers the above rule even though VSCode interprets it fine.
/**
* @typedef {NoticeContexts['PAYMENTS']|NoticeContexts['EXPRESS_PAYMENTS']} NoticeContextsEnum
@@ -143,7 +142,6 @@
* response. This varies between context
* emitters.
*/
-/* eslint-enable jsdoc/valid-types */
/**
* @typedef {Object} EmitResponseApi
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/payments.ts b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/payments.ts
index de16dff6b86..d794b64dd28 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/payments.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-defs/payments.ts
@@ -77,8 +77,7 @@ export interface CanMakePaymentArgumentCart {
}
export type CanMakePaymentReturnType =
- | boolean
- | Promise< boolean | { error: { message: string } } >;
+ boolean | Promise< boolean | { error: { message: string } } >;
export type CanMakePaymentCallback = (
cartData: CanMakePaymentArgument
@@ -148,8 +147,7 @@ export interface ExpressPaymentMethodConfiguration {
}
export type PaymentMethods =
- | Record< string, PaymentMethodConfigInstance >
- | EmptyObjectType;
+ Record< string, PaymentMethodConfigInstance > | EmptyObjectType;
/**
* Used to represent payment methods in a context where storing objects is not allowed, i.e. in data stores.
@@ -177,8 +175,7 @@ export type PlainExpressPaymentMethods = Record<
>;
export type ExpressPaymentMethods =
- | Record< string, ExpressPaymentMethodConfigInstance >
- | EmptyObjectType;
+ Record< string, ExpressPaymentMethodConfigInstance > | EmptyObjectType;
export interface PaymentMethodConfigInstance {
name: string;
diff --git a/plugins/woocommerce/client/blocks/packages/public-api/types/type-guards/function.ts b/plugins/woocommerce/client/blocks/packages/public-api/types/type-guards/function.ts
index 88a8a00500d..c524a8e4c72 100644
--- a/plugins/woocommerce/client/blocks/packages/public-api/types/type-guards/function.ts
+++ b/plugins/woocommerce/client/blocks/packages/public-api/types/type-guards/function.ts
@@ -1,4 +1,4 @@
-// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/no-empty-object-type
+// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export const isFunction = < T extends Function, U >(
term: T | U
): term is T => {
diff --git a/plugins/woocommerce/client/blocks/storybook/webpack.config.js b/plugins/woocommerce/client/blocks/storybook/webpack.config.js
index 2ab8b63df4d..a7ae3835c83 100644
--- a/plugins/woocommerce/client/blocks/storybook/webpack.config.js
+++ b/plugins/woocommerce/client/blocks/storybook/webpack.config.js
@@ -42,15 +42,12 @@ module.exports = ( { config: storybookConfig } ) => {
storybookConfig.resolve.alias = {
...storybookConfig.resolve.alias,
...aliases,
- '@woocommerce/block-settings': require.resolve(
- './__mocks__/woocommerce-block-settings.js'
- ),
- '@woocommerce/base-hooks': require.resolve(
- './__mocks__/woocommerce-base-hooks.js'
- ),
- 'wordpress-components': require.resolve(
- '../node_modules/wordpress-components'
- ),
+ '@woocommerce/block-settings':
+ require.resolve( './__mocks__/woocommerce-block-settings.js' ),
+ '@woocommerce/base-hooks':
+ require.resolve( './__mocks__/woocommerce-base-hooks.js' ),
+ 'wordpress-components':
+ require.resolve( '../node_modules/wordpress-components' ),
};
// Resolve `@woocommerce/*` monorepo packages from source via the `wc-source`
diff --git a/plugins/woocommerce/client/blocks/tests/integration/helpers/wait-for-store-resolvers.ts b/plugins/woocommerce/client/blocks/tests/integration/helpers/wait-for-store-resolvers.ts
index bceeec3a4e0..2a8285a14cf 100644
--- a/plugins/woocommerce/client/blocks/tests/integration/helpers/wait-for-store-resolvers.ts
+++ b/plugins/woocommerce/client/blocks/tests/integration/helpers/wait-for-store-resolvers.ts
@@ -32,7 +32,7 @@ export async function waitForStoreResolvers< T >( fn: () => T ) {
// resolve before we consider the editor initialized is to flush micro tasks,
// similar to the approach found in `@testing-library/react`.
// https://github.com/callstack/react-native-testing-library/blob/a010ffdbca906615279ecc3abee423525e528101/src/flushMicroTasks.js#L15-L23.
- // eslint-disable-next-line testing-library/no-unnecessary-act, @typescript-eslint/no-empty-function
+ // eslint-disable-next-line testing-library/no-unnecessary-act
await act( async () => {} );
return result;
diff --git a/plugins/woocommerce/client/blocks/webpack.config.js b/plugins/woocommerce/client/blocks/webpack.config.js
index 4ccbdc832be..c4ee81721cf 100644
--- a/plugins/woocommerce/client/blocks/webpack.config.js
+++ b/plugins/woocommerce/client/blocks/webpack.config.js
@@ -40,18 +40,14 @@ const getCacheConfig = ( name, configPaths = [] ) =>
config: [
__filename,
path.resolve( __dirname, '../../../../pnpm-lock.yaml' ),
- require.resolve(
- '@woocommerce/dependency-extraction-webpack-plugin'
- ),
- require.resolve(
- '@woocommerce/internal-build/style-build'
- ),
+ require.resolve( '@woocommerce/dependency-extraction-webpack-plugin' ),
+ require.resolve( '@woocommerce/internal-build/style-build' ),
...configPaths.map( ( configPath ) =>
path.resolve( __dirname, configPath )
),
],
},
- };
+ };
// Only options shared between all configs should be defined here.
const sharedConfig = {
diff --git a/plugins/woocommerce/client/legacy/js/frontend/checkout.js b/plugins/woocommerce/client/legacy/js/frontend/checkout.js
index de08ae10dc9..2c6959a888d 100644
--- a/plugins/woocommerce/client/legacy/js/frontend/checkout.js
+++ b/plugins/woocommerce/client/legacy/js/frontend/checkout.js
@@ -594,7 +594,7 @@ jQuery( function ( $ ) {
pattern = new RegExp(
// eslint-disable-next-line max-len
/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i
- ); // eslint-disable-line max-len
+ );
if ( ! pattern.test( $this.val() ) ) {
$this.attr( 'aria-invalid', 'true' );
@@ -602,7 +602,7 @@ jQuery( function ( $ ) {
.removeClass( 'woocommerce-validated' )
.addClass(
'woocommerce-invalid woocommerce-invalid-email'
- ); // eslint-disable-line max-len
+ );
validated = false;
}
}
@@ -637,7 +637,7 @@ jQuery( function ( $ ) {
.removeClass(
'woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email woocommerce-invalid-phone'
)
- .addClass( 'woocommerce-validated' ); // eslint-disable-line max-len
+ .addClass( 'woocommerce-validated' );
}
}
},
@@ -879,7 +879,7 @@ jQuery( function ( $ ) {
'<div class="woocommerce-notices-wrapper woocommerce-NoticeGroup woocommerce-NoticeGroup-updateOrderReview">' +
data.messages +
'</div>'
- ); // eslint-disable-line max-len
+ );
} else if ( data && 'failure' === data.result ) {
// A response that reports a notice without carrying one: render it as-is.
$form.prepend( data );
@@ -1099,7 +1099,7 @@ jQuery( function ( $ ) {
'<div class="woocommerce-error">' +
wc_checkout_params.i18n_checkout_error +
'</div>'
- ); // eslint-disable-line max-len
+ );
}
}
},
@@ -1143,7 +1143,7 @@ jQuery( function ( $ ) {
'<div class="woocommerce-notices-wrapper woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' +
error_message +
'</div>'
- ); // eslint-disable-line max-len
+ );
wc_checkout_form.$checkout_form
.removeClass( 'processing' )
.unblock();
diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json
index 2f3c8422e96..ecdab8942aa 100644
--- a/plugins/woocommerce/package.json
+++ b/plugins/woocommerce/package.json
@@ -1333,7 +1333,7 @@
"handlebars": "^4.7.9",
"jest": "29.5.x",
"playwright-ctrf-json-reporter": "0.0.27",
- "prettier": "npm:wp-prettier@3.0.3",
+ "prettier": "npm:wp-prettier@3.9.6",
"rimraf": "5.0.5",
"typescript": "5.7.x",
"wp-textdomain": "1.0.1"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 99690fdf591..2a218e8d504 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -31,8 +31,8 @@ catalogs:
specifier: 5.56.0
version: 5.56.0
'@wordpress/prettier-config':
- specifier: 4.49.0
- version: 4.49.0
+ specifier: 4.56.0
+ version: 4.56.0
'@wordpress/stylelint-config':
specifier: ^23.14.0
version: 23.42.0
@@ -268,7 +268,7 @@ importers:
version: link:tools/monorepo-utils
'@wordpress/prettier-config':
specifier: catalog:tooling
- version: 4.49.0(wp-prettier@3.0.3)
+ version: 4.56.0(wp-prettier@3.9.6)
'@wordpress/stylelint-config':
specifier: catalog:tooling
version: 23.42.0(@types/react@18.3.28)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint-scss@6.14.0(stylelint@16.26.1(typescript@5.7.3)))(stylelint@16.26.1(typescript@5.7.3))
@@ -315,8 +315,8 @@ importers:
specifier: 4.3.x
version: 4.3.0(postcss@8.5.26)(webpack@5.97.1(@swc/core@1.15.24))
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
regenerator-runtime:
specifier: ^0.13.11
version: 0.13.11
@@ -1428,8 +1428,8 @@ importers:
specifier: 29.5.x
version: 29.5.0
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
react:
specifier: 18.3.x
version: 18.3.1
@@ -1462,13 +1462,13 @@ importers:
dependencies:
'@wordpress/eslint-plugin':
specifier: 25.6.0
- version: 25.6.0(@babel/core@7.25.7)(@types/eslint@9.6.1)(@types/react@18.3.28)(@typescript-eslint/eslint-plugin@8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.0.3)
+ version: 25.6.0(@babel/core@7.25.7)(@types/eslint@9.6.1)(@types/react@18.3.28)(@typescript-eslint/eslint-plugin@8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.9.6)
eslint-plugin-testing-library:
specifier: ^7.16.2
version: 7.16.2(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3)
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
typescript-eslint:
specifier: ^8.63.0
version: 8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3)
@@ -1796,7 +1796,7 @@ importers:
version: link:../eslint-plugin
'@wordpress/core-data':
specifier: 7.33.9
- version: 7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ version: 7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@4.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/data':
specifier: 10.33.1
version: 10.33.1(@types/react@18.3.28)(react@18.3.1)
@@ -2637,8 +2637,8 @@ importers:
specifier: 0.0.27
version: 0.0.27
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
rimraf:
specifier: 5.0.5
version: 5.0.5
@@ -2743,8 +2743,8 @@ importers:
specifier: ^16.5.0
version: 16.5.0
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
react:
specifier: 18.3.x
version: 18.3.1
@@ -3129,7 +3129,7 @@ importers:
version: 6.43.1-next.v.202604091042.0
'@wordpress/jest-preset-default':
specifier: next
- version: 12.43.1-next.v.202604091042.0(@babel/core@7.25.7)(jest@29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))
+ version: 12.43.1-next.v.202604091042.0(@babel/core@7.25.7)(jest@29.5.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))
'@wordpress/postcss-plugins-preset':
specifier: catalog:tooling
version: 5.56.0(postcss@8.5.26)
@@ -3218,8 +3218,8 @@ importers:
specifier: 4.3.x
version: 4.3.0(postcss@8.5.26)(webpack@5.97.1(@swc/core@1.15.24))
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
promptly:
specifier: ^3.2.0
version: 3.2.0
@@ -3451,16 +3451,16 @@ importers:
version: 1.63.0
'@storybook/addon-a11y':
specifier: 10.5.10
- version: 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ version: 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
'@storybook/addon-docs':
specifier: 10.5.10
- version: 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(webpack@5.97.1)
+ version: 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(webpack@5.97.1)
'@storybook/addon-links':
specifier: 10.5.10
- version: 10.5.10(@types/react@18.3.28)(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ version: 10.5.10(@types/react@18.3.28)(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
'@storybook/react-webpack5':
specifier: 10.5.10
- version: 10.5.10(@swc/core@1.15.24)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)
+ version: 10.5.10(@swc/core@1.15.24)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)
'@testing-library/dom':
specifier: 9.3.3
version: 9.3.3
@@ -3744,8 +3744,8 @@ importers:
specifier: 4.3.x
version: 4.3.0(postcss@8.5.26)(webpack@5.97.1(@swc/core@1.15.24))
prettier:
- specifier: npm:wp-prettier@3.0.3
- version: wp-prettier@3.0.3
+ specifier: npm:wp-prettier@3.9.6
+ version: wp-prettier@3.9.6
progress-bar-webpack-plugin:
specifier: 2.1.x
version: 2.1.0(webpack@5.97.1)
@@ -3772,7 +3772,7 @@ importers:
version: 10.5.2(sass@1.69.5)(webpack@5.97.1(@swc/core@1.15.24))
storybook:
specifier: 10.5.10
- version: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ version: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
stylelint:
specifier: catalog:tooling
version: 16.26.1(typescript@5.7.3)
@@ -9686,15 +9686,15 @@ packages:
react: ^18.0.0
react-dom: ^18.0.0
- '@wordpress/prettier-config@4.49.0':
- resolution: {integrity: sha512-yP4hm2m2Hxv3I7HI5lxbrCmh95Db4QWcGJGLq/fysepbLjTnqnMIHRs5p0/QoRMV/MhwFi8vMkNmmQYJt386ug==}
+ '@wordpress/prettier-config@4.51.0':
+ resolution: {integrity: sha512-V6bsx/WImZmxaiMG7DOA4z8G76eFxlmJ/ZqZRN7tAja7jHPfliuRtCZI2CJBx0c0fT3zGsq8xkC4bmDlMra65A==}
engines: {node: '>=18.12.0', npm: '>=8.19.2'}
peerDependencies:
prettier: '>=3'
- '@wordpress/prettier-config@4.51.0':
- resolution: {integrity: sha512-V6bsx/WImZmxaiMG7DOA4z8G76eFxlmJ/ZqZRN7tAja7jHPfliuRtCZI2CJBx0c0fT3zGsq8xkC4bmDlMra65A==}
- engines: {node: '>=18.12.0', npm: '>=8.19.2'}
+ '@wordpress/prettier-config@4.56.0':
+ resolution: {integrity: sha512-FTiY8VRrKVcB2FNxFsALoe8TC0ilpIzYdiRT+VaS87HlEF99L5UfZoGT7gL2VhdEhkNCS9FPtk9k2xGPok/WJg==}
+ engines: {node: '>=18.12.0'}
peerDependencies:
prettier: '>=3'
@@ -19075,8 +19075,8 @@ packages:
wordwrap@1.0.0:
resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
- wp-prettier@3.0.3:
- resolution: {integrity: sha512-X4UlrxDTH8oom9qXlcjnydsjAOD2BmB6yFmvS4Z2zdTzqqpRWb+fbqrH412+l+OUXmbzJlSXjlMFYPgYG12IAA==}
+ wp-prettier@3.9.6:
+ resolution: {integrity: sha512-rKjrWazF+8QexwTG4Y1Xmnnnp9SDNvaakDtXTRDHxhyudrelGQ5tqoviFtGUuE4fvMs4ck3pmgrZ2Ap202GTIQ==}
engines: {node: '>=14'}
hasBin: true
@@ -24118,11 +24118,11 @@ snapshots:
axe-core: 4.11.3
storybook: 10.5.10(@types/react@18.3.28)(prettier@2.8.8)(react@18.3.1)
- '@storybook/addon-a11y@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))':
+ '@storybook/addon-a11y@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))':
dependencies:
'@storybook/global': 5.0.0
axe-core: 4.11.3
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
'@storybook/addon-docs@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(esbuild@0.24.2)(storybook@10.5.10(@types/react@18.3.28)(prettier@2.8.8)(react@18.3.1))(webpack@5.97.1(@swc/core@1.15.24)(esbuild@0.24.2))':
dependencies:
@@ -24162,15 +24162,15 @@ snapshots:
- vite
- webpack
- '@storybook/addon-docs@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(webpack@5.97.1)':
+ '@storybook/addon-docs@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(webpack@5.97.1)':
dependencies:
'@mdx-js/react': 3.1.1(@types/react@18.3.28)(react@18.3.1)
- '@storybook/csf-plugin': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(webpack@5.97.1)
+ '@storybook/csf-plugin': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(webpack@5.97.1)
'@storybook/icons': 2.1.0(react@18.3.1)
- '@storybook/react-dom-shim': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ '@storybook/react-dom-shim': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
ts-dedent: 2.2.0
optionalDependencies:
'@types/react': 18.3.28
@@ -24189,10 +24189,10 @@ snapshots:
'@types/react': 18.3.28
react: 18.3.1
- '@storybook/addon-links@10.5.10(@types/react@18.3.28)(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))':
+ '@storybook/addon-links@10.5.10(@types/react@18.3.28)(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))':
dependencies:
'@storybook/global': 5.0.0
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
optionalDependencies:
'@types/react': 18.3.28
react: 18.3.1
@@ -24281,9 +24281,9 @@ snapshots:
- uglify-js
- webpack-cli
- '@storybook/builder-webpack5@10.5.10(@swc/core@1.15.24)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)':
+ '@storybook/builder-webpack5@10.5.10(@swc/core@1.15.24)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)':
dependencies:
- '@storybook/core-webpack': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ '@storybook/core-webpack': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
case-sensitive-paths-webpack-plugin: 2.4.0
cjs-module-lexer: 1.4.3
css-loader: 7.1.4(webpack@5.97.1)
@@ -24292,7 +24292,7 @@ snapshots:
html-webpack-plugin: 5.6.6(webpack@5.97.1)
magic-string: 0.30.21
semver: 7.8.5
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
style-loader: 4.0.0(webpack@5.97.1)
terser-webpack-plugin: 5.4.0(@swc/core@1.15.24)(webpack@5.97.1)
ts-dedent: 2.2.0
@@ -24314,9 +24314,9 @@ snapshots:
storybook: 10.5.10(@types/react@18.3.28)(prettier@2.8.8)(react@18.3.1)
ts-dedent: 2.2.0
- '@storybook/core-webpack@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))':
+ '@storybook/core-webpack@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))':
dependencies:
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
ts-dedent: 2.2.0
'@storybook/csf-plugin@10.5.10(esbuild@0.24.2)(storybook@10.5.10(@types/react@18.3.28)(prettier@2.8.8)(react@18.3.1))(webpack@5.97.1(@swc/core@1.15.24)(esbuild@0.24.2))':
@@ -24335,9 +24335,9 @@ snapshots:
esbuild: 0.24.2
webpack: 5.97.1(@swc/core@1.15.24)(esbuild@0.24.2)(webpack-cli@5.1.4)
- '@storybook/csf-plugin@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(webpack@5.97.1)':
+ '@storybook/csf-plugin@10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(webpack@5.97.1)':
dependencies:
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
unplugin: 2.3.11
optionalDependencies:
webpack: 5.97.1(@swc/core@1.15.24)(webpack-cli@5.1.4)
@@ -24417,9 +24417,9 @@ snapshots:
- uglify-js
- webpack-cli
- '@storybook/preset-react-webpack@10.5.10(@swc/core@1.15.24)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)':
+ '@storybook/preset-react-webpack@10.5.10(@swc/core@1.15.24)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)':
dependencies:
- '@storybook/core-webpack': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ '@storybook/core-webpack': 10.5.10(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
'@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.7.3)(webpack@5.97.1)
'@types/semver': 7.7.1
magic-string: 0.30.21
@@ -24428,7 +24428,7 @@ snapshots:
react-dom: 18.3.1(react@18.3.1)
resolve: 1.22.12
semver: 7.8.5
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
tsconfig-paths: 4.2.0
webpack: 5.97.1(@swc/core@1.15.24)(webpack-cli@5.1.4)
optionalDependencies:
@@ -24477,11 +24477,11 @@ snapshots:
'@types/react': 18.3.28
'@types/react-dom': 18.3.7(@types/react@18.3.28)
- '@storybook/react-dom-shim@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))':
+ '@storybook/react-dom-shim@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))':
dependencies:
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
optionalDependencies:
'@types/react': 18.3.28
'@types/react-dom': 18.3.7(@types/react@18.3.28)
@@ -24546,14 +24546,14 @@ snapshots:
- uglify-js
- webpack-cli
- '@storybook/react-webpack5@10.5.10(@swc/core@1.15.24)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)':
+ '@storybook/react-webpack5@10.5.10(@swc/core@1.15.24)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)':
dependencies:
- '@storybook/builder-webpack5': 10.5.10(@swc/core@1.15.24)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)
- '@storybook/preset-react-webpack': 10.5.10(@swc/core@1.15.24)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)(webpack-cli@5.1.4)
- '@storybook/react': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)
+ '@storybook/builder-webpack5': 10.5.10(@swc/core@1.15.24)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)
+ '@storybook/preset-react-webpack': 10.5.10(@swc/core@1.15.24)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)(webpack-cli@5.1.4)
+ '@storybook/react': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
optionalDependencies:
typescript: 5.7.3
transitivePeerDependencies:
@@ -24582,15 +24582,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@storybook/react@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))(typescript@5.7.3)':
+ '@storybook/react@10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))(typescript@5.7.3)':
dependencies:
'@storybook/global': 5.0.0
- '@storybook/react-dom-shim': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3))
+ '@storybook/react-dom-shim': 10.5.10(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6))
react: 18.3.1
react-docgen: 8.0.3
react-docgen-typescript: 2.4.0(typescript@5.7.3)
react-dom: 18.3.1(react@18.3.1)
- storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3)
+ storybook: 10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6)
optionalDependencies:
'@types/react': 18.3.28
'@types/react-dom': 18.3.7(@types/react@18.3.28)
@@ -25743,12 +25743,12 @@ snapshots:
'@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.97.1)':
dependencies:
webpack: 5.97.1(@swc/core@1.15.24)(webpack-cli@5.1.4)
- webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack-dev-server@4.15.2)(webpack@5.97.1)
+ webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack@5.97.1)
'@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1)':
dependencies:
webpack: 5.97.1(@swc/core@1.15.24)(webpack-cli@5.1.4)
- webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack-dev-server@4.15.2)(webpack@5.97.1)
+ webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack@5.97.1)
'@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@4.15.2)(webpack@5.97.1)':
dependencies:
@@ -27399,40 +27399,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/core-data@7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/api-fetch': 7.48.1
- '@wordpress/block-editor': 15.21.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/blocks': 15.21.1(react@18.3.1)
- '@wordpress/compose': 7.45.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/data': 10.33.1(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/deprecated': 4.50.0
- '@wordpress/element': 6.45.0
- '@wordpress/html-entities': 4.50.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/is-shallow-equal': 5.50.0
- '@wordpress/private-apis': 1.48.1
- '@wordpress/rich-text': 7.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/sync': 1.48.1
- '@wordpress/undo-manager': 1.50.0
- '@wordpress/url': 4.48.1
- '@wordpress/warning': 3.51.0
- change-case: 4.1.2
- equivalent-key-map: 0.2.2
- fast-deep-equal: 3.1.3
- memize: 2.1.1
- react: 18.3.1
- react-dom: 18.3.1(react@18.3.1)
- uuid: 9.0.1
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - stylelint
- - supports-color
-
'@wordpress/core-data@7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
dependencies:
'@types/react': 18.3.28
@@ -27501,40 +27467,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/core-data@7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@types/react': 18.3.28
- '@wordpress/api-fetch': 7.48.1
- '@wordpress/block-editor': 15.21.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/blocks': 15.21.1(react@18.3.1)
- '@wordpress/compose': 8.3.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/deprecated': 4.50.0
- '@wordpress/element': 8.2.0
- '@wordpress/html-entities': 4.50.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/is-shallow-equal': 5.50.0
- '@wordpress/private-apis': 1.48.1
- '@wordpress/rich-text': 7.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/sync': 1.48.1
- '@wordpress/undo-manager': 1.50.0
- '@wordpress/url': 4.48.1
- '@wordpress/warning': 3.51.0
- change-case: 4.1.2
- equivalent-key-map: 0.2.2
- fast-deep-equal: 3.1.3
- memize: 2.1.1
- react: 18.3.1
- react-dom: 18.3.1(react@18.3.1)
- uuid: 14.0.0
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react-dom'
- - date-fns
- - stylelint
- - supports-color
-
'@wordpress/data-controls@4.33.1(@types/react@18.3.28)(react@18.3.1)':
dependencies:
'@wordpress/api-fetch': 7.33.1
@@ -28099,14 +28031,14 @@ snapshots:
'@wordpress/commands': 1.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/components': 30.9.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/compose': 7.45.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/core-data': 7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ '@wordpress/core-data': 7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/data': 10.33.1(@types/react@18.3.28)(react@18.3.1)
'@wordpress/dataviews': 10.3.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/date': 5.50.0
'@wordpress/deprecated': 4.50.0
'@wordpress/dom': 4.50.0
'@wordpress/element': 6.45.0
- '@wordpress/fields': 0.25.11(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ '@wordpress/fields': 0.25.11(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/hooks': 4.50.0
'@wordpress/html-entities': 4.50.0
'@wordpress/i18n': 6.23.0
@@ -28114,13 +28046,13 @@ snapshots:
'@wordpress/interface': 9.33.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(esbuild@0.24.2)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/keyboard-shortcuts': 5.48.1(react@18.3.1)
'@wordpress/keycodes': 4.50.0(@types/react@18.3.28)
- '@wordpress/media-utils': 5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ '@wordpress/media-utils': 5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/notices': 5.33.1(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/patterns': 2.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ '@wordpress/patterns': 2.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/plugins': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/preferences': 4.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/private-apis': 1.48.1
- '@wordpress/reusable-blocks': 5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
+ '@wordpress/reusable-blocks': 5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
'@wordpress/rich-text': 7.50.0(@types/react@18.3.28)(react@18.3.1)
'@wordpress/server-side-render': 6.20.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@wordpress/url': 4.48.1
@@ -28231,14 +28163,14 @@ snapshots:
'@wordpress/escape-html@3.50.0': {}
- '@wordpress/eslint-plugin@25.6.0(@babel/core@7.25.7)(@types/eslint@9.6.1)(@types/react@18.3.28)(@typescript-eslint/eslint-plugin@8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.0.3)':
+ '@wordpress/eslint-plugin@25.6.0(@babel/core@7.25.7)(@types/eslint@9.6.1)(@types/react@18.3.28)(@typescript-eslint/eslint-plugin@8.64.0(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(@typescript-eslint/parser@8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3))(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.9.6)':
dependencies:
'@babel/core': 7.25.7
'@babel/eslint-parser': 7.28.6(@babel/core@7.25.7)(eslint@10.7.0(jiti@2.6.1))
'@eslint-community/eslint-plugin-eslint-comments': 4.7.2(eslint@10.7.0(jiti@2.6.1))
'@eslint/compat': 2.1.0(eslint@10.7.0(jiti@2.6.1))
'@wordpress/babel-preset-default': 8.51.0
- '@wordpress/prettier-config': 4.51.0(wp-prettier@3.0.3)
+ '@wordpress/prettier-config': 4.51.0(wp-prettier@3.9.6)
'@wordpress/theme': 0.17.0(@types/react@18.3.28)(esbuild@0.24.2)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
cosmiconfig: 7.1.0
eslint: 10.7.0(jiti@2.6.1)
@@ -28249,14 +28181,14 @@ snapshots:
eslint-plugin-jsdoc: 50.8.0(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-jsx-a11y: 6.10.2(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-playwright: 2.10.5(eslint@10.7.0(jiti@2.6.1))
- eslint-plugin-prettier: 5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.0.3)
+ eslint-plugin-prettier: 5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.9.6)
eslint-plugin-react: 7.37.5(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-react-hooks: 7.1.1(eslint@10.7.0(jiti@2.6.1))
globals: 16.5.0
requireindex: 1.2.0
typescript-eslint: 8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3)
optionalDependencies:
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
typescript: 5.7.3
transitivePeerDependencies:
- '@types/eslint'
@@ -28274,14 +28206,14 @@ snapshots:
- supports-color
- vite
- '@wordpress/eslint-plugin@25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.0.3)':
+ '@wordpress/eslint-plugin@25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.9.6)':
dependencies:
'@babel/core': 7.29.7
'@babel/eslint-parser': 7.28.6(@babel/core@7.29.7)(eslint@10.7.0(jiti@2.6.1))
'@eslint-community/eslint-plugin-eslint-comments': 4.7.2(eslint@10.7.0(jiti@2.6.1))
'@eslint/compat': 2.1.0(eslint@10.7.0(jiti@2.6.1))
'@wordpress/babel-preset-default': 8.51.0
- '@wordpress/prettier-config': 4.51.0(wp-prettier@3.0.3)
+ '@wordpress/prettier-config': 4.51.0(wp-prettier@3.9.6)
'@wordpress/theme': 0.17.0(@types/react@18.3.28)(esbuild@0.24.2)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
cosmiconfig: 7.1.0
eslint: 10.7.0(jiti@2.6.1)
@@ -28292,14 +28224,14 @@ snapshots:
eslint-plugin-jsdoc: 50.8.0(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-jsx-a11y: 6.10.2(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-playwright: 2.10.5(eslint@10.7.0(jiti@2.6.1))
- eslint-plugin-prettier: 5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.0.3)
+ eslint-plugin-prettier: 5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.9.6)
eslint-plugin-react: 7.37.5(eslint@10.7.0(jiti@2.6.1))
eslint-plugin-react-hooks: 7.1.1(eslint@10.7.0(jiti@2.6.1))
globals: 16.5.0
requireindex: 1.2.0
typescript-eslint: 8.64.0(eslint@10.7.0(jiti@2.6.1))(typescript@5.7.3)
optionalDependencies:
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
typescript: 5.7.3
transitivePeerDependencies:
- '@types/eslint'
@@ -28358,47 +28290,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/fields@0.25.11(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/api-fetch': 7.48.1
- '@wordpress/base-styles': 6.20.0
- '@wordpress/blob': 4.48.1
- '@wordpress/block-editor': 15.21.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/blocks': 15.21.1(react@18.3.1)
- '@wordpress/components': 30.9.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/compose': 7.45.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/core-data': 7.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.33.1(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/dataviews': 10.3.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/date': 5.50.0
- '@wordpress/element': 6.45.0
- '@wordpress/hooks': 4.50.0
- '@wordpress/html-entities': 4.50.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/icons': 11.8.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/media-utils': 5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/notices': 5.33.1(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/patterns': 2.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/primitives': 4.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/private-apis': 1.48.1
- '@wordpress/router': 1.44.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/url': 4.48.1
- '@wordpress/warning': 3.51.0
- change-case: 4.1.2
- client-zip: 2.5.0
- clsx: 2.1.1
- react: 18.3.1
- remove-accents: 0.5.0
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - react-dom
- - stylelint
- - supports-color
-
'@wordpress/format-library@5.33.9(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(date-fns@4.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
dependencies:
'@wordpress/a11y': 4.50.0
@@ -28728,12 +28619,6 @@ snapshots:
jest: 29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3))
jest-matcher-utils: 27.5.1
- '@wordpress/jest-console@8.51.0(jest@29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))':
- dependencies:
- jest: 29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3))
- jest-matcher-utils: 29.7.0
- jest-mock: 29.7.0
-
'@wordpress/jest-console@8.51.0(jest@29.5.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))':
dependencies:
jest: 29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3))
@@ -28746,15 +28631,6 @@ snapshots:
jest-matcher-utils: 29.7.0
jest-mock: 29.7.0
- '@wordpress/jest-preset-default@12.43.1-next.v.202604091042.0(@babel/core@7.25.7)(jest@29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))':
- dependencies:
- '@babel/core': 7.25.7
- '@wordpress/jest-console': 8.51.0(jest@29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))
- babel-jest: 29.7.0(@babel/core@7.25.7)
- jest: 29.5.0(@types/node@24.12.2)(babel-plugin-macros@3.1.0)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3))
- transitivePeerDependencies:
- - supports-color
-
'@wordpress/jest-preset-default@12.43.1-next.v.202604091042.0(@babel/core@7.25.7)(jest@29.5.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))':
dependencies:
'@babel/core': 7.25.7
@@ -28844,32 +28720,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/media-fields@0.9.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/base-styles': 6.20.0
- '@wordpress/components': 32.6.0(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/compose': 7.45.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/core-data': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/dataviews': 14.2.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/date': 5.50.0
- '@wordpress/element': 6.45.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/icons': 12.2.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/primitives': 4.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/url': 4.48.1
- clsx: 2.1.1
- react: 18.3.1
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - react-dom
- - stylelint
- - supports-color
-
'@wordpress/media-utils@4.49.0':
dependencies:
'@babel/runtime': 7.29.2
@@ -28915,35 +28765,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/media-utils@5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/api-fetch': 7.48.1
- '@wordpress/base-styles': 6.20.0
- '@wordpress/blob': 4.48.1
- '@wordpress/components': 32.6.0(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/core-data': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/dataviews': 14.2.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/element': 6.45.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/icons': 12.2.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/media-fields': 0.9.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/notices': 5.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/private-apis': 1.48.1
- '@wordpress/ui': 0.11.0(@date-fns/tz@1.4.1)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/views': 1.11.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- clsx: 2.1.1
- react: 18.3.1
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - react-dom
- - stylelint
- - supports-color
-
'@wordpress/notices@4.26.0(react@18.3.1)':
dependencies:
'@babel/runtime': 7.29.2
@@ -29088,34 +28909,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/patterns@2.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/a11y': 4.50.0
- '@wordpress/base-styles': 6.20.0
- '@wordpress/block-editor': 15.21.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/blocks': 15.21.1(react@18.3.1)
- '@wordpress/components': 32.6.0(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/compose': 7.45.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/core-data': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/element': 6.45.0
- '@wordpress/html-entities': 4.50.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/icons': 12.2.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/notices': 5.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/private-apis': 1.48.1
- '@wordpress/url': 4.48.1
- react: 18.3.1
- react-dom: 18.3.1(react@18.3.1)
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - stylelint
- - supports-color
-
'@wordpress/plugins@6.26.0(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.29.2
@@ -29242,13 +29035,13 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/prettier-config@4.49.0(wp-prettier@3.0.3)':
+ '@wordpress/prettier-config@4.51.0(wp-prettier@3.9.6)':
dependencies:
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
- '@wordpress/prettier-config@4.51.0(wp-prettier@3.0.3)':
+ '@wordpress/prettier-config@4.56.0(wp-prettier@3.9.6)':
dependencies:
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
'@wordpress/primitives@2.2.0':
dependencies:
@@ -29403,31 +29196,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/reusable-blocks@5.44.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/base-styles': 6.20.0
- '@wordpress/block-editor': 15.21.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/blocks': 15.21.1(react@18.3.1)
- '@wordpress/components': 32.6.0(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- '@wordpress/core-data': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/element': 6.45.0
- '@wordpress/i18n': 6.23.0
- '@wordpress/icons': 12.2.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/notices': 5.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/private-apis': 1.48.1
- '@wordpress/url': 4.48.1
- react: 18.3.1
- react-dom: 18.3.1(react@18.3.1)
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - stylelint
- - supports-color
-
'@wordpress/rich-text@4.2.0(react@18.3.1)(redux@4.2.1)':
dependencies:
'@babel/runtime': 7.29.2
@@ -29543,11 +29311,11 @@ snapshots:
'@wordpress/browserslist-config': 6.51.0
'@wordpress/dependency-extraction-webpack-plugin': 6.51.0(webpack@5.97.1)
'@wordpress/e2e-test-utils-playwright': 1.51.0(@playwright/test@1.63.0)(@types/node@24.12.2)
- '@wordpress/eslint-plugin': 25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.0.3)
+ '@wordpress/eslint-plugin': 25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.9.6)
'@wordpress/jest-preset-default': 12.51.0(@babel/core@7.29.7)(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))
'@wordpress/npm-package-json-lint-config': 5.51.0(npm-package-json-lint@6.4.0(typescript@5.7.3))
'@wordpress/postcss-plugins-preset': 5.56.0(postcss@8.5.26)
- '@wordpress/prettier-config': 4.51.0(wp-prettier@3.0.3)
+ '@wordpress/prettier-config': 4.51.0(wp-prettier@3.9.6)
'@wordpress/stylelint-config': 23.42.0(@types/react@18.3.28)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint-scss@6.14.0(stylelint@16.26.1(typescript@5.7.3)))(stylelint@16.26.1(typescript@5.7.3))
adm-zip: 0.5.17
babel-jest: 29.7.0(@babel/core@7.29.7)
@@ -29578,7 +29346,7 @@ snapshots:
npm-packlist: 3.0.0
postcss: 8.5.26
postcss-loader: 6.2.1(postcss@8.5.26)(webpack@5.97.1)
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
puppeteer-core: 23.11.1
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
@@ -29646,11 +29414,11 @@ snapshots:
'@wordpress/browserslist-config': 6.51.0
'@wordpress/dependency-extraction-webpack-plugin': 6.51.0(webpack@5.97.1)
'@wordpress/e2e-test-utils-playwright': 1.51.0(@playwright/test@1.63.0)(@types/node@24.12.2)
- '@wordpress/eslint-plugin': 25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.0.3)
+ '@wordpress/eslint-plugin': 25.6.0(@babel/core@7.29.7)(@types/react@18.3.28)(eslint-import-resolver-webpack@0.13.11)(eslint@10.7.0(jiti@2.6.1))(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))(typescript@5.7.3)(wp-prettier@3.9.6)
'@wordpress/jest-preset-default': 12.51.0(@babel/core@7.29.7)(jest@29.7.0(@types/node@24.12.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3)))
'@wordpress/npm-package-json-lint-config': 5.51.0(npm-package-json-lint@6.4.0(typescript@5.7.3))
'@wordpress/postcss-plugins-preset': 5.56.0(postcss@8.5.26)
- '@wordpress/prettier-config': 4.51.0(wp-prettier@3.0.3)
+ '@wordpress/prettier-config': 4.51.0(wp-prettier@3.9.6)
'@wordpress/stylelint-config': 23.42.0(@types/react@18.3.28)(postcss@8.5.26)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint-scss@6.14.0(stylelint@16.26.1(typescript@5.7.3)))(stylelint@16.26.1(typescript@5.7.3))
adm-zip: 0.5.17
babel-jest: 29.7.0(@babel/core@7.29.7)
@@ -29681,7 +29449,7 @@ snapshots:
npm-packlist: 3.0.0
postcss: 8.5.26
postcss-loader: 6.2.1(postcss@8.5.26)(webpack@5.97.1)
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
puppeteer-core: 23.11.1
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
@@ -30229,26 +29997,6 @@ snapshots:
- stylelint
- supports-color
- '@wordpress/views@1.11.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))':
- dependencies:
- '@wordpress/core-data': 7.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(date-fns@3.6.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/data': 10.50.0(@types/react@18.3.28)(react@18.3.1)
- '@wordpress/dataviews': 14.2.0(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/element': 6.45.0
- '@wordpress/preferences': 4.48.1(@date-fns/tz@1.4.1)(@emotion/is-prop-valid@1.4.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(stylelint@16.26.1(typescript@5.7.3))
- '@wordpress/private-apis': 1.48.1
- dequal: 2.0.3
- transitivePeerDependencies:
- - '@date-fns/tz'
- - '@emotion/is-prop-valid'
- - '@types/react'
- - '@types/react-dom'
- - date-fns
- - react
- - react-dom
- - stylelint
- - supports-color
-
'@wordpress/vips@2.1.1':
dependencies:
'@wordpress/worker-threads': 1.8.1
@@ -33077,10 +32825,10 @@ snapshots:
eslint: 10.7.0(jiti@2.6.1)
globals: 17.7.0
- eslint-plugin-prettier@5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.0.3):
+ eslint-plugin-prettier@5.5.5(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@10.7.0(jiti@2.6.1)))(eslint@10.7.0(jiti@2.6.1))(wp-prettier@3.9.6):
dependencies:
eslint: 10.7.0(jiti@2.6.1)
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
prettier-linter-helpers: 1.0.1
synckit: 0.11.12
optionalDependencies:
@@ -39457,7 +39205,7 @@ snapshots:
- react
- utf-8-validate
- storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.0.3):
+ storybook@10.5.10(@types/react@18.3.28)(react@18.3.1)(wp-prettier@3.9.6):
dependencies:
'@storybook/global': 5.0.0
'@storybook/icons': 2.1.0(react@18.3.1)
@@ -39478,7 +39226,7 @@ snapshots:
ws: 8.21.3
optionalDependencies:
'@types/react': 18.3.28
- prettier: wp-prettier@3.0.3
+ prettier: wp-prettier@3.9.6
transitivePeerDependencies:
- bufferutil
- react
@@ -40969,7 +40717,7 @@ snapshots:
watchpack: 2.5.1
webpack-sources: 3.3.4
optionalDependencies:
- webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack-dev-server@4.15.2)(webpack@5.97.1)
+ webpack-cli: 5.1.4(webpack-bundle-analyzer@4.9.1)(webpack@5.97.1)
transitivePeerDependencies:
- '@swc/core'
- esbuild
@@ -41084,7 +40832,7 @@ snapshots:
wordwrap@1.0.0: {}
- wp-prettier@3.0.3: {}
+ wp-prettier@3.9.6: {}
wp-textdomain@1.0.1:
dependencies:
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 62bfc4594af..d06339fe602 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -78,7 +78,7 @@ catalogs:
'@babel/preset-react': 7.25.7
'@babel/preset-typescript': 7.25.7
'@babel/runtime': 7.25.7
- '@wordpress/prettier-config': 4.49.0
+ '@wordpress/prettier-config': 4.56.0
'@wordpress/postcss-plugins-preset': 5.56.0
'@wordpress/stylelint-config': ^23.14.0
postcss: ^8.5.26
diff --git a/tools/monorepo-utils/src/changefile/index.ts b/tools/monorepo-utils/src/changefile/index.ts
index 825e513bce2..471b192df23 100644
--- a/tools/monorepo-utils/src/changefile/index.ts
+++ b/tools/monorepo-utils/src/changefile/index.ts
@@ -91,7 +91,7 @@ const program = new Command( 'changefile' )
: await cloneAuthenticatedRepo(
{ owner: headOwner, name },
false
- );
+ );
Logger.endTask();
diff --git a/tools/monorepo-utils/src/ci-jobs/lib/file-changes.ts b/tools/monorepo-utils/src/ci-jobs/lib/file-changes.ts
index 4bc940270c5..14cac866898 100644
--- a/tools/monorepo-utils/src/ci-jobs/lib/file-changes.ts
+++ b/tools/monorepo-utils/src/ci-jobs/lib/file-changes.ts
@@ -204,7 +204,7 @@ export function getFileChanges(
? new RegExp(
re.source,
re.flags.replace( /[gy]/g, '' )
- )
+ )
: re
);
}
diff --git a/tools/monorepo-utils/src/ci-jobs/lib/job-processing.ts b/tools/monorepo-utils/src/ci-jobs/lib/job-processing.ts
index 46bf225d633..1f5ab847f6f 100644
--- a/tools/monorepo-utils/src/ci-jobs/lib/job-processing.ts
+++ b/tools/monorepo-utils/src/ci-jobs/lib/job-processing.ts
@@ -378,7 +378,7 @@ async function createJobsForProject(
dependencyInfos.push( {
name: dependency.name,
changedFiles:
- changes === true ? [] : changes[ dependency.name ] ?? [],
+ changes === true ? [] : ( changes[ dependency.name ] ?? [] ),
spawnsJobs:
dependencyJobs.test.length + dependencyJobs.lint.length > 0,
} );
diff --git a/tools/monorepo-utils/src/core/util.ts b/tools/monorepo-utils/src/core/util.ts
index 6be450688e5..932ec34ec34 100644
--- a/tools/monorepo-utils/src/core/util.ts
+++ b/tools/monorepo-utils/src/core/util.ts
@@ -12,9 +12,11 @@ export const execAsync = promisify( exec );
type HttpsResponse = {
// I think it's fine to use this type this way just to exclude functions from the IncomingMessage type.
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/no-empty-object-type
- [ K in keyof IncomingMessage as IncomingMessage[ K ] extends Function
- ? never
- : K ]: IncomingMessage[ K ];
+ [
+ K in keyof IncomingMessage as IncomingMessage[ K ] extends Function
+ ? never
+ : K
+ ]: IncomingMessage[ K ];
} & {
body: string;
};
diff --git a/tools/monorepo-utils/src/pull-requests/commands/add-changelog-file.ts b/tools/monorepo-utils/src/pull-requests/commands/add-changelog-file.ts
index 54aab262609..9cf8f055cf8 100644
--- a/tools/monorepo-utils/src/pull-requests/commands/add-changelog-file.ts
+++ b/tools/monorepo-utils/src/pull-requests/commands/add-changelog-file.ts
@@ -53,7 +53,7 @@ const run = async (
let prData: any = await gql(
`
-query($pr_number: Int!) {
+query($pr_number: Int!) {
repository(owner: "${ options.owner }", name: "${ options.name }") {
pullRequest(number: $pr_number) {
title
@@ -250,7 +250,7 @@ export const addChangelogFileCommand = new Command( 'add-changelog-file' )
.argParser( ( x ) =>
significanceValues.includes( x )
? x
- : significances[ x ] ?? null
+ : ( significances[ x ] ?? null )
)
)
.addArgument(
@@ -259,7 +259,7 @@ export const addChangelogFileCommand = new Command( 'add-changelog-file' )
.argParser( ( x ) =>
types.includes( x )
? x
- : types.find( ( t ) => t[ 0 ] === x[ 0 ] ) ?? null
+ : ( types.find( ( t ) => t[ 0 ] === x[ 0 ] ) ?? null )
)
)
.argument(