Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kienstra committed Jun 15, 2023
1 parent f5fcdcf commit 48ae649
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion wp-modules/editor/js/src/utils/stripIllegalChars.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function stripIllegalChars( toConvert: string ) {
return toConvert.replace( /[^-\w]/g, '' )
return toConvert.replace( /[^-\w]/g, '' );
}
4 changes: 1 addition & 3 deletions wp-modules/editor/js/src/utils/toKebabCase.ts
Original file line number Diff line number Diff line change
@@ -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();
}

0 comments on commit 48ae649

Please sign in to comment.