From 48ae649dd598fb26807ff19d652a8a30b6ffe094 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Thu, 15 Jun 2023 16:01:58 -0600 Subject: [PATCH] Fix linting errors --- .../editor/js/src/components/SidebarPanels/TitlePanel.tsx | 5 ++++- wp-modules/editor/js/src/utils/stripIllegalChars.ts | 2 +- wp-modules/editor/js/src/utils/toKebabCase.ts | 4 +--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-modules/editor/js/src/components/SidebarPanels/TitlePanel.tsx b/wp-modules/editor/js/src/components/SidebarPanels/TitlePanel.tsx index 47a846f3..51c26f86 100644 --- a/wp-modules/editor/js/src/components/SidebarPanels/TitlePanel.tsx +++ b/wp-modules/editor/js/src/components/SidebarPanels/TitlePanel.tsx @@ -48,7 +48,10 @@ export default function TitlePanel( { value={ title } onChange={ ( newTitle: typeof title ) => { editPost( { title: newTitle } ); - handleChange( 'name', toKebabCase( stripIllegalChars( newTitle ) ) ); + handleChange( + 'name', + toKebabCase( stripIllegalChars( newTitle ) ) + ); if ( ! newTitle ) { lockPostSaving(); diff --git a/wp-modules/editor/js/src/utils/stripIllegalChars.ts b/wp-modules/editor/js/src/utils/stripIllegalChars.ts index 59bfbd2e..4160127b 100644 --- a/wp-modules/editor/js/src/utils/stripIllegalChars.ts +++ b/wp-modules/editor/js/src/utils/stripIllegalChars.ts @@ -1,3 +1,3 @@ export default function stripIllegalChars( toConvert: string ) { - return toConvert.replace( /[^-\w]/g, '' ) + return toConvert.replace( /[^-\w]/g, '' ); } diff --git a/wp-modules/editor/js/src/utils/toKebabCase.ts b/wp-modules/editor/js/src/utils/toKebabCase.ts index 0c380493..6b99a1c7 100644 --- a/wp-modules/editor/js/src/utils/toKebabCase.ts +++ b/wp-modules/editor/js/src/utils/toKebabCase.ts @@ -1,6 +1,4 @@ /** Converts a string to a kebab-case. */ export default function toKebabCase( toConvert = '' ) { - return toConvert - .replace( /[_\W]+(?=\w+)/g, '-' ) - .toLowerCase(); + return toConvert.replace( /[_\W]+(?=\w+)/g, '-' ).toLowerCase(); }