Skip to content

Commit

Permalink
Lodash: Remove from lint staged typecheck (#51698)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Jun 20, 2023
1 parent 42039c7 commit f98c5f0
Showing 1 changed file with 8 additions and 7 deletions.
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

0 comments on commit f98c5f0

Please sign in to comment.