jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

Error running rule validateQuoteMarks #2105

Closed ghlk closed 8 years ago

ghlk commented 8 years ago

I get an error only when Error running rule validateQuoteMarks with the _-fix _ flag. When I just run it to see the list of errors, no issue, it reports the issues as expected.

Original Error messages below: This is an issue with JSCS and not your codebase. Please file an issue (with the stack trace below) at: https://github.com/jscs-dev/node-jscs/issues/new TypeError: Cannot read property 'value' of undefined at base.js : 1 |/* --------^ 2 | * Contains all helper functions for the site that have no other home. 3 | /

markelog commented 8 years ago

Can't repo it, would you mind posting your .jscsrc config and give a link to your file or part of it (if you can)?

markelog commented 8 years ago

Okay, ping us up, if you still facing the issue

ghlk commented 8 years ago

Oh no. So sorry Mareklog, I never saw you reply. My apologies. Here is my .jscsrc


{
  "esnext" : true,
  "disallowEmptyBlocks" : true,
  "disallowTrailingWhitespace": true,
  "disallowSpaceBeforeComma": true,
  "disallowMixedSpacesAndTabs" : true,
  "disallowSpaceBeforeComma": true, 
  "disallowSpacesInFunction": {
    "beforeOpeningRoundBrace": true,
    "beforeOpeningCurlyBrace": true
  },
  "requireTrailingComma" : {
    "ignoreSingleLine" : true
  },
  "requireCurlyBraces" : true,
  "requireCamelCaseOrUpperCaseIdentifiers": true,
  "requireParenthesesAroundIIFE": true,
  "requireCommaBeforeLineBreak": true,
  "requireDotNotation": true,
  "requireSpaceAfterComma": true,
  "requireSpacesInForStatement" : true,
  "requireSpaceAfterBinaryOperators" : true,
  "requireMultipleVarDecl": true,
  "requireSemiColons" : true,
  "requireVarDeclFirst": true,
  "validateQuoteMarks" : "'", 
  "maxErrors" : -1
}

I am also seeing issues with "requireSemiColons" rule. I get a line that says "Unsupported rule"

Also, I seem to not see the error with "validateQuoteMarks" when I removed "requireSemiColons" from my .jscsrc.

Hope this helps, and again sorry for the delayed response.

markelog commented 8 years ago

Hm, what version do you use?

ghlk commented 8 years ago

jscs version 2.8.0

Any other info I can give you?

markelog commented 8 years ago

Try to update to 2.9 version

ghlk commented 8 years ago

Breakthrough #1. I realized that I mispelled requireSemicolons as requireSemiColons "requireSemiColons" : true So that error is pebkac. Sorry about that.

Update to 2.9 Upon first run, I got the same "validateQuoteMarks" error. But, I haven't been able to repro that since. I have a suspicion that it has to do with the incorrect spelling of the "requireSemicolons" rule.

Sorry for all that! If I find better repro steps I'll file a new bug. Thank you so much for your time and help.

markelog commented 8 years ago

Okay, thanks