jscs-dev / gulp-jscs

Check JavaScript code style with jscs
MIT License
312 stars 51 forks source link

es6 support? #94

Closed morgondag closed 9 years ago

morgondag commented 9 years ago

is there some special configuration needed to be able to add support for es6 import?

getting all kind so of errors on classes and imports.

validateQuoteMarks: Unsupported rule: disallowVar at components/select-box.js :
     1 |import Component from "component-loader-js/dist/es5/component.js";

here is my config

{
    "excludeFiles": ["**/**/*test.js", "test-helper.js"],
    "disallowAnonymousFunctions": false,
    "esnext": true,
    "verbose": true,
    "disallowSpacesInNamedFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInAnonymousFunctionExpression": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInFunctionDeclaration": {
        "beforeOpeningRoundBrace": true
    },
    "disallowSpacesInsideArrayBrackets": true,
    "disallowQuotedKeysInObjects": true,
    "disallowSpaceBeforeBinaryOperators": [
        ","
    ],
    "disallowMixedSpacesAndTabs": true,
    "disallowYodaConditions": true,
    "disallowKeywords": ["with"],
    "disallowMultipleLineStrings": true,
    "disallowMultipleVarDecl": true,
    "disallowSpaceBeforeComma": true,
    "disallowSpaceBeforeSemicolon": true,
    "requireParenthesesAroundIIFE": true,
    "requireBlocksOnNewline": 1,
    "requireLineFeedAtFileEnd": true,
    "requireSpaceBetweenArguments": true,
    "requireSpaceAfterKeywords": [
        "if",
        "else",
        "for",
        "while",
        "do",
        "switch",
        "case",
        "return",
        "try",
        "catch",
        "typeof"
    ],
    "requirePaddingNewLinesBeforeLineComments": {
        "allExcept": "firstAfterCurly"
    },
    "requirePaddingNewLinesAfterBlocks": true,
    "safeContextKeyword": "_this",
    "validateLineBreaks": "LF",
    "disallowEmptyBlocks": true,
    "disallowMultipleLineBreaks": true,
    "disallowNewlineBeforeBlockStatements": true,
    "disallowOperatorBeforeLineBreak": ["."],
    "disallowSpaceAfterObjectKeys": true,
    "disallowSpaceAfterPrefixUnaryOperators": true,
    "disallowSpaceBeforePostfixUnaryOperators": true,
    "disallowSpacesInFunction": {
        "beforeOpeningRoundBrace": true
    },
    "requireArrowFunctions": true,
    "disallowSpacesInsideParentheses": true,
    "disallowSpacesInCallExpression": true,
    "disallowTrailingComma": true,
    "disallowTrailingWhitespace": true,
    "disallowVar": true,
    "requireArrayDestructuring": false,
    "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties",
    "requireCapitalizedConstructors": true,
    "requireCommaBeforeLineBreak": true,
    "requireCommentsToIncludeAccess": false,
    "requireCurlyBraces": [
        "if",
        "else",
        "for",
        "while",
        "do",
        "try",
        "catch",
        "switch"
    ],
    "requireDotNotation": true,
    "requireEnhancedObjectLiterals": false,
    "requireLineBreakAfterVariableAssignment": true,
    "requireObjectDestructuring": true,
    "requireParenthesesAroundArrowParam": true,
    "requireSemicolons": true,
    "requireSpaceAfterBinaryOperators": true,
    "requireSpaceAfterLineComment": true,
    "requireSpaceBeforeBinaryOperators": true,
    "requireSpaceBeforeBlockStatements": true,
    "requireSpaceBeforeKeywords": [
        "else",
        "while",
        "catch"
    ],
    "requireSpaceBeforeObjectValues": true,
    "requireSpacesInFunction": {
        "beforeOpeningCurlyBrace": true
    },
    "requireSpacesInConditionalExpression": true,
    "requireSpacesInForStatement": true,
    "requireSpacesInsideObjectBrackets": "all",
    "requireTemplateStringsForConcatenation": true,
    "validateIndentation": "\t",
    "validateParameterSeparator": ", ",
    "validateQuoteMarks": "\""
}
sindresorhus commented 9 years ago

Probably better to post this on the main JSCS issue tracker.

morgondag commented 9 years ago

no. they have es6 support. but the gulp variation is just simply broken.

sindresorhus commented 9 years ago

I can't see any place in the plugin code that could affect that. ES6 support is just an option you put in your config, JSCS, not this plugin, handles the rest.

https://github.com/jscs-dev/gulp-jscs/blob/237d2c5d09e553fc3133bcd17c54cbbab3d331ed/index.js#L16