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 {
startResolution,
finishResolution,
receiveCurrentUser,
} = useDispatch( STORE_NAME );
const { startResolution, finishResolution, receiveCurrentUser } =
useDispatch( STORE_NAME );
if ( shouldHydrate ) {
startResolution( 'getCurrentUser', [] );

View File

@ -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 ]
);

View File

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

View File

@ -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",

View File

@ -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

View File

@ -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.<GitHubLabel>} 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.<GitHubLabel>} projectFields The project fields to update for the issue.
*/