@@ -501,41 +501,6 @@ function _removeHook(hook: string, projectRoot = process.cwd(), verbose = false)
501501 log . success ( `Successfully removed the ${ hook } hook` )
502502}
503503
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-
539504/**
540505 * Validates the config, checks that every git hook or option is named correctly
541506 */
@@ -566,7 +531,6 @@ const gitHooks: {
566531 checkBunGitHooksInDependencies : typeof checkBunGitHooksInDependencies
567532 getProjectRootDirectoryFromNodeModules : typeof getProjectRootDirectoryFromNodeModules
568533 getGitProjectRoot : typeof getGitProjectRoot
569- runStagedLint : typeof runStagedLint
570534 getStagedFiles : typeof getStagedFiles
571535 areHooksInstalled : typeof areHooksInstalled
572536} = {
@@ -576,7 +540,6 @@ const gitHooks: {
576540 checkBunGitHooksInDependencies,
577541 getProjectRootDirectoryFromNodeModules,
578542 getGitProjectRoot,
579- runStagedLint,
580543 getStagedFiles,
581544 areHooksInstalled
582545}
0 commit comments