Open jamesarosen opened 11 years ago
I investigated this a bit more. The issue is that the require shim is minified with uglifyjs
, which produces compact output but that output does not comply with the coding standards that jshint
wants. I'm putting in a commit later on that provides more control over the require implementation to use; if you want the shim to pass jshint, you can use the unminified version once that option is in.
The latter issue would require gluejs to run code analysis on the files to detect that they are not using require
/ exports
; that's a bit too much work for a fairly low-value improvement.
Running JSHint v2.0.1 results in the following violations in the definition of
require
:Additionally, if the
unused
flag is set and any module doesn't require another module (is a leaf node in the dependency tree), the follow violations also occur:The alternative is to run JSHint on the inputs to gluejs and just assume that gluejs doesn't cause any problems. I like the extra assurance of being able to run JSHint on the file I'm actually delivering to the client, though.