Closed bpugh closed 5 years ago
Hi @bpugh and thanks for the feedback!
This is something I've been meaning to implement sometime soon. It is even listed in the CHANGELOG.md. However It is not as easy to implement as one would think, having to replace the text in the buffer and not mess up Visual Studio features can prove quite difficult.
But since this now has been requested I'll have to take a look, wont I? 😄 I'll keep this issue open and update here when I've reached a conclusion!
It would be really useful...
I saw in another extension "Format document On Save" that it allows setting a command after saving file, but I was not able to use the eslint on that.
Any news on implementing this feature?
As @giolvani said, the Format Document On Save
extension allows you to specify a VS Command to be run on save. So, if it makes it simpler to implement, VisualLinter
might only need to expose a VS Command for running ESLint on the active file.
There is a workaround for doing this now, but it's not pretty. It involves configuring a custom VS Command via "External Tools" -- something like this:
cmd.exe /c node $(ProjectDir)/node_modules/eslint/bin/eslint.js $(ItemPath) --fix
Then you can have Format Document On Save
target that VS Command.
It would be much nicer if VisualLinter
registered a command to that effect in VS.
Sorry everyone; but the development of this extension has been suspended. You can read more about it here: https://github.com/jwldnr/VisualLinter#deprecated
Installed product versions
Description
The eslint extension for VS Code has an option to run eslint with the
--fix
parameter on save which will automatically fix any fixable issues in the current file. If this is feasible to implement it would be really nice to have this option in VisualLinter. Thoughts?Thanks for the great extension!