Let shebang (#!) with "node" imply "node:true" #1255

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

Rob--W commented Sep 5, 2013

It felt a bit redundant to have two lines of boilerplate for build scripts:

#!/usr/bin/env node
/* jshint node:true */

With this PR, "#! .... node ..." implies jshint node:true

Contributor

stephenmathieson commented Sep 20, 2013

+1

can we also check for the shebang?

if (lines[0].substr(0, 3) === '#!/' && lines[0].indexOf('node') !== -1) {
  // ...
}

currently, this will pass:

alert('this is not a node script')

which isn't a node script.

Owner

Rob--W replied Sep 20, 2013

The previous line does already check whether the line starts with #!.

hahaha my bad

Owner

valueof commented Oct 8, 2013

Merged in 0f4bf4e. Forgot to add issue number in the message. :-\

valueof closed this Oct 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment