Closed Maxim-Filimonov closed 5 years ago
Hey @Maxim-Filimonov I want to ask what benefit you get by using eslint-watch through VS-Code vs just using eslint? Second question, have you tried using the latest version of eslint-watch?
Eslint-watch was meant to be used independently of any tool and most commonly as a cli. That is partially due to it needing to run eslint twice in order to run correctly. So if it was being used in gulp or in this case VSC, I can't think of any benefits you get from it. Eslint-watch is a pretty thin wrapper around eslint so unless you have a good use case I would recommend just using eslint for linting in visual studio code.
Hey @rizowski - here is my use case:
When running package.json scripts in vscode you can set it up to automatically parse any eslint errors and put them in problems section of the ide. Normal eslint integration in VSCode only lints files that you have open not the whole project.
I have a setup with npm start
launching my tests, server, and esw at the same time something like:
start: npm-run-all lint:watch server tests:watch
I would run normal eslint but it does not support watch. I have tried to run it with nodemon and it seems to behave quite strange when run using nodemon, maybe I'm not configuring it correctly.
@Maxim-Filimonov I've rewritten esw in V5. One of the breaking changes is removing all of the custom formatters esw used by default. So now when using esw you will see the standard eslint output with the exception of a clean message. Let me know if this change resolves your issue.
👍 it's all working, with the latest version.
For future ref, my vscode config for lint task which worked for me.
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "lint",
"problemMatcher": [
"$eslint-stylish"
]
}
]
}
Environment
Basic Description of the problem
When used with tools which try to parse eslint errors the tools don't work anymore. Example of such tool eslint-stylish problem matcher from vscode.
Thinking of an option something like --format none to being able to allow native eslint output to be passed through without modification.