From a8fd8fafa5ed6ee12631b708396510c27741ea8c Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:32:45 -0800 Subject: [PATCH] Applied Linting Fixes --- .../src/user/with-current-user-hydration.tsx | 7 +-- .../src/components/header/header.tsx | 6 +-- .../header-toolbar/header-toolbar.tsx | 3 +- plugins/woocommerce-blocks/package.json | 1 + pnpm-lock.yaml | 25 +++++++++-- .../src/commands/transfer-issues/index.ts | 45 ++++++++++++------- 6 files changed, 56 insertions(+), 31 deletions(-) diff --git a/packages/js/data/src/user/with-current-user-hydration.tsx b/packages/js/data/src/user/with-current-user-hydration.tsx index c03f1a2643f..b39149abd2b 100644 --- a/packages/js/data/src/user/with-current-user-hydration.tsx +++ b/packages/js/data/src/user/with-current-user-hydration.tsx @@ -33,11 +33,8 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) => ); } ); - const { - startResolution, - finishResolution, - receiveCurrentUser, - } = useDispatch( STORE_NAME ); + const { startResolution, finishResolution, receiveCurrentUser } = + useDispatch( STORE_NAME ); if ( shouldHydrate ) { startResolution( 'getCurrentUser', [] ); diff --git a/packages/js/product-editor/src/components/header/header.tsx b/packages/js/product-editor/src/components/header/header.tsx index e77c7ed99ff..1caf3ee2a7c 100644 --- a/packages/js/product-editor/src/components/header/header.tsx +++ b/packages/js/product-editor/src/components/header/header.tsx @@ -46,11 +46,7 @@ export function Header( { const lastPersistedProduct = useSelect( ( select ) => { const { getEntityRecord } = select( 'core' ); - return getEntityRecord( - 'postType', - productType, - productId - ); + return getEntityRecord( 'postType', productType, productId ); }, [ productId ] ); diff --git a/packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx b/packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx index 9d88097614c..22beba83e3e 100644 --- a/packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx +++ b/packages/js/product-editor/src/components/iframe-editor/header-toolbar/header-toolbar.tsx @@ -66,7 +66,8 @@ export function HeaderToolbar( { return { isTextModeEnabled: getEditorMode() === 'text', isInserterEnabled: hasInserterItems( - getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ?? undefined + getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ?? + undefined ), }; }, [] ); diff --git a/plugins/woocommerce-blocks/package.json b/plugins/woocommerce-blocks/package.json index 8b7e7af6525..2ad9fd0e1fb 100644 --- a/plugins/woocommerce-blocks/package.json +++ b/plugins/woocommerce-blocks/package.json @@ -255,6 +255,7 @@ "rtlcss": "^4.1.1", "sass-loader": "10.1.0", "storybook": "^7.6.4", + "stylelint": "^14.16.1", "storybook-addon-react-docgen": "1.2.44", "terser-webpack-plugin": "5.3.6", "typescript": "5.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6955fcab85..135fd098ec8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4336,6 +4336,9 @@ importers: storybook-addon-react-docgen: specifier: 1.2.44 version: 1.2.44(@storybook/addons@7.5.2)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(react@17.0.2) + stylelint: + specifier: ^14.16.1 + version: 14.16.1 terser-webpack-plugin: specifier: 5.3.6 version: 5.3.6(@swc/core@1.3.100)(esbuild@0.18.20)(webpack@5.88.2) @@ -17932,7 +17935,7 @@ packages: resolution: {integrity: sha512-TyM5LfBJxAHwf+MJ21f3ex+xpNtEooMLFazSalfMxyUM2pWNI4eGSptuP3VpSYaQKhlgUOeJAXKOYp3ZKtEiGQ==} dependencies: '@types/react': 17.0.71 - '@types/wordpress__components': 19.10.5(react-dom@17.0.2)(react@17.0.2) + '@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2) '@wordpress/element': 4.4.1 transitivePeerDependencies: - react @@ -17943,6 +17946,7 @@ packages: dependencies: '@types/react': 17.0.71 '@types/tinycolor2': 1.4.6 + '@types/wordpress__components': 23.0.10(react-dom@16.14.0)(react@17.0.2) '@types/wordpress__notices': 3.27.6(react@17.0.2) '@types/wordpress__rich-text': 3.4.6 '@wordpress/element': 4.4.1 @@ -17958,6 +17962,7 @@ packages: dependencies: '@types/react': 17.0.71 '@types/tinycolor2': 1.4.6 + '@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2) '@types/wordpress__notices': 3.27.6(react@17.0.2) '@types/wordpress__rich-text': 3.4.6 '@wordpress/element': 4.4.1 @@ -17967,6 +17972,21 @@ packages: - react - react-dom + /@types/wordpress__components@23.0.10(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==} + dependencies: + '@types/react': 17.0.71 + '@types/tinycolor2': 1.4.6 + '@types/wordpress__notices': 3.27.6(react@17.0.2) + '@types/wordpress__rich-text': 3.4.6 + '@wordpress/element': 5.22.0 + downshift: 6.1.12(react@17.0.2) + re-resizable: 6.9.11(react-dom@16.14.0)(react@17.0.2) + transitivePeerDependencies: + - react + - react-dom + dev: true + /@types/wordpress__components@23.0.10(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==} dependencies: @@ -32107,7 +32127,6 @@ packages: /flow-parser@0.223.3: resolution: {integrity: sha512-9KxxDKSB22ovMpSULbOL/QAQGPN6M0YMS3PubQvB0jVc4W7QP6VhasIVic7MzKcJSh0BAVs4J6SZjoH0lDDNlg==} engines: {node: '>=0.4.0'} - dev: true /flush-write-stream@1.1.1: resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==} @@ -37899,7 +37918,7 @@ packages: '@babel/register': 7.22.15(@babel/core@7.23.5) babel-core: 7.0.0-bridge.0(@babel/core@7.23.5) chalk: 4.1.2 - flow-parser: 0.206.0 + flow-parser: 0.223.3 graceful-fs: 4.2.11 micromatch: 4.0.5 neo-async: 2.6.2 diff --git a/tools/monorepo-merge/src/commands/transfer-issues/index.ts b/tools/monorepo-merge/src/commands/transfer-issues/index.ts index ca275133a91..006a98ecf87 100644 --- a/tools/monorepo-merge/src/commands/transfer-issues/index.ts +++ b/tools/monorepo-merge/src/commands/transfer-issues/index.ts @@ -52,8 +52,7 @@ export default class TransferIssues extends Command { static flags = { destination: Flags.string( { - description: - 'The destination repository to transfer into.', + description: 'The destination repository to transfer into.', default: 'woocommerce/woocommerce', } ), searchFilter: Flags.string( { @@ -80,8 +79,8 @@ export default class TransferIssues extends Command { ); } - const destinationOwner = matches[1]; - const destinationRepo = matches[2]; + const destinationOwner = matches[ 1 ]; + const destinationRepo = matches[ 2 ]; if ( ! args.source.startsWith( destinationOwner + '/' ) ) { this.error( @@ -182,7 +181,7 @@ export default class TransferIssues extends Command { this.log( 'Successfully transferred ' + - transferredIssues + + transferredIssues + '/' + numberOfIssues + ' issues.' @@ -231,13 +230,13 @@ export default class TransferIssues extends Command { * Fetches the node ID of the monorepo from GitHub. * * @param {graphql} authenticatedGraphQL The graphql object for making requests. - * @param {string} destinationOwner The owner of the repository to transfer issues into. - * @param {string} destinationRepo The repository to transfer issues into. + * @param {string} destinationOwner The owner of the repository to transfer issues into. + * @param {string} destinationRepo The repository to transfer issues into. */ private async getMonorepoNodeID( authenticatedGraphQL: typeof graphql, destinationOwner: string, - destinationRepo: string, + destinationRepo: string ): Promise< string > { CliUx.ux.action.start( 'Finding Monorepo' ); @@ -270,7 +269,11 @@ export default class TransferIssues extends Command { if ( err instanceof GraphqlResponseError ) { this.error( - 'Could not find the repository "' + destinationOwner + '/' + destinationRepo + '"' + 'Could not find the repository "' + + destinationOwner + + '/' + + destinationRepo + + '"' ); } @@ -284,8 +287,8 @@ export default class TransferIssues extends Command { * Gets all of the labels we want to add from GitHub. * * @param {graphql} authenticatedGraphQL The graphql object for making requests. - * @param {string} destinationOwner The owner of the repository to transfer issues into. - * @param {string} destinationRepo The repository to transfer issues into. + * @param {string} destinationOwner The owner of the repository to transfer issues into. + * @param {string} destinationRepo The repository to transfer issues into. * @param {Array.} labels The labels we want to add after the transfer. */ private async getLabelsToAdd( @@ -356,7 +359,9 @@ export default class TransferIssues extends Command { for ( const label of addLabels ) { if ( ! allLabels[ label ] ) { this.error( - 'The target repository does not have the label ' + label + '.' + 'The target repository does not have the label ' + + label + + '.' ); } @@ -545,7 +550,9 @@ export default class TransferIssues extends Command { break; case 'NUMBER': - projectField.value = { number: fieldValue.number }; + projectField.value = { + number: fieldValue.number, + }; break; case 'DATE': @@ -553,11 +560,15 @@ export default class TransferIssues extends Command { break; case 'SINGLE_SELECT': - projectField.value = { singleSelectOptionId: fieldValue.optionId }; + projectField.value = { + singleSelectOptionId: fieldValue.optionId, + }; break; case 'ITERATION': - projectField.value = { iterationId: fieldValue.iterationId }; + projectField.value = { + iterationId: fieldValue.iterationId, + }; break; default: @@ -571,7 +582,7 @@ export default class TransferIssues extends Command { issues.push( { id: issue.id, title: issue.title, - projectFields: projectFields + projectFields, } ); } @@ -642,7 +653,7 @@ export default class TransferIssues extends Command { /** * Update the project fields for the issue. - * + * * @param {graphql} authenticatedGraphQL The graphql object for making requests. * @param {Array.} projectFields The project fields to update for the issue. */