vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Add --watch option to linting #4151

Open jsodeman opened 5 years ago

jsodeman commented 5 years ago

What problem does this feature solve?

Currently if you are running the development server in an integration with another server, like in a .Net Core SPA project, then the linting errors aren't easy to view. By being able to run "vue-cli-service lint" with a watch option you would be able to keep open a separate terminal window while developing to see just linting issues.

What does the proposed API look like?

Adding an entry to package.json for "lint:watch": "vue-cli-service lint --watch" and add necessary modifications to the CLI plugins to support watching the default linted directories.

LinusBorg commented 5 years ago

Note: eslint doesn't support --watch on its own. There are other packages that seem to make this work, but it would have to be evaluated how well we an integrate such a 3rd party solution into the current setup.

dsseng commented 5 years ago

@LinusBorg we can just create a Webpack instance with https://github.com/webpack-contrib/eslint-loader plugged in.

noobling commented 4 years ago

gg