File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
packages/react-doctor/src Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,24 @@ export const diagnose = async (
3535 throw new Error ( "No React dependency found in package.json" ) ;
3636 }
3737
38- const emptyDiagnostics = ( ) : Diagnostic [ ] => [ ] ;
39-
4038 const lintPromise = lint
4139 ? runOxlint (
4240 resolvedDirectory ,
4341 projectInfo . hasTypeScript ,
4442 projectInfo . framework ,
4543 projectInfo . hasReactCompiler ,
46- ) . catch ( emptyDiagnostics )
47- : Promise . resolve ( emptyDiagnostics ( ) ) ;
44+ ) . catch ( ( error : unknown ) => {
45+ console . error ( "Lint failed:" , error ) ;
46+ return [ ] as Diagnostic [ ] ;
47+ } )
48+ : Promise . resolve ( [ ] as Diagnostic [ ] ) ;
4849
4950 const deadCodePromise = deadCode
50- ? runKnip ( resolvedDirectory ) . catch ( emptyDiagnostics )
51- : Promise . resolve ( emptyDiagnostics ( ) ) ;
51+ ? runKnip ( resolvedDirectory ) . catch ( ( error : unknown ) => {
52+ console . error ( "Dead code analysis failed:" , error ) ;
53+ return [ ] as Diagnostic [ ] ;
54+ } )
55+ : Promise . resolve ( [ ] as Diagnostic [ ] ) ;
5256
5357 const [ lintDiagnostics , deadCodeDiagnostics ] = await Promise . all ( [ lintPromise , deadCodePromise ] ) ;
5458 const diagnostics = [
You can’t perform that action at this time.
0 commit comments