what to do about jslint?

Justin Obara obara.justin at gmail.com
Wed Feb 9 22:40:16 UTC 2011

You may recall from a past dev meeting Michelle mentioning that jslint no longer has any tolerance for var's in for loops.

For instance this would no longer be acceptable.

for (var i = 0; i < 5; i++) {
	//do something five times

The biggest problem that this poses to us is that, jslint does not allow you to scan past it, and provides no means of ignoring it.

We still need to lint our code though. Here are some options we have.

1) Fork ( https://github.com/douglascrockford/JSLint ). Make the necessary changes and send a pull request.

2) Move the var out of the for loop and place it just above. 

	var = i;
	for (i = 0; i < 5; i++) {
		// do something five times

3) we could also take up the practice of moving all of the var's to the top of every function

I'm curious to know what everyone's thoughts are on these, or if there are other options that we have as well.


More information about the fluid-work mailing list