@@ -16,7 +16,7 @@ async function runESLint({
1616 fix : boolean ;
1717 configPath ?: string ;
1818 explicitGlobs ?: string [ ] ;
19- } ) {
19+ } ) : Promise < boolean > {
2020 const dirname = path . dirname ( url . fileURLToPath ( import . meta. url ) ) ;
2121 const defaultConfigPath = path . resolve ( dirname , './configs/js.js' ) ;
2222
@@ -33,8 +33,7 @@ async function runESLint({
3333 ignorePatterns : [ ] , // Trust caller entirely
3434 } ) ;
3535
36- await lintAndReport ( eslint , explicitGlobs , fix ) ;
37- return ;
36+ return await lintAndReport ( eslint , explicitGlobs , fix ) ;
3837 }
3938
4039 // PATH B – default behaviour (tsconfig + matrix config)
@@ -63,10 +62,14 @@ async function runESLint({
6362 ignorePatterns : ignorePats ,
6463 } ) ;
6564
66- await lintAndReport ( eslint , patterns , fix ) ;
65+ return await lintAndReport ( eslint , patterns , fix ) ;
6766}
6867
69- async function lintAndReport ( eslint : ESLint , patterns : string [ ] , fix : boolean ) {
68+ async function lintAndReport (
69+ eslint : ESLint ,
70+ patterns : string [ ] ,
71+ fix : boolean ,
72+ ) : Promise < boolean > {
7073 const results = await eslint . lintFiles ( patterns ) ;
7174
7275 if ( fix ) {
@@ -75,6 +78,9 @@ async function lintAndReport(eslint: ESLint, patterns: string[], fix: boolean) {
7578
7679 const formatter = await eslint . loadFormatter ( 'stylish' ) ;
7780 console . log ( formatter . format ( results ) ) ;
81+ const hasErrors = results . some ( ( r ) => r . errorCount > 0 ) ;
82+
83+ return hasErrors ;
7884}
7985/* eslint-enable no-console */
8086
0 commit comments