Applied Linting Fixes

This commit is contained in:
Christopher Allford 2023-12-09 23:32:45 -08:00
parent 9bc3e97bbf
commit a8fd8fafa5
6 changed files with 56 additions and 31 deletions

View File

@ -33,11 +33,8 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) =>
); );
} ); } );
const { const { startResolution, finishResolution, receiveCurrentUser } =
startResolution, useDispatch( STORE_NAME );
finishResolution,
receiveCurrentUser,
} = useDispatch( STORE_NAME );
if ( shouldHydrate ) { if ( shouldHydrate ) {
startResolution( 'getCurrentUser', [] ); startResolution( 'getCurrentUser', [] );

View File

@ -46,11 +46,7 @@ export function Header( {
const lastPersistedProduct = useSelect( const lastPersistedProduct = useSelect(
( select ) => { ( select ) => {
const { getEntityRecord } = select( 'core' ); const { getEntityRecord } = select( 'core' );
return getEntityRecord( return getEntityRecord( 'postType', productType, productId );
'postType',
productType,
productId
);
}, },
[ productId ] [ productId ]
); );

View File

@ -66,7 +66,8 @@ export function HeaderToolbar( {
return { return {
isTextModeEnabled: getEditorMode() === 'text', isTextModeEnabled: getEditorMode() === 'text',
isInserterEnabled: hasInserterItems( isInserterEnabled: hasInserterItems(
getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ?? undefined getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ??
undefined
), ),
}; };
}, [] ); }, [] );

View File

@ -255,6 +255,7 @@
"rtlcss": "^4.1.1", "rtlcss": "^4.1.1",
"sass-loader": "10.1.0", "sass-loader": "10.1.0",
"storybook": "^7.6.4", "storybook": "^7.6.4",
"stylelint": "^14.16.1",
"storybook-addon-react-docgen": "1.2.44", "storybook-addon-react-docgen": "1.2.44",
"terser-webpack-plugin": "5.3.6", "terser-webpack-plugin": "5.3.6",
"typescript": "5.3.2", "typescript": "5.3.2",

View File

@ -4336,6 +4336,9 @@ importers:
storybook-addon-react-docgen: storybook-addon-react-docgen:
specifier: 1.2.44 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) 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: terser-webpack-plugin:
specifier: 5.3.6 specifier: 5.3.6
version: 5.3.6(@swc/core@1.3.100)(esbuild@0.18.20)(webpack@5.88.2) 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==} resolution: {integrity: sha512-TyM5LfBJxAHwf+MJ21f3ex+xpNtEooMLFazSalfMxyUM2pWNI4eGSptuP3VpSYaQKhlgUOeJAXKOYp3ZKtEiGQ==}
dependencies: dependencies:
'@types/react': 17.0.71 '@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 '@wordpress/element': 4.4.1
transitivePeerDependencies: transitivePeerDependencies:
- react - react
@ -17943,6 +17946,7 @@ packages:
dependencies: dependencies:
'@types/react': 17.0.71 '@types/react': 17.0.71
'@types/tinycolor2': 1.4.6 '@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__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 3.4.6 '@types/wordpress__rich-text': 3.4.6
'@wordpress/element': 4.4.1 '@wordpress/element': 4.4.1
@ -17958,6 +17962,7 @@ packages:
dependencies: dependencies:
'@types/react': 17.0.71 '@types/react': 17.0.71
'@types/tinycolor2': 1.4.6 '@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__notices': 3.27.6(react@17.0.2)
'@types/wordpress__rich-text': 3.4.6 '@types/wordpress__rich-text': 3.4.6
'@wordpress/element': 4.4.1 '@wordpress/element': 4.4.1
@ -17967,6 +17972,21 @@ packages:
- react - react
- react-dom - 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): /@types/wordpress__components@23.0.10(react-dom@17.0.2)(react@17.0.2):
resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==} resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==}
dependencies: dependencies:
@ -32107,7 +32127,6 @@ packages:
/flow-parser@0.223.3: /flow-parser@0.223.3:
resolution: {integrity: sha512-9KxxDKSB22ovMpSULbOL/QAQGPN6M0YMS3PubQvB0jVc4W7QP6VhasIVic7MzKcJSh0BAVs4J6SZjoH0lDDNlg==} resolution: {integrity: sha512-9KxxDKSB22ovMpSULbOL/QAQGPN6M0YMS3PubQvB0jVc4W7QP6VhasIVic7MzKcJSh0BAVs4J6SZjoH0lDDNlg==}
engines: {node: '>=0.4.0'} engines: {node: '>=0.4.0'}
dev: true
/flush-write-stream@1.1.1: /flush-write-stream@1.1.1:
resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==} resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==}
@ -37899,7 +37918,7 @@ packages:
'@babel/register': 7.22.15(@babel/core@7.23.5) '@babel/register': 7.22.15(@babel/core@7.23.5)
babel-core: 7.0.0-bridge.0(@babel/core@7.23.5) babel-core: 7.0.0-bridge.0(@babel/core@7.23.5)
chalk: 4.1.2 chalk: 4.1.2
flow-parser: 0.206.0 flow-parser: 0.223.3
graceful-fs: 4.2.11 graceful-fs: 4.2.11
micromatch: 4.0.5 micromatch: 4.0.5
neo-async: 2.6.2 neo-async: 2.6.2

