jshint/fixmyjs

Comments in .jshintrc

Closed this issue · 1 comments

My .jshintrc has comments in it, which although I don't think 100% valid in JSON files is handled well by jshint.

The comments are there to help new developers tweak the config file, however it looks like they're breaking fixmyjs:

For the below file I get:

Running "fixmyjs:files" (fixmyjs) task
Warning: Unable to parse ".jshintrc" file (Unexpected token /). Use --force to continue.

Aborted due to warnings.
{
    // Enforcing options   
    "laxbreak"      : false,  // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
    "bitwise"       : true,   // Prohibit bitwise operators (&, |, ^, etc.).
    "camelcase"     : false,  // Force all variable names to use either camelCase style or UPPER_CASE with underscores.
    "curly"         : true,   // Require {} for every new block or scope.
    "eqeqeq"        : false,  // Require triple equals i.e. `===`.
    "freeze"        : true,   // Prohibits overwriting prototypes of native objects
    "forin"         : true,   // Requires all for in loops to filter object's items
    "immed"         : true,   // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
    "latedef"       : false,  // Prohipit variable use before definition.
    "loopfunc"      : false,  // Allow functions to be defined within loops.
    "maxdepth"      : 5,      // How nested do you want your blocks to be:
    "maxstatements" : 50,     // Max number of statements allowed per function
    "maxlen"        : 128,    // Maximum length of a line.
    "maxparams"     : 5,      // Max number of formal parameters allowed per function
    "noarg"         : true,   // Prohibit use of `arguments.caller` and `arguments.callee`.
    "nonbsp"        : true,   // Warns about "non-breaking whitespace" characters
    "regexp"        : true,   // Prohibit `.` and `[^...]` in regular expressions.
    "regexdash"     : false,  // Tolerate unescaped last dash i.e. `[-...]`.
    "scripturl"     : true,   // Tolerate script-targeted URLs.
    "shadow"        : false,  // Allows re-define variables later in code e.g. `var x=1; x=2;`.
    "supernew"      : false,  // Tolerate `new function () { ... };` and `new Object;`.
    "undef"         : true,   // Require all non-global variables be declared before they are used.

    // Relaxing options (suppress)
    "asi"           : false,  // Tolerate Automatic Semicolon Insertion (no semicolons).
    "boss"          : false,  // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
    "eqnull"        : false,  // Tolerate use of `== null`.
    "evil"          : false,  // Tolerate use of `eval`.
    "expr"          : false,  // Tolerate `ExpressionStatement` as Programs.
    "funcscope"     : false,  // Suppresses warnings about declaring variables inside of control structures
    "iterator"      : false,  // Suppresses warnings about the __iterator__ property. 

    "newcap"        : true,   // Require capitalization of all constructor functions e.g. `new F()`.
    "noempty"       : false,  // Prohibit use of empty blocks.
    "nonew"         : true,   // Prohibit use of constructors for side-effects.
    "nomen"         : true,   // Prohibit use of initial or trailing underbars in names.
    "onevar"        : false,  // Allow only one `var` statement per function.
    "plusplus"      : false,  // Prohibit use of `++` & `--`.
    "quotmark"      : false,   // Enforces the consistency of quotation marks used throughout code
    "unused"        : true,   // Warns when you define and never use your variables.
    "sub"           : false,  // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
    "trailing"      : true,   // Prohibit trailing whitespaces.
    "white"         : false,  // Check against strict whitespace and indentation rules.
    "indent"        : 2       // Specify indentation spacing
}

My mistake, it looks like the issue is with https://github.com/jonschlinkert/grunt-fixmyjs/.
For anyone with the same issue see: jonschlinkert/grunt-fixmyjs#10