Created
July 12, 2012 20:05
-
-
Save munro/3100600 to your computer and use it in GitHub Desktop.
JSHint is bad
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
/*jshint undef: false */ | |
var hello = 123, | |
world = 3421; | |
foo = 321, | |
bar = 421; | |
// passes! |
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
var hello = 123, | |
world = 3421, | |
foo = 321, | |
bar = 421; |
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
var hello = 123, | |
world = 3421; | |
window.foo = 321, | |
window.bar = 421; |
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
/*jslint undef: true */ | |
var hello = 123, | |
world = 3421; | |
foo = 421; | |
/** | |
* Fails: | |
* Expected 'foo' at column 1, not column 5. | |
* foo = 421; | |
*/ |
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
Aw yea! I thought
undef
existed in JSLint, but I didn't find it after looking for a second. I have to manipulate the example a bit, because JSLint doesn't allow,
in statements. But anyways, this is where JSLint is superior, because indentation leads to certain expectations. Though, expectations are subjective. ;)