JSHint Inline
JSHint HTML files or other files that contains script tags. Requires node.js
Details
Installs
- Total 5K
- Win 2K
- Mac 2K
- Linux 716
| Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
JSHint-Inline
Sublime Text extension to apply jshint to HTML files or other files containing <script> tags.
Prerequisites: NodeJS in your PATH, and jshint
Install Node
Just click on the install button on http://nodejs.org
Add nodejs to your PATH
NodeJS Installer should add itself to your path variable. On Windows, restart your system or add it manually: SET PATH=C:\Program Files\Nodejs;%PATH%
Just add it to Sublime using WBond's Package Manager.
To set the Build System and run JSHint-Inline, use the shortcut, ⌃ + ⇧ + J
or… choose Tools > Build System > JSHint-Inline and hit ⌘ + B or ⌃ + B to check all script tags on your HTML file.
JSHint Options
They are located on a variable options. Default:
{
"browser": true,
"globalstrict": true,
"smarttabs": true,
"debug": true,
"strict": true,
"unused": true,
"undef": true,
"curly": true
}
You can override it using JSHint comments like /*global jQuery, console */ or /* jshint -W007, node */
To find your options file, you can open Package Manager with ⌘ + ⇧ + P or ⌃ + ⇧ + P and type Pack. Select Preferences: Browse Packages. Or Go to menu Preferences > Browse Packages. Go to JSHint-Inline. The file is there.
Test file
I've included a file called test.html with 2 script tags just for testing. You can open a terminal and run node jshinline test.html or open it with Sublime and run the build.
Questions, doubts, comments? Raise an issue
Extra Notes
To have the nice success (✓) and error (✗) signs on Sublime's console, you need a font that supports it. If you're on a mac, no problem. For Windows I recommend DejaVu Sans Mono
Run JSHint on save
Install SublimeOnSaveBuild