View File

@ -52,8 +52,7 @@ export default class TransferIssues extends Command {
static flags = { static flags = {
destination: Flags.string( { destination: Flags.string( {
description: description: 'The destination repository to transfer into.',
'The destination repository to transfer into.',
default: 'woocommerce/woocommerce', default: 'woocommerce/woocommerce',
} ), } ),
searchFilter: Flags.string( { searchFilter: Flags.string( {
@ -80,8 +79,8 @@ export default class TransferIssues extends Command {
); );
} }
const destinationOwner = matches[1]; const destinationOwner = matches[ 1 ];
const destinationRepo = matches[2]; const destinationRepo = matches[ 2 ];
if ( ! args.source.startsWith( destinationOwner + '/' ) ) { if ( ! args.source.startsWith( destinationOwner + '/' ) ) {
this.error( this.error(
@ -182,7 +181,7 @@ export default class TransferIssues extends Command {
this.log( this.log(
'Successfully transferred ' + 'Successfully transferred ' +
transferredIssues + transferredIssues +
'/' + '/' +
numberOfIssues + numberOfIssues +
' issues.' ' issues.'
@ -231,13 +230,13 @@ export default class TransferIssues extends Command {
* Fetches the node ID of the monorepo from GitHub. * Fetches the node ID of the monorepo from GitHub.
* *
* @param {graphql} authenticatedGraphQL The graphql object for making requests. * @param {graphql} authenticatedGraphQL The graphql object for making requests.
* @param {string} destinationOwner The owner of 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 {string} destinationRepo The repository to transfer issues into.
*/ */
private async getMonorepoNodeID( private async getMonorepoNodeID(
authenticatedGraphQL: typeof graphql, authenticatedGraphQL: typeof graphql,
destinationOwner: string, destinationOwner: string,
destinationRepo: string, destinationRepo: string
): Promise< string > { ): Promise< string > {
CliUx.ux.action.start( 'Finding Monorepo' ); CliUx.ux.action.start( 'Finding Monorepo' );
@ -270,7 +269,11 @@ export default class TransferIssues extends Command {
if ( err instanceof GraphqlResponseError ) { if ( err instanceof GraphqlResponseError ) {
this.error( 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. * Gets all of the labels we want to add from GitHub.
* *
* @param {graphql} authenticatedGraphQL The graphql object for making requests. * @param {graphql} authenticatedGraphQL The graphql object for making requests.
* @param {string} destinationOwner The owner of 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 {string} destinationRepo The repository to transfer issues into.
* @param {Array.<GitHubLabel>} labels The labels we want to add after the transfer. * @param {Array.<GitHubLabel>} labels The labels we want to add after the transfer.
*/ */
private async getLabelsToAdd( private async getLabelsToAdd(
@ -356,7 +359,9 @@ export default class TransferIssues extends Command {
for ( const label of addLabels ) { for ( const label of addLabels ) {
if ( ! allLabels[ label ] ) { if ( ! allLabels[ label ] ) {
this.error( 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; break;
case 'NUMBER': case 'NUMBER':
projectField.value = { number: fieldValue.number }; projectField.value = {
number: fieldValue.number,
};
break; break;
case 'DATE': case 'DATE':
@ -553,11 +560,15 @@ export default class TransferIssues extends Command {
break; break;
case 'SINGLE_SELECT': case 'SINGLE_SELECT':
projectField.value = { singleSelectOptionId: fieldValue.optionId }; projectField.value = {
singleSelectOptionId: fieldValue.optionId,
};
break; break;
case 'ITERATION': case 'ITERATION':
projectField.value = { iterationId: fieldValue.iterationId }; projectField.value = {
iterationId: fieldValue.iterationId,
};
break; break;
default: default:
@ -571,7 +582,7 @@ export default class TransferIssues extends Command {
issues.push( { issues.push( {
id: issue.id, id: issue.id,
title: issue.title, title: issue.title,
projectFields: projectFields projectFields,
} ); } );
} }