1- import  *  as  glob  from  '@actions/glob' ; 
2- import  fs  from  'fs' ; 
3- import  path  from  'path' ; 
4- import  *  as  core  from  '@actions/core' ; 
1+ import  *  as  glob  from  '@actions/glob' 
2+ import  fs  from  'fs' 
3+ import  path  from  'path' 
4+ import  *  as  core  from  '@actions/core' 
55
6- import  type  {   ESLintReport   }  from  './types' ; 
6+ import  type  { ESLintReport }  from  './types' 
77
88/** 
99 * Parses a single ESLint report file and returns its contents as a JavaScript object 
@@ -12,28 +12,28 @@ import type { ESLintReport } from './types';
1212 */ 
1313function  parseReportFile ( reportFile : string ) : ESLintReport  { 
1414  try  { 
15-     const  reportPath  =  path . resolve ( reportFile ) ; 
15+     const  reportPath  =  path . resolve ( reportFile ) 
1616
1717    // Check if file exists before trying to read it 
1818    if  ( ! fs . existsSync ( reportPath ) )  { 
19-       throw  new  Error ( `The report-json file "${ reportFile }  ) ; 
19+       throw  new  Error ( `The report-json file "${ reportFile }  ) 
2020    } 
2121
2222    // Read and parse the file in one operation 
23-     const  reportParsed  =  JSON . parse ( fs . readFileSync ( reportPath ,  'utf-8' ) ) ; 
23+     const  reportParsed  =  JSON . parse ( fs . readFileSync ( reportPath ,  'utf-8' ) ) 
2424
2525    // Log success for debugging 
26-     core . debug ( `Successfully parsed report file: ${ reportFile }  ) ; 
26+     core . debug ( `Successfully parsed report file: ${ reportFile }  ) 
2727
28-     return  reportParsed ; 
28+     return  reportParsed 
2929  }  catch  ( error )  { 
3030    // Provide more specific error messages based on error type 
3131    if  ( error  instanceof  SyntaxError )  { 
32-       throw  new  Error ( `Invalid JSON in report file "${ reportFile } ${ error . message }  ) ; 
32+       throw  new  Error ( `Invalid JSON in report file "${ reportFile } ${ error . message }  ) 
3333    }  else  if  ( error  instanceof  Error )  { 
34-       throw  new  Error ( `Error processing "${ reportFile } ${ error . message }  ) ; 
34+       throw  new  Error ( `Error processing "${ reportFile } ${ error . message }  ) 
3535    }  else  { 
36-       throw  new  Error ( `Error parsing the report-json file "${ reportFile }  ) ; 
36+       throw  new  Error ( `Error parsing the report-json file "${ reportFile }  ) 
3737    } 
3838  } 
3939} 
@@ -45,31 +45,31 @@ function parseReportFile(reportFile: string): ESLintReport {
4545 */ 
4646export  default  async  function  eslintJsonReportToJs ( reportFilesGlob : string ) : Promise < ESLintReport >  { 
4747  // Log the start of processing 
48-   core . debug ( `Processing ESLint report files matching pattern: ${ reportFilesGlob }  ) ; 
48+   core . debug ( `Processing ESLint report files matching pattern: ${ reportFilesGlob }  ) 
4949
5050  // Create globber with concurrency to improve performance on large numbers of files 
51-   const  globber  =  await  glob . create ( reportFilesGlob ,  {   matchDirectories : false   } ) ; 
51+   const  globber  =  await  glob . create ( reportFilesGlob ,  { matchDirectories : false } ) 
5252
5353  // Get all matching files 
54-   const  files  =  await  globber . glob ( ) ; 
54+   const  files  =  await  globber . glob ( ) 
5555
56-   const  uniqueFiles  =  [ ...new  Set ( files ) ] ; 
56+   const  uniqueFiles  =  [ ...new  Set ( files ) ] 
5757
5858  // Log number of files found 
59-   core . debug ( `Found ${ files . length }  ) ; 
59+   core . debug ( `Found ${ files . length }  ) 
6060
6161  if  ( uniqueFiles . length  ===  0 )  { 
62-     core . warning ( `No ESLint report files found matching pattern: ${ reportFilesGlob }  ) ; 
63-     return  [ ] ; 
62+     core . warning ( `No ESLint report files found matching pattern: ${ reportFilesGlob }  ) 
63+     return  [ ] 
6464  } 
6565
6666  // Process all files and flatten the results 
6767  // Use Promise.all to process files in parallel if there are multiple 
6868  if  ( uniqueFiles . length  ===  1 )  { 
6969    // Optimize for common case of single file 
70-     return  parseReportFile ( files [ 0 ] ) ; 
70+     return  parseReportFile ( files [ 0 ] ) 
7171  }  else  { 
7272    // Process multiple files in parallel 
73-     return  ( await  Promise . all ( uniqueFiles . map ( parseReportFile ) ) ) . flat ( ) ; 
73+     return  ( await  Promise . all ( uniqueFiles . map ( parseReportFile ) ) ) . flat ( ) 
7474  } 
7575} 
0 commit comments