Closed agundermann closed 10 years ago
Was about to copy from https://github.com/spenceralger/gulp-jshint :smile:
@Dashed that's pretty much what this is :smile: @sokra I see, I'll see what I can do tomorrow. The goal is to also keep a sync option for the loader, right?
@taurose Yes sync and async mode would be nice... For webpack a async mode is important for performance reasons. sync mode is nice to have.
Sadly, I wasn't able to make RcLoader work with proper error handling in async mode. I believe this is due to a bug in RcFinder. I've noticed that other jshint packages use findup-sync to locate the jshintrc file. So I tried using findup which also works asynchronously. This seems to work, but makes the code more verbose and lacks integrated caching. So now I'm unsure about the best approach here. Wait for RcFinder fix, try to work around the bug, or use findup with or without additional caching? Or perhaps I'm overcomplicating things :smile: ?
Updated the commit now that RcLoader is fixed.
okey looks fine. Just one minor thing: we must tell webpack about what files we read from fs. It is explained here: http://webpack.github.io/docs/how-to-write-a-loader.html#mark-dependencies
Just call this.addDependency
for the .jshintrc
file.
and move jshint to peerDependencies
and change it to the ^2.5.0
notation.
@sokra Anything else needed for this PR?
merged... there was a little bug. It didn't look into the current directory (rcloader expects a filename not a directory name). I fixed it. Published as 0.8.0
...
Thanks for your good work...
Thanks <3.
Awesome. Glad I could contribute :smile:
@sokra, It doesn't work for me in v1.12.13. It only works if I include the .jshintrc as json in the webpack config.
How is the usage for the .jshintrc
file? I'm just asking because this is not documented
@luizfilipe seems like a PR opportunity :)
Solution for #6