Skip to content

Commit

Permalink
fix: lintFiles() to await on ESLint.outputFixes() (#318)
Browse files Browse the repository at this point in the history
This ensures that fixes are written before resolving.

Without this, the file may be in a weird state if consumed right after calling lintFiles() (e.g. reading the files right after calling lintFiles() would return an empty string, stat would show a zero-sized file).
  • Loading branch information
fskreuz committed Jan 15, 2023
1 parent 21e212c commit 12c96e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class StandardEngine {
const result = await eslintInstance.lintFiles(files)

if (eslintConfig.fix) {
this.eslint.ESLint.outputFixes(result)
await this.eslint.ESLint.outputFixes(result)
}

return result
Expand Down

0 comments on commit 12c96e5

Please sign in to comment.