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 {
530530 throw new Error ( "'results' must be an array" ) ;
531531 }
532532
533+ const retryCodes = new Set ( [ "ENFILE" , "EMFILE" ] ) ;
534+ const retrier = new Retrier ( error => retryCodes . has ( error . code ) , {
535+ concurrency : 100 ,
536+ } ) ;
537+
533538 await Promise . all (
534539 results
535540 . filter ( result => {
@@ -541,7 +546,9 @@ class ESLint {
541546 path . isAbsolute ( result . filePath )
542547 ) ;
543548 } )
544- . map ( r => fs . writeFile ( r . filePath , r . output ) ) ,
549+ . map ( r =>
550+ retrier . retry ( ( ) => fs . writeFile ( r . filePath , r . output ) ) ,
551+ ) ,
545552 ) ;
546553 }
547554
Original file line number Diff line number Diff line change 11module . exports = {
22 rules : {
3- "no-unused-vars " : "error"
3+ "capitalized-comments " : "error"
44 }
55} ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ function generateFiles() {
6363
6464 for ( let i = 0 ; i < FILE_COUNT ; i ++ ) {
6565 const fileName = `file_${ i } .js` ;
66- const fileContent = `// This is file ${ i } ` ;
66+ const fileContent = `// this is file ${ i } ` ;
6767
6868 fs . writeFileSync ( `${ OUTPUT_DIRECTORY } /${ fileName } ` , fileContent ) ;
6969 }
@@ -97,7 +97,7 @@ generateFiles();
9797
9898console . log ( "Running ESLint..." ) ;
9999execSync (
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 ` ,
101101 { stdio : "inherit" } ,
102102) ;
103103console . log ( "✅ No errors encountered running ESLint." ) ;
You can’t perform that action at this time.
0 commit comments