Skip to content

Instantly share code, notes, and snippets.

@munro
Created July 12, 2012 20:05
Show Gist options
  • Save munro/3100600 to your computer and use it in GitHub Desktop.
Save munro/3100600 to your computer and use it in GitHub Desktop.
JSHint is bad
/*jshint undef: false */
var hello = 123,
world = 3421;
foo = 321,
bar = 421;
// passes!
var hello = 123,
world = 3421,
foo = 321,
bar = 421;
var hello = 123,
world = 3421;
window.foo = 321,
window.bar = 421;
/*jslint undef: true */
var hello = 123,
world = 3421;
foo = 421;
/**
* Fails:
* Expected 'foo' at column 1, not column 5.
* foo = 421;
*/
@munro
Copy link
Author

munro commented Jul 13, 2012

I actually was typing "To be fair, JSLint has this option ...", but I couldn't find it after looking at their site for a second. But you found it! 'Cause somebody on the internet is wrong, dammit! Also, your comment about expectations leads to some interesting concepts on why I believe JSLint to be superior to JSHint and CoffeeScript when it comes to writing quality JavaScript code. I'll distill my thoughts in a blog post later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment