ESLint-Formatter icon indicating copy to clipboard operation
ESLint-Formatter copied to clipboard

run script on temp file

Open kufii opened this issue 6 years ago • 5 comments

Previously it would only run on the saved file, meaning if you ran it and had unsaved changes, those changes would be lost. This copies the text to a temp file, runs eslint --fix on that, and returns the results

kufii avatar Mar 06 '18 21:03 kufii

This would cause ESLint to be running on the file from tmp, right? Since eslint configs can be set using overrides, this could cause files to be linted with the wrong configuration since it might no longer match the correct glob, right?

TheSavior avatar Mar 06 '18 22:03 TheSavior

oh yeah good point, give me a bit

kufii avatar Mar 07 '18 01:03 kufii

Ok check it now, fixed the issue

kufii avatar Mar 07 '18 03:03 kufii

Hey, any updates or comments on this PR?

kufii avatar Apr 16 '18 18:04 kufii

It seems to me like there's a risk that the eslint configuration will ignore certain patterns of files, and that it's difficult to guarantee that the temporary file created will match that pattern. What do you think about fixing this via #34 instead?

skeggse avatar May 19 '20 22:05 skeggse