0

I am using grunt-contrib-jshint and it finds the following error in my JS file:

line 5   col 70  Expected a conditional expression and instead saw an assignment.

I know the reason of this error, but all I want is to disable it. Looking here it looks like I can either use no-cond-assign to 0 in my jshintrc or by adding -W084 : true in my options.

The problem is that the first solution ended up in a corrupted jshintrc and the second one does not solve the problem. Another option is to add -W022 : true (which solution I found in the comments) also does not work.

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753

1 Answers1

1

Use the ignore pragma to skip this line:

/* jshint ignore:start */
if(this = Infinity)
/* jshint ignore:end */
  {
  return;
  }
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265