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.

exponentiation operator is stage 4, and thus standard

See original GitHub issue

echo '3 ** 4' | eslint --stdin (in the latest v1.x) results in

<text>
  1:5  error  Parsing error: Unexpected token *

Presumably something upstream needs updating to be able to parse it, but since it’s stage 4, and in ES2016, it’s pretty urgent to support it.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
mysticateacommented, Mar 7, 2016
{
    "parserOptions": {
        "ecmaVersion": 7
    }
}
0reactions
platinumazurecommented, Jul 12, 2017

You need ecmaVersion: 7 to use the exponentiation operator.

On Jul 12, 2017 11:12, “Mikhail Kuznetcov” notifications@github.com wrote:

@mysticatea https://github.com/mysticatea it didn solve my problem sill. I have

eslint -v v3.19.0 and

“parserOptions”: { “ecmaVersion”: 6, “ecmaFeatures”: { “jsx”: true }, “sourceType”: “module” },

in my .eslintrc

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eslint/eslint/issues/5200#issuecomment-314819039, or mute the thread https://github.com/notifications/unsubscribe-auth/AARWejqurYrnz6jc_vf8OKn1NrOOkfRXks5sNPBMgaJpZM4HW7ca .

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Exponentiation Operator in JavaScript - Marius Schulz
ECMAScript 2016 will likely standardize the exponentiation operator **. Babel and TypeScript 1.7 already support it today.
Read more >
Exponentiation (**) - JavaScript - MDN Web Docs - Mozilla
The exponentiation ( ** ) operator returns the result of raising the first operand to the power of the second operand.
Read more >
Exponentiation Associativity and Standard Math Notation
Right exponentiation associativity works like this: 2^2^3 == 2^(2^3) == 256 . Many people would say that right associativity is more useful ...
Read more >
Exponentiation operator and precedence group - Swift Forums
We propose the addition of ** as the exponentiation operator, assigned to a precedence group named ExponentiationPrecedence that is higher than ...
Read more >
Designing an Exponentiation Operator for JavaScript - Bocoup
To design an exponentiation operator for JavaScript, it makes sense ... As of this year, TC39 adopted a 4-stage process for vetting proposed ......
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