File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
tools/eslint-formatter-multiple-formats/src/lib Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11import type { ESLint } from 'eslint' ;
22import { mkdirSync , writeFileSync } from 'node:fs' ;
33import path from 'node:path' ;
4+ import { stringifyError } from '@code-pushup/utils' ;
45import type { EslintFormat , FormatterConfig } from './types.js' ;
56
67// Import the stylish formatter - using require, otherwise there is the wrong typing
@@ -28,10 +29,10 @@ export function findConfigFromEnv(
2829
2930 try {
3031 return JSON . parse ( configString ) as FormatterConfig ;
31- } catch ( error_ ) {
32+ } catch ( error ) {
3233 console . error (
3334 'Error parsing ESLINT_FORMATTER_CONFIG environment variable:' ,
34- ( error_ as Error ) . message ,
35+ stringifyError ( error ) ,
3536 ) ;
3637 return null ;
3738 }
@@ -89,9 +90,12 @@ export function persistEslintReport(
8990 console . info ( `ESLint report (${ format } ) written to: ${ outputDir } ` ) ;
9091 }
9192 return true ;
92- } catch ( error_ ) {
93+ } catch ( error ) {
9394 if ( verbose ) {
94- console . error ( 'There was a problem writing the output file:\n%s' , error_ ) ;
95+ console . error (
96+ 'There was a problem writing the output file:\n%s' ,
97+ stringifyError ( error ) ,
98+ ) ;
9599 }
96100 return false ;
97101 }
You can’t perform that action at this time.
0 commit comments