Disable warning about undefined functions

13 views
Skip to first unread message

Andreas Hoffmann

unread,
Feb 3, 2015, 5:46:33 AM2/3/15
to jsh...@googlegroups.com
Hi,

is there any chance to have an additional option implemented?
Let's have a look at the following code:

function foo(){
  "use strict";
  var a = [];
  for (var i=0;i<10;i++) {  }
  var a = [];
  for (var i = 0; i<10; i++) {  }
}

Two warnings are coming up:
1.) "a is already defined"
2.) "i is already defined"

Is there any chance to get an option that treats var-declarations with "blockscope", like in Java or C#?

IMO, the duplicate declaration of "i" is perfectly fine and even good coding style. Moving the index-variables to the top of methods would just reduce readability without gaining anything.

I know the details about variable declaration in javascript, but that does not mean that I like them :-)

Any chance, this might get implemented?

Regards
Andreas



Andreas Hoffmann

unread,
Feb 3, 2015, 5:50:20 AM2/3/15
to jsh...@googlegroups.com
Sorry, topic is totally wrong!

Please do not respond here, but in https://groups.google.com/forum/#!topic/jshint/AOjXYCdVTB8

Somehow google remembered the topic of a discarded post and I forgot to fix it.
Reply all
Reply to author
Forward
0 new messages