How do I install JSLint on Ubuntu?
Here are the instructions I followed to have jslint working on Ubuntu 10.10/Vim 7.3 (and Mac OS X).
EDIT
So, I've just spotted a mistake in the given link. Here are the correct steps (assuming you have already downloaded and unpacked the archive to your desktop:
$ cd /path/to/jsl-0.3.0/src
$ make -f Makefile.ref
$ cp Linux_All_DBG.OBJ/jsl /usr/local/bin/jsl
At that point you can open a new terminal window and type $ jsl
to display a quick help or invoke it from Vim or directly on a file in the terminal.
END EDIT
/usr/local/bin
is not your "PATH", it's only one of the many directories that can be part yourPATH
environment variable.$ echo $PATH
will tell you what these directories are and thus where you can put thejsl
executable. You can also put it in another place and add an alias to your.bashrc
.Why do you expect to be able to run
jslint
fromrhino
?
Install JSL or JSlint with Node/Npm on Ubuntu
Have you tried install nodeJS from the website, that will also install npm. Once both are installed, you may simply run npm install jslint
.
How to install JsHint for Rhino and vim on ubuntu 11.10
It would be more easier to use node/npm to install jshint:
- grab nave from github
sudo nave usemain latest
- npm install jshint
How to do JSLint in Vim
You can follow the intructions from JSLint web-service + VIM integration or do what I did:
Download http://jslint.webvm.net/mylintrun.js and http://www.jslint.com/fulljslint.js
and put them in a directory of your choice.
Then add the following line to the beginning of mylintrun.js:
var filename= arguments[0];
and change last line of code in mylintrun.js ("print( ...)") to:
print ( filename + ":" + (obj["line"] + 1) + ":" + (obj["character"] + 1) + ":" + obj["reason"] );
This makes in mylintrun.js output a error list that can be used with the VIM quickfix window (:copen).
Now set the following in VIM:
set makeprg=cat\ %\ \\\|\ /my/path/to/js\ /my/path/to/mylintrun.js\ %
set errorformat=%f:%l:%c:%m
where you have to change /my/path/to/js to the path to SpiderMonkey and /my/path/to/mylintrun.js to the path where you put the JS files.
Now, you can use :make in VIM and use the quickfix window (:he quickfix-window) to jump from error to error.
Visual Studio Code Error - Failed to load jshint library
You'll need to follow the prompt and install jshint.
For just the workspace
npm install jshint
or
For all your workspaces
npm install -g jshint
Related Topics
Indexof Method in an Object Array
Evaluating a String as a Mathematical Expression in JavaScript
JavaScript - Track Mouse Position
Read :Hover Pseudo Class with JavaScript
Html5 Video - Percentage Loaded
How to Use JavaScript Conditionally Like CSS3 Media Queries, Orientation
How to Get the Youtube Video Id from a Url
I'Ve Heard Global Variables Are Bad, What Alternative Solution Should I Use
Typeerror: $(...).Modal Is Not a Function with Bootstrap Modal
Clientheight/Clientwidth Returning Different Values on Different Browsers
Converting an Object to a String
What's the Right Way to Decode a String That Has Special HTML Entities in It
How to Determine If JavaScript Array Contains an Object With an Attribute That Equals a Given Value