diff --git a/.changeset/jolly-rules-train.md b/.changeset/jolly-rules-train.md new file mode 100644 index 000000000..eb56bc90e --- /dev/null +++ b/.changeset/jolly-rules-train.md @@ -0,0 +1,5 @@ +--- +"@flint.fyi/core": patch +--- + +Speed up teardowns. diff --git a/packages/core/src/running/runConfig.ts b/packages/core/src/running/runConfig.ts index 33df1390e..1b6c236fa 100644 --- a/packages/core/src/running/runConfig.ts +++ b/packages/core/src/running/runConfig.ts @@ -90,9 +90,14 @@ async function runRules( ) { const reportsByFilePath = new CachedFactory(() => []); + const promises = []; for (const [rule, filesAndOptions] of rulesFilesAndOptionsByRule) { - const ruleReportsByFilePath = await runLintRule(rule, filesAndOptions); + const ruleReportsByFilePath = runLintRule(rule, filesAndOptions); + promises.push(ruleReportsByFilePath); + } + const rulesResults = await Promise.all(promises); + for (const ruleReportsByFilePath of rulesResults) { for (const [filePath, ruleReports] of ruleReportsByFilePath) { reportsByFilePath.get(filePath).push(...ruleReports); }