I'm doing a PoC of NPM as a build tool (http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/). I'm fairly new using NPM. For now, I only have JSHint and Mocha installed. My packagae.json is attached. Now, when I run "npm run lint" in the command line (Windows 7), it gives me an error:
c:\project>npm run list
[email protected] lint c:\project
jshint test/*.js
ERROR: Can't open test/*.js
It works when I change the script "lint": "jshint test/test.js".
Can I use glob with jshint?
Please advise and thank you in advanced.
In addition to using configuration files you can configure JSHint from within your files using special comments. These comments start with a label such as jshint or globals (complete list below) and are followed by a comma-separated list of values.
So, implementing glob on all input naively would change OSX/Linux behavior in a way that makes it less precise: it would no longer be able to specify files that globs without expanding them as globs. Very interested in if anyone has solutions here, of can write documentation for people to use Windows glob patterns to dodge this problem. …
Sometimes JSHint doesn't have an appropriate option that disables some particular warning. In this case you can use jshint directive to disable warnings by their code. Let's say that you have a file that was created by combining multiple different files into one:
Place your file into the project root directory and, as long as you run JSHint from anywhere within your project directory tree, the same configuration file will be used. Configuration file is a simple JSON file that specifies which JSHint options to turn on or off.
You shouldn't need the glob, just give it the directory and it will scan all js files in there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With