Open ericelliott opened 9 years ago
I usually do not add these things since I started using webpack and eslint-loader, but here it makes sense
You don't need es-lint watch.
npm install --save-dev watch
"scripts": {
"watch": "watch 'npm run -s lint && npm test -s' test/ examples/"
},
The -s
in these prevents npm from scrolling the errors off the screen with the giant npm error message of doom.
In this way you:
eslint-watch runs over only changed files in contrast
That may not be a big deal on such a tiny project as cf-package, but still it makes sense not to burn more cpu then you actually need at the moment :)
Will these detect/run for new files also? One annoyance of gulp.watch is that it only watches anything that was present at the time the task was initialized.
Yeah, that's what I want for small modules. On our app scaffold, it's probably better to plug into webpack's watch feature.
Will these detect/run for new files also?
Yes.
I almost always use a watch task to create a dedicated dev console that simply monitors for file changes and reruns unit tests. That way I always have lint and unit test results on the screen while I'm developing.
On save, the task should:
Avoid any time-consuming activity. This should act like a realtime status monitor.