This repository was archived by the owner on Aug 15, 2023. It is now read-only.
-
Couldn't load subscription status.
- Fork 4
Linting
Mike Bowen edited this page Aug 29, 2014
·
3 revisions
- Understand the error! - Search for your error and look for the result on http://jslinterrors.com/. You'll find great detail about why there is an error reported and how you can fix it.
- It is possible to supress errors using the /jshint/ syntax, BUT Do not suppress errors unless CR'd by Analyst - Supression is is bad practice unless there is a very good reason. Sometimes though, there are errors that are produced by odd use of a plugin and suppression can be justified.
this is optional but recommended
In order to show lint errors directly in your editor while you type, you should install a sublime package called sublime linter See Here. This plugin will look at our HPI lint settings .jshintrc and properly replicate all the jshint errors we wish to see and suppress those we have deemed safe to ignore.
Prereqs:
- Sublime Text 3
- Package Control https://sublime.wbond.net/installation
- JSHint on your path
npm install -g jshint
Installation:
- Open Sublime 3
-
Ctrl-Shift-P(to open context menu) and type to autocompletepackage control install package - When prompted find
SublimeLinterand install -
Ctrl-Shift-Pagain and installSublimeLinter-jshint - Restart Sublime Text and Load a file with a lintable error in it!
- It is possible at this point that the linter is running whenever you save a file, or perhaps at build time, but if not, you can run the jshint task at any time to see all issues in hpi.
- At command prompt run the following: `grunt jshint --project=[your project]
- You should see output detailing all issues. Fix them!
- If you would like to run the jshint reporting in order to list all problems in a printer friendly format:
- Run:
grunt --no-color jshint:report --project=[your project] - The file should be output as jshintReport.txt in the code/ folder
OpenContent Management Suite (OCMS) © Technology Services Group