File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -530,6 +530,11 @@ class ESLint {
530
530
throw new Error ( "'results' must be an array" ) ;
531
531
}
532
532
533
+ const retryCodes = new Set ( [ "ENFILE" , "EMFILE" ] ) ;
534
+ const retrier = new Retrier ( error => retryCodes . has ( error . code ) , {
535
+ concurrency : 100 ,
536
+ } ) ;
537
+
533
538
await Promise . all (
534
539
results
535
540
. filter ( result => {
@@ -541,7 +546,9 @@ class ESLint {
541
546
path . isAbsolute ( result . filePath )
542
547
) ;
543
548
} )
544
- . map ( r => fs . writeFile ( r . filePath , r . output ) ) ,
549
+ . map ( r =>
550
+ retrier . retry ( ( ) => fs . writeFile ( r . filePath , r . output ) ) ,
551
+ ) ,
545
552
) ;
546
553
}
547
554
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
rules : {
3
- "no-unused-vars " : "error"
3
+ "capitalized-comments " : "error"
4
4
}
5
5
} ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ function generateFiles() {
63
63
64
64
for ( let i = 0 ; i < FILE_COUNT ; i ++ ) {
65
65
const fileName = `file_${ i } .js` ;
66
- const fileContent = `// This is file ${ i } ` ;
66
+ const fileContent = `// this is file ${ i } ` ;
67
67
68
68
fs . writeFileSync ( `${ OUTPUT_DIRECTORY } /${ fileName } ` , fileContent ) ;
69
69
}
@@ -97,7 +97,7 @@ generateFiles();
97
97
98
98
console . log ( "Running ESLint..." ) ;
99
99
execSync (
100
- `node bin/eslint.js ${ OUTPUT_DIRECTORY } -c ${ CONFIG_DIRECTORY } /eslint.config.js` ,
100
+ `node bin/eslint.js ${ OUTPUT_DIRECTORY } -c ${ CONFIG_DIRECTORY } /eslint.config.js --fix ` ,
101
101
{ stdio : "inherit" } ,
102
102
) ;
103
103
console . log ( "✅ No errors encountered running ESLint." ) ;
You can’t perform that action at this time.
0 commit comments