question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint creating error `Parsing error: Parenthesized pattern`

See original GitHub issue

Tell us about your environment Mac OS

  • ESLint Version: “eslint”: “^3.16.1”,

  • Node Version: node v6.10.2

  • npm Version: npm v3.10.10

What parser (default, Babel-ESLint, etc.) are you using? default Please show your full configuration:

{
    "env": {
        "browser": true,
        "commonjs": true,
        "node": true
    },
    "globals": {
        "Uint8Array": false,
        "describe": false,
        "before": false,
        "it": false
    },
    "extends": "eslint:recommended",
    "rules": {
        "no-console": [
            "error",
            {"allow": ["warn"]}
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "semi": [
            "error",
            "always"
        ]
    }
}
Configuration



What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

var groupBy = function(array, cp){
    return array.reduce((groups, next) => { const name = cp(next);
    if (name !== undefined) {
        const group = groups.get(name);
        if (group) group.push(next);
        else groups.set(name, [next]);
    }
    return groups;
}, new Map());
}

npm run lint

What did you expect to happen? no lint error for return array.reduce((groups, next) => { const name = cp(next); What actually happened? Please include the actual, raw output from ESLint. gave following error:

  19:25  error  Parsing error: Parenthesized pattern

✖ 1 problem (1 error, 0 warnings)


npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lint"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! bids-validator@0.0.0 lint: `./node_modules/eslint/bin/eslint.js ./**/*.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bids-validator@0.0.0 lint script './node_modules/eslint/bin/eslint.js ./**/*.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bids-validator package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/eslint/bin/eslint.js ./**/*.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bids-validator
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bids-validator
npm ERR! There is likely additional logging output above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Dec 10, 2017

I don’t see you using ES6 in your configuration. Without ES6, you can’t use arrow functions.

Try adding this to your config: "parserOptions": { "ecmaVersion": 6 }

0reactions
not-an-aardvarkcommented, Jan 19, 2018

Closing because there hasn’t been a response in awhile – feel free to create a new issue if you’re still having trouble.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving "Parsing error: Parenthesized pattern" in pure js
ES lint suddenly gives several other errors when I make this change, and the online compiler fails on a different test. The behavior...
Read more >
eslint/eslint - Gitter
I am trying to understand what a particular error message means from eslint: Parsing error: Parenthesized pattern. Here's the code that's triggering it: ......
Read more >
eslint creating error `Parsing error: Parenthesized pattern`
Tell us about your environment. Mac OS. ESLint Version: "eslint": "^3.16.1",. Node Version: node v6.10.2. npm Version: npm v3.10.10.
Read more >
arrow-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
@babel/eslint-parser | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found