Remove lint-staged.config.js

This commit is contained in:
Chi-Hsuan Huang 2022-03-30 16:39:32 +08:00
parent 7e146cf353
commit 01edee8d90
1 changed files with 0 additions and 47 deletions

View File

@ -1,47 +0,0 @@
module.exports = {
'*.scss': [ 'pnpm run lint:css-fix' ],
'client/**/*.(t|j)s?(x)': [
'wp-scripts format-js',
'wp-scripts lint-js',
'pnpm run test-staged',
],
'packages/**/*.(t|j)s?(x)': ( packageFiles ) => {
const globalScripts = [
`wp-scripts format-js ${ packageFiles.join( ' ' ) }`,
`wp-scripts lint-js ${ packageFiles.join( ' ' ) }`,
];
const filesByPackage = packageFiles.reduce(
( packages, packageFile ) => {
const packageNameMatch = packageFile.match(
/\/packages\/([a-z0-9\-]+)\//
);
if ( ! packageNameMatch ) {
return packages;
}
const packageName = packageNameMatch[ 1 ];
if ( Array.isArray( packages[ packageName ] ) ) {
packages[ packageName ].push( packageFile );
} else {
packages[ packageName ] = [ packageFile ];
}
return packages;
},
{}
);
const workspaceScripts = Object.keys( filesByPackage ).map(
( packageName ) =>
`pnpm --filter @woocommerce/${ packageName } run test-staged -- ${ filesByPackage[
packageName
].join( ' ' ) }`
);
return globalScripts.concat( workspaceScripts );
},
'*.php': [ 'php -d display_errors=1 -l', 'composer run-script phpcs' ],
};