madskristensen / WebEssentials2013

Visual Studio extension
http://vswebessentials.com
Other
944 stars 252 forks source link

Change default jscs rules disable validation #1780

Open vmariano opened 9 years ago

vmariano commented 9 years ago

Hi, i'm using WE 2013 u4.

I have an issue on jscs validation, when i change some of the default rules, he stop valiate the whole rules.

When I change

"requireSpacesInFunctionDeclaration": {
        "beforeOpeningRoundBrace": false, //here i change true for false.
        "beforeOpeningCurlyBrace": true
    }

The full rules are:

{
    "disallowCommaBeforeLineBreak": null,
    "disallowDanglingUnderscores": true,
    "disallowEmptyBlocks": true,
    "disallowImplicitTypeConversion": [ "string" ],
    "disallowKeywordsOnNewLine": [ "else" ],
    "disallowKeywords": [ "with" ],
    "disallowMixedSpacesAndTabs": true,
    "disallowMultipleLineBreaks": true,
    "disallowMultipleLineStrings": true,
    "disallowMultipleVarDecl": null,
    "disallowPaddingNewlinesInBlocks": null,
    "disallowQuotedKeysInObjects": true,
    "disallowSpaceAfterBinaryOperators": true,
    "disallowSpaceAfterKeywords": [ "for", "while", "do", "switch" ],
    "disallowSpaceAfterLineComment": true,
    "disallowSpaceAfterObjectKeys": null,
    "disallowSpaceAfterPrefixUnaryOperators": true,
    "disallowSpaceBeforeBinaryOperators": null,
    "disallowSpaceBeforeBlockStatements": null,
    "disallowSpaceBeforePostfixUnaryOperators": true,
    "disallowSpacesInAnonymousFunctionExpression": {
        "beforeOpeningCurlyBrace": true
    },
    "disallowSpacesInConditionalExpression": null,
    "disallowSpacesInFunctionDeclaration": null,
    "disallowSpacesInFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInNamedFunctionExpression": null,
    "disallowSpacesInsideArrayBrackets": null,
    "disallowSpacesInsideObjectBrackets": null,
    "disallowSpacesInsideParentheses": null,
    "disallowTrailingComma": null,
    "disallowTrailingWhitespace": true,
    "disallowYodaConditions": true,
    "maximumLineLength": 120,
    "requireAlignedObjectValues": "skipWithFunction",
    "requireBlocksOnNewline": true,
    "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
    "requireCapitalizedConstructors": true,
    "requireCommaBeforeLineBreak": true,
    "requireCurlyBraces": [ "else", "for", "while", "do", "try", "catch" ],
    "requireDotNotation": true,
    "requireKeywordsOnNewLine": null,
    "requireLineFeedAtFileEnd": true,
    "requireMultipleVarDecl": true,
    "requireOperatorBeforeLineBreak": true,
    "requirePaddingNewlinesInBlocks": true,
    "requireParenthesesAroundIIFE": true,
    "requireSpaceAfterBinaryOperators": null,
    "requireSpaceAfterKeywords": [ "if", "else", "return", "try", "catch" ],
    "requireSpaceAfterLineComment": null,
    "requireSpaceAfterObjectKeys": true,
    "requireSpaceAfterPrefixUnaryOperators": null,
    "requireSpaceBeforeBinaryOperators": true,
    "requireSpaceBeforeBlockStatements": true,
    "requireSpaceBeforePostfixUnaryOperators": null,
    "requireSpacesInAnonymousFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "requireSpacesInConditionalExpression": true,
    "requireSpacesInFunctionDeclaration": {
        "beforeOpeningRoundBrace": false,
        "beforeOpeningCurlyBrace": true
    },
    "requireSpacesInFunctionExpression": {
        "beforeOpeningCurlyBrace": true
    },
    "requireSpacesInNamedFunctionExpression": {
        "beforeOpeningRoundBrace": true,
        "beforeOpeningCurlyBrace": true
    },
    "requireSpacesInsideArrayBrackets": "all",
    "requireSpacesInsideObjectBrackets": "allButNested",
    "requireSpacesInsideParentheses":  "all",
    "requireTrailingComma": true,
    "safeContextKeyword": true,
    "validateIndentation": 4,
    "validateJSDoc": {
        "checkParamNames": true,
        "requireParamTypes": true
    },
    "validateLineBreaks": "CRLF",
    "validateQuoteMarks": true
}
RJCuthbertson commented 9 years ago

I have the same problem. After you change any rule in the .jscsrc settings file, attempting to run JSCS results in these messages:

6/11/2015 12:38:24 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:38:24 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:38:24 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:38:24 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:38:24 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:09 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:09 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:09 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:09 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:09 PM: JSON Schema: Couldn't parse System.String[] as a valid regex. 6/11/2015 12:41:19 PM: JSON Schema: Couldn't parse System.String[] as a valid regex.

That error is coming from https://github.com/madskristensen/WebEssentials2013/blob/master/EditorExtensions/JSON/Schemas/SchemaExporter.cs in the method public string GetSchemaFor(string fileLocation)

markvp commented 9 years ago

+1 on this issue. any update from anyone?