Question

Some of the code I am working on dictates the the syntax of various variables and since I want to have JSHint check for camel case in the rest of the file, I'm ignoring it for a single line as follows:

grant_type: 'password' // jshint ignore:line

However, using this approach which came from another StackOverflow question fails both in IntelliJ IDEA (13.1.1) and when performing a grunt jshint with errors similar to the following:

[L128:C0] W106: Identifier 'grant_type' is not in camel case.
?          grant_type: 'password'  // jshint ignore:line
[L128:C45] E001: Bad option: 'ignore'.
          grant_type: 'password'  // jshint ignore:line

What should be done to correct this issue in both of the environments?

Was it helpful?

Solution

Update grunt-contrib-jshint to 0.10.0

https://github.com/gruntjs/grunt-contrib-jshint/issues/122

OTHER TIPS

While not a prefect solution as we still haven't figured out why the ignore:line syntax isn't work, we have instead replaced the code with the following directive which disables the CamelCase check and re-enables it once the relevant block of code has been passed,

/* jshint camelcase:false */
grant_type: 'password'
/* jshint camelcase:true */
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top