@@ -38,6 +38,7 @@ import {
3838 isNvmInstalled ,
3939 resolveNodeForOxlint ,
4040} from "./utils/resolve-compatible-node.js" ;
41+ import { resolveLintIncludePaths } from "./utils/resolve-lint-include-paths.js" ;
4142import { runKnip } from "./utils/run-knip.js" ;
4243import { runOxlint } from "./utils/run-oxlint.js" ;
4344import { spinner } from "./utils/spinner.js" ;
@@ -425,6 +426,7 @@ const printProjectDetection = (
425426 userConfig : ReactDoctorConfig | null ,
426427 isDiffMode : boolean ,
427428 includePaths : string [ ] ,
429+ lintSourceFileCount ?: number ,
428430) : void => {
429431 const frameworkLabel = formatFrameworkName ( projectInfo . framework ) ;
430432 const languageLabel = projectInfo . hasTypeScript ? "TypeScript" : "JavaScript" ;
@@ -445,7 +447,9 @@ const printProjectDetection = (
445447 if ( isDiffMode ) {
446448 completeStep ( `Scanning ${ highlighter . info ( `${ includePaths . length } ` ) } changed source files.` ) ;
447449 } else {
448- completeStep ( `Found ${ highlighter . info ( `${ projectInfo . sourceFileCount } ` ) } source files.` ) ;
450+ completeStep (
451+ `Found ${ highlighter . info ( `${ lintSourceFileCount ?? projectInfo . sourceFileCount } ` ) } source files.` ,
452+ ) ;
449453 }
450454
451455 if ( userConfig ) {
@@ -470,12 +474,14 @@ export const scan = async (
470474 throw new Error ( "No React dependency found in package.json" ) ;
471475 }
472476
477+ const jsxIncludePaths = computeJsxIncludePaths ( includePaths ) ;
478+ const lintIncludePaths = jsxIncludePaths ?? resolveLintIncludePaths ( directory , userConfig ) ;
479+ const lintSourceFileCount = lintIncludePaths ?. length ?? projectInfo . sourceFileCount ;
480+
473481 if ( ! options . scoreOnly ) {
474- printProjectDetection ( projectInfo , userConfig , isDiffMode , includePaths ) ;
482+ printProjectDetection ( projectInfo , userConfig , isDiffMode , includePaths , lintSourceFileCount ) ;
475483 }
476484
477- const jsxIncludePaths = computeJsxIncludePaths ( includePaths ) ;
478-
479485 let didLintFail = false ;
480486 let didDeadCodeFail = false ;
481487
@@ -491,7 +497,7 @@ export const scan = async (
491497 projectInfo . hasTypeScript ,
492498 projectInfo . framework ,
493499 projectInfo . hasReactCompiler ,
494- jsxIncludePaths ,
500+ lintIncludePaths ,
495501 resolvedNodeBinaryPath ,
496502 ) ;
497503 lintSpinner ?. succeed ( "Running lint checks." ) ;
@@ -594,7 +600,7 @@ export const scan = async (
594600
595601 printDiagnostics ( diagnostics , options . verbose ) ;
596602
597- const displayedSourceFileCount = isDiffMode ? includePaths . length : projectInfo . sourceFileCount ;
603+ const displayedSourceFileCount = isDiffMode ? includePaths . length : lintSourceFileCount ;
598604
599605 printSummary (
600606 diagnostics ,
0 commit comments