Created
May 28, 2015 20:18
-
-
Save lorenzoongithub/ab80cb31fd77ba277d48 to your computer and use it in GitHub Desktop.
jshint.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// http://jshint.com - a JavaScript Code Quality Tool | |
// | |
load('https://cdnjs.cloudflare.com/ajax/libs/jshint/2.7.0/jshint.js'); | |
JSHINT('var a=0;'); | |
if (JSHINT.errors.length != 0) throw ''; | |
JSHINT('var a=0'); | |
if (JSHINT.errors.length != 1) throw ''; | |
if (JSHINT.errors[0].raw !== 'Missing semicolon.') throw ''; | |
JSHINT('function f() { }'); | |
if (JSHINT.errors.length != 0) throw ''; | |
JSHINT('function f() { ; }'); | |
if (JSHINT.errors.length != 1) throw ''; | |
if (JSHINT.errors[0].raw !== 'Unnecessary semicolon.') throw ''; | |
JSHINT('broken'); | |
if (JSHINT.errors[0].raw !== 'Expected an assignment or function call and instead saw an expression.') throw ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment