@@ -501,41 +501,6 @@ function _removeHook(hook: string, projectRoot = process.cwd(), verbose = false)
501
501
log . success ( `Successfully removed the ${ hook } hook` )
502
502
}
503
503
504
- /**
505
- * Runs the staged lint tasks defined in the config file
506
- */
507
- export async function runStagedLint ( hook : string , verbose ?: boolean ) : Promise < boolean > {
508
- const projectRoot = process . cwd ( )
509
- const configFile = config
510
-
511
- if ( ! configFile ) {
512
- console . error ( `[ERROR] No configuration found` )
513
- return false
514
- }
515
-
516
- const isVerbose = Boolean ( verbose ?? VERBOSE )
517
-
518
- // First check for hook-specific configuration
519
- if ( hook in configFile ) {
520
- const hookConfig = configFile [ hook as keyof typeof configFile ]
521
- if ( typeof hookConfig === 'object' && ! Array . isArray ( hookConfig ) ) {
522
- const stagedLintConfig = ( hookConfig as { stagedLint ?: StagedLintConfig ; 'staged-lint' ?: StagedLintConfig } ) . stagedLint ||
523
- ( hookConfig as { stagedLint ?: StagedLintConfig ; 'staged-lint' ?: StagedLintConfig } ) [ 'staged-lint' ]
524
- if ( stagedLintConfig ) {
525
- return processStagedLint ( stagedLintConfig , projectRoot , isVerbose )
526
- }
527
- }
528
- }
529
-
530
- // If no hook-specific configuration, check for global staged-lint
531
- if ( configFile [ 'staged-lint' ] ) {
532
- return processStagedLint ( configFile [ 'staged-lint' ] , projectRoot , isVerbose )
533
- }
534
-
535
- console . error ( `[ERROR] No staged lint configuration found for hook ${ hook } ` )
536
- return false
537
- }
538
-
539
504
/**
540
505
* Validates the config, checks that every git hook or option is named correctly
541
506
*/
@@ -566,7 +531,6 @@ const gitHooks: {
566
531
checkBunGitHooksInDependencies : typeof checkBunGitHooksInDependencies
567
532
getProjectRootDirectoryFromNodeModules : typeof getProjectRootDirectoryFromNodeModules
568
533
getGitProjectRoot : typeof getGitProjectRoot
569
- runStagedLint : typeof runStagedLint
570
534
getStagedFiles : typeof getStagedFiles
571
535
areHooksInstalled : typeof areHooksInstalled
572
536
} = {
@@ -576,7 +540,6 @@ const gitHooks: {
576
540
checkBunGitHooksInDependencies,
577
541
getProjectRootDirectoryFromNodeModules,
578
542
getGitProjectRoot,
579
- runStagedLint,
580
543
getStagedFiles,
581
544
areHooksInstalled
582
545
}
0 commit comments