I am currently validating my JavaScript against JSLint and making progress on, it's assisting me to write better JavaScript - in particular in working with the Jquery library.  I have now come across JSHint, a fork of JSLint. So I am wondering f...
The following JS:  (function() {   "use strict";    $("#target").click(function(){     console.log("clicked");   });  }());   Yields:  test.js: line 5, col 3, '$' is not defined.   When linted using JSHint 0.5.5.  Any...
In my project we have some global variables that work as containers:  MyProject.MyFreature.someFunction = function() { ... }   So then I use that script across the site and JSLint / JSHint complains about that:     'MyProject' is not defined...
I'm using Gulp in my small project in order to run tests and lint my code. When any of those tasks fail, Gulp always exits with return code 0. If I run jshint by hand, it exits with non-zero code as it should.  Here's my very simple gulpfile....
I'm using JSHint, and it got the following error:  Script URL.   Which I noticed that happened because on this particular line there is a string containing a javascript:... URL.  I know that JSHint complained that because the scripturl option is...
I am playing around with the Facebook's react.js library. I am trying to use their JSX syntax which describes creating a view in the following way.  /** @jsx React.DOM */ var HelloMessage = React.createClass({   render: function() {     return &l...
JavaScript programs can be checked for errors in IDEs or using online web apps but I'm looking for a way to detect syntax errors alone.  I've tried JSLint and JSHint and looked at their options but I haven't been able to find a combinatio...
I really like aligning the ? and the : of my ternary operator when they don't fit on a line, like this:  var myVar = (condition     ? ifTrue     : ifFalse );   However, JSHint complains with:     Bad line breaking before '?'   Why would J...
I have an object with arrays as values.  people = {     'steve':['foo','bar'],     'joe':['baz','boo'] }   For each key, I would like to loop over the values in the corresponding array. Simple enough:...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.