JSHint & BBEdit
try tell application "BBEdit" set mydoc to file of (document 1 of window 1) end tell set posixPath to POSIX path of mydoc if (posixPath ends with ".js" or posixPath ends with ".json") then set cmd to "/usr/local/bin/node /usr/local/bin/jshint " & (quoted form of POSIX path of mydoc) & " | /usr/local/bin/bbresults -e --pattern '(?P<file>.+?):\\sline\\s(?P<line>\\d+),\\scol\\s((?P<col>\\d+),)?\\s+(?P<msg>.*)$'" do shell script cmd end if on error beep end try
Save the script in
~/Library/Application Support/BBEdit/Scripts (and you’ll probably want to assign a keyboard shortcut via the Scripts palette, too).