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).
What is the purpose of this pull request? (put an "X" next to item)
Added await to this.eslint.ESLint.outputFixes(result) to ensure the fixed files are written before lintFiles() returns.
Under the hood, ESLint.outputFixes() is an async function that awaits on a promisified fs.writeFile().
Which issue (if any) does this pull request address?
None.
Is there anything you'd like reviewers to focus on?
Cross-platform testing. Issue may be OS-dependent because it deals with the filesystem. This issue happened on a Windows machine, I cannot verify on other platforms.
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 callinglintFiles()
would return an empty string, stat would show a zero-sized file).What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update [x] Bug fix [ ] New feature [ ] Other, please explain:
What changes did you make? (Give an overview)
Added
await
tothis.eslint.ESLint.outputFixes(result)
to ensure the fixed files are written beforelintFiles()
returns.Under the hood,
ESLint.outputFixes()
is an async function that awaits on a promisifiedfs.writeFile()
.Which issue (if any) does this pull request address?
None.
Is there anything you'd like reviewers to focus on?
Cross-platform testing. Issue may be OS-dependent because it deals with the filesystem. This issue happened on a Windows machine, I cannot verify on other platforms.