jscs-dev/grunt-jscs

requireVarDeclFirst error when comment in function expression

galvarez421 opened this issue · 4 comments

Rule: requireVarDeclFirst: true
Code that will make grunt-jscs exhibit the issue:

var test = function() {
  var color = "grey";
  // This is a comment
};
var test2 = "string";

The task will report an error for the line with the second assignment, but if I remove the comment in the function expression, the error goes away.

Using grunt-jscs version 2.5.0
Operating system: Windows 7 64-bit

You should report this to JSCS core instead.

Will do! I wasn't actually sure if it is an issue with the core or the Grunt task specifically, so I figured I'd start with the narrowest option.

OK, if you can reproduce this with JSCS itself, let me know, so we can close this one!

If you don't, then it's definitely a issue with the Grunt plugin 😕

Yes, I am able to reproduce it in JSCS itself! Thanks for the prompt replies.