From 6ca9f90c44bbbbcba413ea8133d059d1d54f965b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Wed, 2 Nov 2022 17:46:14 +0100 Subject: [PATCH] Fix ESLint errors (https://github.com/woocommerce/woocommerce-blocks/pull/7556) * Add type to imports that need it * Add type to imports that need it * Fix the sanitize lint error * Include missing dep * Remove check from deps * bot: update checkstyle.xml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- plugins/woocommerce-blocks/.vscode/storybook.code-snippets | 2 +- .../js/atomic/blocks/product-elements/rating/edit.tsx | 2 +- .../assets/js/base/components/button/stories/index.tsx | 2 +- .../cart-checkout/totals/coupon/stories/index.tsx | 2 +- .../cart-checkout/totals/discount/stories/index.tsx | 2 +- .../cart-checkout/totals/footer-item/stories/index.tsx | 2 +- .../js/base/components/chip/stories/chip.stories.tsx | 2 +- .../components/chip/stories/removable-chip.stories.tsx | 2 +- .../js/base/components/country-input/stories/index.tsx | 2 +- .../js/base/components/form-token-field/stories/index.tsx | 2 +- .../js/base/components/price-slider/stories/index.tsx | 2 +- .../js/base/components/product-name/stories/index.tsx | 2 +- .../js/base/components/product-price/stories/index.tsx | 2 +- .../js/base/components/quantity-selector/stories/index.tsx | 2 +- .../assets/js/base/components/read-more/stories/index.tsx | 2 +- .../assets/js/blocks/active-filters/edit.tsx | 2 +- .../blocks/cart-checkout-shared/block-settings/index.tsx | 2 +- .../inner-blocks/checkout-shipping-address-block/block.tsx | 7 ++++++- .../assets/js/blocks/classic-template/index.tsx | 2 +- .../assets/js/blocks/classic-template/utils.ts | 2 +- .../assets/js/blocks/handpicked-products/types.ts | 2 +- .../assets/js/blocks/product-query/index.tsx | 2 +- .../assets/js/blocks/products-by-attribute/types.ts | 2 +- .../assets/js/blocks/stock-filter/block.tsx | 7 +------ .../error-placeholder/stories/error-message.tsx | 2 +- .../error-placeholder/stories/error-placeholder.tsx | 2 +- .../editor-components/external-link-card/stories/index.tsx | 2 +- .../woocommerce-blocks/assets/js/icons/stories/index.tsx | 2 +- .../woocommerce-blocks/assets/js/utils/sanitize-html.ts | 4 ++-- .../checkout/components/checkbox-control/stories/index.tsx | 2 +- .../checkout/components/totals/fees/stories/index.tsx | 2 +- .../checkout/components/totals/item/stories/index.tsx | 2 +- .../checkout/components/totals/subtotal/stories/index.tsx | 2 +- .../checkout/components/totals/taxes/stories/index.tsx | 2 +- plugins/woocommerce-blocks/storybook/README.md | 2 +- 35 files changed, 41 insertions(+), 41 deletions(-) diff --git a/plugins/woocommerce-blocks/.vscode/storybook.code-snippets b/plugins/woocommerce-blocks/.vscode/storybook.code-snippets index 54c33608276..1050fda3b4e 100644 --- a/plugins/woocommerce-blocks/.vscode/storybook.code-snippets +++ b/plugins/woocommerce-blocks/.vscode/storybook.code-snippets @@ -5,7 +5,7 @@ "/**", " * External dependencies", " */", - "import { Story, Meta } from '@storybook/react';", + "import type { Story, Meta } from '@storybook/react';", "", "/**", " * Internal dependencies", diff --git a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/edit.tsx b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/edit.tsx index 936b6e50bcf..3b36d5476fe 100644 --- a/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/edit.tsx +++ b/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements/rating/edit.tsx @@ -3,7 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { useBlockProps } from '@wordpress/block-editor'; -import { BlockEditProps } from '@wordpress/blocks'; +import type { BlockEditProps } from '@wordpress/blocks'; import { useEffect } from 'react'; import { ProductQueryContext as Context } from '@woocommerce/blocks/product-query/types'; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/button/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/button/stories/index.tsx index d779392f73c..ecf3c5242c5 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/button/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/button/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/stories/index.tsx index d87bef2c6d4..79b816e0bb4 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/coupon/stories/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import { useArgs } from '@storybook/client-api'; -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { INTERACTION_TIMEOUT } from '@woocommerce/storybook-controls'; import { useDispatch } from '@wordpress/data'; import { VALIDATION_STORE_KEY } from '@woocommerce/block-data'; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/stories/index.tsx index 1aea99a30db..d656a481849 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/discount/stories/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import { useArgs } from '@storybook/client-api'; -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currenciesAPIShape as currencies, currencyControl, diff --git a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/stories/index.tsx index 38ceecc92cf..2acfb7d6d76 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/totals/footer-item/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { allSettings } from '@woocommerce/settings'; import { Currency } from '@woocommerce/types'; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/chip.stories.tsx b/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/chip.stories.tsx index 740706cbb16..475aed94ea1 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/chip.stories.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/chip.stories.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/removable-chip.stories.tsx b/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/removable-chip.stories.tsx index fa5145ff2b0..99db9b13fed 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/removable-chip.stories.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/chip/stories/removable-chip.stories.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/base/components/country-input/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/country-input/stories/index.tsx index e9fe5a5282c..1818b52aa76 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/country-input/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/country-input/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { useDispatch } from '@wordpress/data'; import { useState, useEffect } from '@wordpress/element'; import { VALIDATION_STORE_KEY } from '@woocommerce/block-data'; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/form-token-field/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/form-token-field/stories/index.tsx index 6f6684593eb..b3e20e21461 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/form-token-field/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/form-token-field/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { useState } from '@wordpress/element'; /** diff --git a/plugins/woocommerce-blocks/assets/js/base/components/price-slider/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/price-slider/stories/index.tsx index 6b615a53b99..7aef92ad2d3 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/price-slider/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/price-slider/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { useState } from '@wordpress/element'; import { currencies, currencyControl } from '@woocommerce/storybook-controls'; diff --git a/plugins/woocommerce-blocks/assets/js/base/components/product-name/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/product-name/stories/index.tsx index 9806e93f4dd..ee5546d23f4 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/product-name/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/product-name/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/base/components/product-price/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/product-price/stories/index.tsx index 9b9fc0927ea..736e2d8a850 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/product-price/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/product-price/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currencyControl } from '@woocommerce/storybook-controls'; /** diff --git a/plugins/woocommerce-blocks/assets/js/base/components/quantity-selector/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/quantity-selector/stories/index.tsx index dfa0962293f..13c1e48e3da 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/quantity-selector/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/quantity-selector/stories/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import { useArgs } from '@storybook/client-api'; -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/base/components/read-more/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/base/components/read-more/stories/index.tsx index 58b16fa0cd3..c6d9470af83 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/read-more/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/base/components/read-more/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/blocks/active-filters/edit.tsx b/plugins/woocommerce-blocks/assets/js/blocks/active-filters/edit.tsx index 6c5b4481c03..8d83491bf86 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/active-filters/edit.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/active-filters/edit.tsx @@ -3,7 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; -import { BlockEditProps } from '@wordpress/blocks'; +import type { BlockEditProps } from '@wordpress/blocks'; import BlockTitle from '@woocommerce/editor-components/block-title'; import { Disabled, diff --git a/plugins/woocommerce-blocks/assets/js/blocks/cart-checkout-shared/block-settings/index.tsx b/plugins/woocommerce-blocks/assets/js/blocks/cart-checkout-shared/block-settings/index.tsx index 1b2e4a6917a..0bc1b9558ed 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/cart-checkout-shared/block-settings/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/cart-checkout-shared/block-settings/index.tsx @@ -4,7 +4,7 @@ import { InspectorControls } from '@wordpress/block-editor'; import { PanelBody, ToggleControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { BlockAttributes } from '@wordpress/blocks'; +import type { BlockAttributes } from '@wordpress/blocks'; export const BlockSettings = ( { attributes, diff --git a/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx b/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx index eb7a5062bd5..5e8bd4c5496 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/block.tsx @@ -69,7 +69,12 @@ const Block = ( { setBillingAddress( shippingAddress ); } setAddressesSynced( true ); - }, [ setBillingAddress, shippingAddress, useShippingAsBilling ] ); + }, [ + addressesSynced, + setBillingAddress, + shippingAddress, + useShippingAsBilling, + ] ); const addressFieldsConfig = useMemo( () => { return { diff --git a/plugins/woocommerce-blocks/assets/js/blocks/classic-template/index.tsx b/plugins/woocommerce-blocks/assets/js/blocks/classic-template/index.tsx index a6df1fecc3d..33bee2eead6 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/classic-template/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/classic-template/index.tsx @@ -2,12 +2,12 @@ * External dependencies */ import { - BlockEditProps, createBlock, getBlockType, registerBlockType, unregisterBlockType, } from '@wordpress/blocks'; +import type { BlockEditProps } from '@wordpress/blocks'; import { isExperimentalBuild, WC_BLOCKS_IMAGE_URL, diff --git a/plugins/woocommerce-blocks/assets/js/blocks/classic-template/utils.ts b/plugins/woocommerce-blocks/assets/js/blocks/classic-template/utils.ts index 76a31299be4..0f310f032f3 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/classic-template/utils.ts +++ b/plugins/woocommerce-blocks/assets/js/blocks/classic-template/utils.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Block } from '@wordpress/blocks'; +import type { Block } from '@wordpress/blocks'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/blocks/handpicked-products/types.ts b/plugins/woocommerce-blocks/assets/js/blocks/handpicked-products/types.ts index 86ccc479acf..7132cb20fd4 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/handpicked-products/types.ts +++ b/plugins/woocommerce-blocks/assets/js/blocks/handpicked-products/types.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import { BlockAlignment } from '@wordpress/blocks'; +import type { BlockAlignment } from '@wordpress/blocks'; export interface Attributes { align?: BlockAlignment; diff --git a/plugins/woocommerce-blocks/assets/js/blocks/product-query/index.tsx b/plugins/woocommerce-blocks/assets/js/blocks/product-query/index.tsx index 5a9da69d634..a60d1a493e5 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/product-query/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/product-query/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Block } from '@wordpress/blocks'; +import type { Block } from '@wordpress/blocks'; import { addFilter } from '@wordpress/hooks'; /** diff --git a/plugins/woocommerce-blocks/assets/js/blocks/products-by-attribute/types.ts b/plugins/woocommerce-blocks/assets/js/blocks/products-by-attribute/types.ts index b3715774ea0..6d0bd700315 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/products-by-attribute/types.ts +++ b/plugins/woocommerce-blocks/assets/js/blocks/products-by-attribute/types.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import { BlockAlignment } from '@wordpress/blocks'; +import type { BlockAlignment } from '@wordpress/blocks'; export interface Attributes { align?: BlockAlignment; diff --git a/plugins/woocommerce-blocks/assets/js/blocks/stock-filter/block.tsx b/plugins/woocommerce-blocks/assets/js/blocks/stock-filter/block.tsx index fc3b2eafa91..936b1280856 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/stock-filter/block.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/stock-filter/block.tsx @@ -232,12 +232,7 @@ const StockStatusFilterBlock = ( { updateFilterUrl( checkedOptions ); }, - [ - isEditor, - setProductStockStatusQuery, - checked, - filteringForPhpTemplate, - ] + [ isEditor, setProductStockStatusQuery, filteringForPhpTemplate ] ); // Track checked STATE changes - if state changes, update the query. diff --git a/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-message.tsx b/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-message.tsx index 987413f7887..03c43700202 100644 --- a/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-message.tsx +++ b/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-message.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.tsx b/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.tsx index ad9fe2c5f10..c56a1d7d28e 100644 --- a/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.tsx +++ b/plugins/woocommerce-blocks/assets/js/editor-components/error-placeholder/stories/error-placeholder.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { useArgs } from '@storybook/client-api'; import { INTERACTION_TIMEOUT } from '@woocommerce/storybook-controls'; diff --git a/plugins/woocommerce-blocks/assets/js/editor-components/external-link-card/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/editor-components/external-link-card/stories/index.tsx index 6c1f23fbd71..578b179eece 100644 --- a/plugins/woocommerce-blocks/assets/js/editor-components/external-link-card/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/editor-components/external-link-card/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/assets/js/icons/stories/index.tsx b/plugins/woocommerce-blocks/assets/js/icons/stories/index.tsx index f6b8d87c6aa..2b0962776fc 100644 --- a/plugins/woocommerce-blocks/assets/js/icons/stories/index.tsx +++ b/plugins/woocommerce-blocks/assets/js/icons/stories/index.tsx @@ -2,7 +2,7 @@ * External dependencies */ import { omitBy } from 'lodash'; -import { Story } from '@storybook/react'; +import type { Story } from '@storybook/react'; import { useState } from '@wordpress/element'; import { Icon } from '@wordpress/icons'; diff --git a/plugins/woocommerce-blocks/assets/js/utils/sanitize-html.ts b/plugins/woocommerce-blocks/assets/js/utils/sanitize-html.ts index f6d81e2b1a4..059ff92c0d5 100644 --- a/plugins/woocommerce-blocks/assets/js/utils/sanitize-html.ts +++ b/plugins/woocommerce-blocks/assets/js/utils/sanitize-html.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import { sanitize } from 'dompurify'; +import DOMPurify from 'dompurify'; const ALLOWED_TAGS = [ 'a', 'b', 'em', 'i', 'strong', 'p', 'br' ]; const ALLOWED_ATTR = [ 'target', 'href', 'rel', 'name', 'download' ]; @@ -13,7 +13,7 @@ export const sanitizeHTML = ( const tagsValue = config?.tags || ALLOWED_TAGS; const attrValue = config?.attr || ALLOWED_ATTR; - return sanitize( html, { + return DOMPurify.sanitize( html, { ALLOWED_TAGS: tagsValue, ALLOWED_ATTR: attrValue, } ); diff --git a/plugins/woocommerce-blocks/packages/checkout/components/checkbox-control/stories/index.tsx b/plugins/woocommerce-blocks/packages/checkout/components/checkbox-control/stories/index.tsx index e89fcad7711..bc33718cc85 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/checkbox-control/stories/index.tsx +++ b/plugins/woocommerce-blocks/packages/checkout/components/checkbox-control/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; /** * Internal dependencies diff --git a/plugins/woocommerce-blocks/packages/checkout/components/totals/fees/stories/index.tsx b/plugins/woocommerce-blocks/packages/checkout/components/totals/fees/stories/index.tsx index c1304976390..5f984a29a78 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/totals/fees/stories/index.tsx +++ b/plugins/woocommerce-blocks/packages/checkout/components/totals/fees/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currenciesAPIShape, currencies, diff --git a/plugins/woocommerce-blocks/packages/checkout/components/totals/item/stories/index.tsx b/plugins/woocommerce-blocks/packages/checkout/components/totals/item/stories/index.tsx index ccf7d8514ac..8b6cd4d425c 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/totals/item/stories/index.tsx +++ b/plugins/woocommerce-blocks/packages/checkout/components/totals/item/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currencies, currencyControl } from '@woocommerce/storybook-controls'; /** diff --git a/plugins/woocommerce-blocks/packages/checkout/components/totals/subtotal/stories/index.tsx b/plugins/woocommerce-blocks/packages/checkout/components/totals/subtotal/stories/index.tsx index 84c39f07fa8..a2873c0f6bd 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/totals/subtotal/stories/index.tsx +++ b/plugins/woocommerce-blocks/packages/checkout/components/totals/subtotal/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currencies, currencyControl } from '@woocommerce/storybook-controls'; /** diff --git a/plugins/woocommerce-blocks/packages/checkout/components/totals/taxes/stories/index.tsx b/plugins/woocommerce-blocks/packages/checkout/components/totals/taxes/stories/index.tsx index 31d5504984b..194ebba5f86 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/totals/taxes/stories/index.tsx +++ b/plugins/woocommerce-blocks/packages/checkout/components/totals/taxes/stories/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import { currencies, currencyControl } from '@woocommerce/storybook-controls'; /** diff --git a/plugins/woocommerce-blocks/storybook/README.md b/plugins/woocommerce-blocks/storybook/README.md index 85fddb53f92..8434cd26604 100644 --- a/plugins/woocommerce-blocks/storybook/README.md +++ b/plugins/woocommerce-blocks/storybook/README.md @@ -38,7 +38,7 @@ Let's see the code in detail. This is the minimal scaffold you need for your new Story: ```tsx -import { Story, Meta } from '@storybook/react'; +import type { Story, Meta } from '@storybook/react'; import MyComponent, { MyComponentProps } from '..'; export default {