Skip to content

Instantly share code, notes, and snippets.

@jsatk
Created March 25, 2013 23:42
Show Gist options
  • Save jsatk/5241937 to your computer and use it in GitHub Desktop.
Save jsatk/5241937 to your computer and use it in GitHub Desktop.
# JS Lint
# Reference: http://blog.simplytestable.com/installing-jslint-for-command-line-use-on-ubuntu/
function jslint {
filename=${1##*/} # Name of file.
dir="/Users/Jesse/Desktop/" # Directory where you want your lint files output. Must be full path. No ~.
path="$dir$filename-lint.js"
/usr/local/bin/node /usr/share/node-jslint/node_modules/jslint/bin/jslint.js "$1" > "$path"
}
@jsatk
Copy link
Author

jsatk commented Mar 25, 2013

Follow the instructions on how to install command line JS Line here. After you've installed add this function to your .bash_profile. Please note that you need to change dir to be your own username. ~ is not supported. Secondly make sure line 7 is properly pointed to your local installation of node. Mine lives in /usr/local/bin/ rather than /usr/bin/.

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