close

[Solved] eslint: error Parsing error: The keyword ‘const’ is reserved

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error eslint: error Parsing error: The keyword ‘const’ is reserved in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How eslint: error Parsing error: The keyword ‘const’ is reserved Error Occurs?

Today I get the following error eslint: error Parsing error: The keyword ‘const’ is reserved in javascript.

How To Solve eslint: error Parsing error: The keyword ‘const’ is reserved Error ?

  1. How To Solve eslint: error Parsing error: The keyword 'const' is reserved Error ?

    To Solve eslint: error Parsing error: The keyword 'const' is reserved Error I used .eslintrc.js and I have added following code.
    module.exports = { "parserOptions": { "ecmaVersion": 6 } };

  2. eslint: error Parsing error: The keyword 'const' is reserved

    To Solve eslint: error Parsing error: The keyword 'const' is reserved Error I used .eslintrc.js and I have added following code.
    module.exports = { "parserOptions": { "ecmaVersion": 6 } };

Solution 1

I used .eslintrc.js and I have added following code.

module.exports = {
    "parserOptions": {
        "ecmaVersion": 6
    }
};

Solution 2

you also can add this inline instead of config, just add it to the same file before you add your own disable stuff

/* eslint-env es6 */
/* eslint-disable no-console */

my case was disable a file and eslint-disable were not working for me alone

/* eslint-env es6 */
/* eslint-disable */

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment