Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use GLOB with JSHint in Windows?

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.

like image 256
flexapp Avatar asked Mar 17 '15 00:03

flexapp


People also ask

How do I configure JSHint from within a file?

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.

What would happen if Windows Glob was implemented on all input?

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. …

How to disable JSHint warnings by their code?

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:

How do I run JSHint from the root directory?

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.


1 Answers

You shouldn't need the glob, just give it the directory and it will scan all js files in there.

like image 95
IBam Avatar answered Oct 05 '22 22:10

IBam