eslint: 2.10 parse error

What version of ESLint are you using?

2.10

What parser (default, Babel-ESLint, etc.) are you using?

Tried both default and babel-eslint

Please show your full configuration:

{
    "extends": "ember",

    "parser": "babel-eslint",

    "ecmaFeatures": {
        modules: true,
        blockBindings: true,
        arrowFunctions: true,
        objectLiteralShorthandMethods: true,
        objectLiteralShorthandProperties: true,
        templateStrings: true
    },

    "rules": {
        "quote-props": [2, "consistent-as-needed"],
        "no-ternary": 0,
        "newline-per-chained-call": 0,
        "arrow-body-style": 0,
        "no-warning-comments": 0,
        "max-len": [1, 200],
        "camelcase": 0,
        "space-before-function-paren": [1, "never"],
        "one-var": [ 1, "never" ],
        "indent": [2, 2, {SwitchCase: 1}],
        "object-shorthand": [ 2, "always" ],
        "prefer-const": 0,
        "comma-dangle": 0,
        "spaced-comment": 1,
        "object-curly-spacing": 0,
        "arrow-spacing": [ 1, {
            before: true,
            after: true
        } ],
        "no-restricted-syntax": 0,

        "no-console": 0,
        "no-magic-numbers": 0,
        "valid-jsdoc": [2, {
            "requireReturn": false
        }]
    },

    "globals": {
        "Ember": true,
        "$": true,
        "Edgar": true,
        "visit": true,
        "andThen": true,
        "find": true,
        "findWithAssert": true,
        "click": true,
        "triggerEvent": true,
        "wait": true,
        "ok": true,
        "equal": true,
        "notEqual": true,
        "deepEqual": true,
        "strictEqual": true,
        "throws": true,
        "fillIn": true,
        "exists": true,
        "currentPath": true,
        "currentURL": true,
        "currentRouteName": true,
        "breadcrumbValidator": true,
        "renderProfiler": true,
        "expect": true,
        "_": true,
        "test": true,
        "module": true,
        "YAMP": true,
        "App": true
    }
}

What did you do? Please include the actual source code causing the issue.

test('Create New Rule', async function() {
});

What did you expect to happen?

No parse error

What actually happened? Please include the actual, raw output from ESLint.

/Workspace/tests/acceptance/rule-test.js
  1:31  error  Parsing error: Unexpected token function

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 16
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Sorry about this. We have a plan to release v2.10.1 within this weekend or Monday. (edit)

The mistake is here: https://github.com/eslint/eslint/pull/6108/files#diff-f7bf2b665273dfa66ffa4ad7c0a52bb9R252

parser or parserOptions shouldn’t be provided in that object literal if they are null or undefined.

Found the issue: Currently its not loading the external parser rather using the default (espree) parser. Regression introduced here : https://github.com/eslint/eslint/pull/6108