Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lodash: Remove from lint staged typecheck #51698

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions bin/packages/lint-staged-typecheck.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
const _ = require( 'lodash' );
const path = require( 'path' );
const fs = require( 'fs' );
const execa = require( 'execa' );
Expand All @@ -18,12 +17,14 @@ const tscPath = path.join( repoRoot, 'node_modules', '.bin', 'tsc' );
const changedFiles = process.argv.slice( 2 );

// Transform changed files to package directories containing tsconfig.json.
const changedPackages = _.uniq(
changedFiles.map( ( fullPath ) => {
const relativePath = path.relative( repoRoot, fullPath );
return path.join( ...relativePath.split( path.sep ).slice( 0, 2 ) );
} )
).filter( ( packageRoot ) =>
const changedPackages = [
...new Set(
changedFiles.map( ( fullPath ) => {
const relativePath = path.relative( repoRoot, fullPath );
return path.join( ...relativePath.split( path.sep ).slice( 0, 2 ) );
} )
),
].filter( ( packageRoot ) =>
fs.existsSync( path.join( packageRoot, 'tsconfig.json' ) )
);

Expand Down