- When you go to the jsLint site you have an area to enter your code and a settings area with a lot of check boxes.
Here are the steps to using jsLint.
Access the site at http://www.jslint.com/
- Add the function list to the Global variables box.
- Set the checkboxes in the settings area.
- Copy and paste your code into the top text area.
- Click on the button labelled jsLint.
- Fix errors and issues that jsLint finds.
- When you no longer get an errors box then you are done!
- Here are the settings that match our course coding standards.
- Add this string to the Global Variables box. This is a time when you should copy and paste.
- Select checkboxes so that your settings look like this:
Entering Your Code¶
- After you change the setting then copy your code from your editor and paste it into the large text area at the top. Press
Ctl-Aand copy the entire
.jsfile. This way the line numbers of error messages will match your code.
- Then click on the jsLint button.
- Here's what this looks like:
- When you click the jsLint button you will a list of errors in your code.
- After fixing your errors, click the jsLint button again.
- Just keep fixing your code until the error list goes away.
- Lab02: jsLint