diff --git a/packages/animation/src/types/propTypes.ts b/packages/animation/src/types/propTypes.ts index a2bac27d410b..e4752f40613a 100644 --- a/packages/animation/src/types/propTypes.ts +++ b/packages/animation/src/types/propTypes.ts @@ -52,7 +52,7 @@ export const GeneralAnimationPropTypes = { export const AnimationProps = { id: PropTypes.string.isRequired, - type: PropTypes.oneOf([...Object.values(AnimationType)]), + type: PropTypes.oneOf(Object.values(AnimationType)), targets: PropTypes.arrayOf(PropTypes.string), ...GeneralAnimationPropTypes, }; diff --git a/packages/design-system/src/components/dropDown/stories/index.js b/packages/design-system/src/components/dropDown/stories/index.js index b5f1b176dc6d..cfd1f114ebf6 100644 --- a/packages/design-system/src/components/dropDown/stories/index.js +++ b/packages/design-system/src/components/dropDown/stories/index.js @@ -150,7 +150,7 @@ export const LightTheme = { }, }; -const shortenedOptions = [...basicDropDownOptions.slice(0, 3)]; +const shortenedOptions = basicDropDownOptions.slice(0, 3); export const ShortMenu = { render: function Render({ onMenuItemClick, ...args }) { diff --git a/packages/story-editor/src/app/helpCenter/useHelpCenterReducer.ts b/packages/story-editor/src/app/helpCenter/useHelpCenterReducer.ts index ac2f71a72636..e084e02249f9 100644 --- a/packages/story-editor/src/app/helpCenter/useHelpCenterReducer.ts +++ b/packages/story-editor/src/app/helpCenter/useHelpCenterReducer.ts @@ -182,7 +182,7 @@ export const getInitial = ( (payload: Pick) => (state: HelpCenterState) => ({ readTips: { - ...(payload?.readTips ?? {}), + ...payload?.readTips, ...state.readTips, }, isHydrated: true, diff --git a/packages/story-editor/src/components/canvas/mediaCaptions/cue.js b/packages/story-editor/src/components/canvas/mediaCaptions/cue.js index 9baaa6cf88da..a1a6f847c409 100644 --- a/packages/story-editor/src/components/canvas/mediaCaptions/cue.js +++ b/packages/story-editor/src/components/canvas/mediaCaptions/cue.js @@ -58,7 +58,7 @@ function Cue({ cue, videoTime, height }) { return (
- {[...html.childNodes].map((node) => { + {html.childNodes.map((node) => { if (node.target === 'timestamp') { return null; } else { diff --git a/packages/story-editor/src/components/canvas/test/_utils.js b/packages/story-editor/src/components/canvas/test/_utils.js index fcb97e33e5cb..4e3f65fb10d3 100644 --- a/packages/story-editor/src/components/canvas/test/_utils.js +++ b/packages/story-editor/src/components/canvas/test/_utils.js @@ -75,7 +75,7 @@ export function TestFrameElement({ selectedElementIds: [], ...(inputStoryContext && inputStoryContext.state), currentPage: { - ...(inputStoryContext.state?.currentPage || {}), + ...inputStoryContext.state?.currentPage, elements: [ element, ...(inputStoryContext.state?.currentPage?.elements || []), diff --git a/packages/story-editor/src/components/colorPicker/test/colorPicker/colorInteraction.js b/packages/story-editor/src/components/colorPicker/test/colorPicker/colorInteraction.js index e66ff0578dbe..a7a81b538f1a 100644 --- a/packages/story-editor/src/components/colorPicker/test/colorPicker/colorInteraction.js +++ b/packages/story-editor/src/components/colorPicker/test/colorPicker/colorInteraction.js @@ -65,7 +65,8 @@ function arrange(extraStylePresets, extraStateProps, extraStoryPresets) { ...extraStateProps, story: { globalStoryStyles: { - ...{ colors: [], textStyles: [] }, + colors: [], + textStyles: [], ...extraStylePresets, }, currentStoryStyles: { diff --git a/packages/story-editor/src/components/colorPicker/useDeleteColor.js b/packages/story-editor/src/components/colorPicker/useDeleteColor.js index b3527eb0628e..334a6cdd08ad 100644 --- a/packages/story-editor/src/components/colorPicker/useDeleteColor.js +++ b/packages/story-editor/src/components/colorPicker/useDeleteColor.js @@ -50,7 +50,7 @@ function useDeleteColor({ onEmpty = noop }) { updateStory({ properties: { globalStoryStyles: { - ...(globalStoryStyles || {}), + ...globalStoryStyles, colors: updatedColors, }, }, diff --git a/packages/story-editor/src/components/form/filterToggle/stories/index.js b/packages/story-editor/src/components/form/filterToggle/stories/index.js index b45283189313..41c902a29c63 100644 --- a/packages/story-editor/src/components/form/filterToggle/stories/index.js +++ b/packages/story-editor/src/components/form/filterToggle/stories/index.js @@ -92,8 +92,8 @@ export const _default = { {filters.map(({ value: toggleValue, ...rest }) => { return ( setValue(toggleValue)} > diff --git a/packages/story-editor/src/components/form/tags/input.js b/packages/story-editor/src/components/form/tags/input.js index 16fa84cc78a6..cb52f75d147c 100644 --- a/packages/story-editor/src/components/form/tags/input.js +++ b/packages/story-editor/src/components/form/tags/input.js @@ -238,8 +238,8 @@ function Input({ ].map((tag) => tag === INPUT_KEY ? ( @@ -75,23 +76,25 @@ function LibraryPanes() { case MEDIA3P.id: return ( ); case SHAPES.id: - return ; + return ; case TEXT.id: return ( ); case PAGE_TEMPLATES.id: - return ; + return ; case SHOPPING.id: - return ; + return ; default: return null; } diff --git a/packages/story-editor/src/components/library/test/text/textPane.js b/packages/story-editor/src/components/library/test/text/textPane.js index 2bd4ed069022..8c84a56d7630 100644 --- a/packages/story-editor/src/components/library/test/text/textPane.js +++ b/packages/story-editor/src/components/library/test/text/textPane.js @@ -113,7 +113,8 @@ describe('TextPane', () => { selectedElements: [], story: { globalStoryStyles: { - ...{ colors: [], textStyles: [] }, + colors: [], + textStyles: [], }, currentStoryStyles: { colors: [], diff --git a/packages/story-editor/src/components/panels/design/textStyle/test/stylePresetPanel.js b/packages/story-editor/src/components/panels/design/textStyle/test/stylePresetPanel.js index d66a3104659e..0200d8e609e9 100644 --- a/packages/story-editor/src/components/panels/design/textStyle/test/stylePresetPanel.js +++ b/packages/story-editor/src/components/panels/design/textStyle/test/stylePresetPanel.js @@ -59,7 +59,8 @@ function arrange(extraStylePresets, extraStateProps) { ...extraStateProps, story: { globalStoryStyles: { - ...{ colors: [], textStyles: [] }, + colors: [], + textStyles: [], ...extraStylePresets, }, currentStoryStyles: { diff --git a/packages/story-editor/src/components/panels/design/textStyle/test/textBox.js b/packages/story-editor/src/components/panels/design/textStyle/test/textBox.js index 7babd729bf66..78e42d639637 100644 --- a/packages/story-editor/src/components/panels/design/textStyle/test/textBox.js +++ b/packages/story-editor/src/components/panels/design/textStyle/test/textBox.js @@ -64,7 +64,8 @@ function Wrapper({ children }) { ], story: { globalStoryStyles: { - ...{ colors: [], textStyles: [] }, + colors: [], + textStyles: [], }, currentStoryStyles: { colors: [], diff --git a/packages/story-editor/src/components/panels/design/textStyle/test/textStyle.js b/packages/story-editor/src/components/panels/design/textStyle/test/textStyle.js index dac1210f29ba..96186acb9827 100644 --- a/packages/story-editor/src/components/panels/design/textStyle/test/textStyle.js +++ b/packages/story-editor/src/components/panels/design/textStyle/test/textStyle.js @@ -113,7 +113,8 @@ function Wrapper({ selectedElements, children }) { selectedElements: selectedElements, story: { globalStoryStyles: { - ...{ colors: [], textStyles: [] }, + colors: [], + textStyles: [], }, currentStoryStyles: { colors: [], diff --git a/packages/story-editor/src/components/panels/design/textStyle/utils.js b/packages/story-editor/src/components/panels/design/textStyle/utils.js index 0f5f42aab7ec..ba4a9ecf8205 100644 --- a/packages/story-editor/src/components/panels/design/textStyle/utils.js +++ b/packages/story-editor/src/components/panels/design/textStyle/utils.js @@ -30,7 +30,7 @@ export function applyHiddenPadding(element) { return element?.padding?.hasHiddenPadding ? element.padding : { - ...(element.padding ?? {}), + ...element.padding, hasHiddenPadding: true, ...['vertical', 'horizontal'].reduce((padding, axis) => { padding[axis] = @@ -51,7 +51,7 @@ export function applyHiddenPadding(element) { export function removeHiddenPadding(element) { return element?.padding?.hasHiddenPadding ? { - ...(element.padding ?? {}), + ...element.padding, hasHiddenPadding: false, ...['vertical', 'horizontal'].reduce((padding, axis) => { padding[axis] = diff --git a/webpack.config.test.cjs b/webpack.config.test.cjs index 2df2a6a3264e..350995eeeeac 100644 --- a/webpack.config.test.cjs +++ b/webpack.config.test.cjs @@ -40,15 +40,13 @@ function getConfig(group, { coverage = false } = {}) { output: undefined, mode: 'development', devtool: 'inline-source-map', - plugins: [ - // DependencyExtractionWebpackPlugin and HtmlWebpackPlugin are not needed for tests and - // otherwise has some failures. - ...webpackConfig.plugins.filter( - (plugin) => - !(plugin instanceof DependencyExtractionWebpackPlugin) && - !(plugin instanceof HtmlWebpackPlugin) - ), - ], + // DependencyExtractionWebpackPlugin and HtmlWebpackPlugin are not needed for tests and + // otherwise has some failures. + plugins: webpackConfig.plugins.filter( + (plugin) => + !(plugin instanceof DependencyExtractionWebpackPlugin) && + !(plugin instanceof HtmlWebpackPlugin) + ), }))[0]; if (coverage) { config.module.rules.push({