Skip to content

Commit 4f05195

Browse files
committed
Limit concurrency of linting
Trying to work around #599
1 parent eefd88a commit 4f05195

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {isEqual} from 'lodash-es';
55
import micromatch from 'micromatch';
66
import arrify from 'arrify';
77
import slash from 'slash';
8+
import pMap from 'p-map';
89
import {
910
parseOptions,
1011
getIgnores,
@@ -80,9 +81,8 @@ const lintFile = async (filePath, options) => runEslint(
8081
const lintFiles = async (patterns, options) => {
8182
const files = await globFiles(patterns, options);
8283

83-
const reports = await Promise.all(
84-
files.map(filePath => lintFile(filePath, options)),
85-
);
84+
// TODO: Try to increase the concurrency in the future with some more testing.
85+
const reports = await pMap(files, filePath => lintFile(filePath, options), {concurrency: 1});
8686

8787
const report = mergeReports(reports.filter(({isIgnored}) => !isIgnored));
8888

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"meow": "^10.1.1",
8585
"micromatch": "^4.0.4",
8686
"open-editor": "^3.0.0",
87+
"p-map": "^4.0.0",
8788
"prettier": "^2.4.1",
8889
"semver": "^7.3.5",
8990
"slash": "^4.0.0",

0 commit comments

Comments
 (0)