Live data from Hacker News

JSHint: An Community Driven Fork of JSLint

badassjs.com

11–20 of 30 posts

Re: JSHint: An Community Driven Fork of JSLint

#11
post #10

According to the JSHint website it is "an open-source project that is supported and maintained by the JavaScript developer community.". However, the license still contains the following clause: "The Software shall be used for Good, not Evil." So it is not using an OSI approved license, and a such I would not consider it open source. That clause adds a restriction on how you can use the software, and a very vague rest…

Since it is a fork, we can't just change the original license. If there is somebody who is willing to explain if I legally can change the original license, I would be happy to do it. We consulted a couple of people and all of them suggested to keep the original in place. :(

Re: JSHint: An Community Driven Fork of JSLint

#12
post #10

According to the JSHint website it is "an open-source project that is supported and maintained by the JavaScript developer community.". However, the license still contains the following clause: "The Software shall be used for Good, not Evil." So it is not using an OSI approved license, and a such I would not consider it open source. That clause adds a restriction on how you can use the software, and a very vague rest…

I bet IP lawyers everywhere are rubbing their hands in glee at the prospect of enforcing that license.

Re: JSHint: An Community Driven Fork of JSLint

#13
post #6

Earlier quoted context omitted.

Is there any reference for the reasoning behind error-ing on the standard for loop?

It's concerned about the declaration of i within the loop's first term. Since JavaScript only has function-level scope, that variable leaks into the broader context, which can lead to unexpected behavior.

Not if you actually, you know, know what you're doing. This dumbing down of programming does not work--if you have clueless people working on code, it'll end up broken, no matter how many tool-enforced 'best practices' they follow.

Re: JSHint: An Community Driven Fork of JSLint

#15
post #8

Earlier quoted context omitted.

I think Crockford is right about that error. Declaration of variables in the loop could lead to this type of error: http://cam.ly/blog/2011/01/javascript-interview-question/ (All of the 4 will do alert('4') when clicked, when the programmer expects alert('1'), alert('2'), etc.) If the variable had been declared at the top, that error probably would not happen.

That error would have happened despite if the var was declared at the top or in the loop addEventListener("stuff", function() { return function(index) { alert(index); } }(i); is the fix, either way

Yeah. I meant that the mistake is less likely to have been made in the first place.

Re: JSHint: An Community Driven Fork of JSLint

#16
post #7

One thing I hated about jslint is that it would exit after catching a few "errors" too many, even if the errors were not actually syntactically incorrect. it's basically impossible to use if you're using jslint over large js projects that you don't own (I rarely go into someone else's js library to fix all of jslint's complaints!) I'm guessing Crockford's code is extremely pristine, or that he's never used anyone els…

The default is 50 but you can tweak this value with maxerr option. So, to increase the number of errors before it stops up to a thousand do this:

  /*jshint maxerr:1000 */
I should probably add it to the docs on jshint.com.

Re: JSHint: An Community Driven Fork of JSLint

#18
post #13
post #6

Earlier quoted context omitted.

It's concerned about the declaration of i within the loop's first term. Since JavaScript only has function-level scope, that variable leaks into the broader context, which can lead to unexpected behavior.

Not if you actually, you know, know what you're doing. This dumbing down of programming does not work--if you have clueless people working on code, it'll end up broken, no matter how many tool-enforced 'best practices' they follow.

I can't see why people not liking the defaults (which are great for beginners) can't change their settings.

Re: JSHint: An Community Driven Fork of JSLint

#19
Douglas Crockford might be opinionated - and Anton Kovalyov and Paul Irish are fantastic fellows - but a fork of JSLint reminds me of the South Park premise: if you allow one episode to be censored then you in the end everything will have grounds for censorship... the fork looks all dandy now - as long as "the community" doesn't end up having too much say in the matter. It's a pretty dang big community we've got now ;)
Post reply on HN