LoginSignup
1
0

More than 5 years have passed since last update.

VSCode + ES6 module: Parsing error: The keyword 'import' is reserved

Posted at

If you're a VSCode+React coder, and you installed the ESLint in the VSCode, you might found that there is an error:

Parsing error: The keyword 'import' is reserved.

The problem is: The "module" setting for reactjs is not enabled at the beginning.

But it's an easy fix :)

Just overwrite some settings in the User Settings of the VSCode:

"eslint.options": {
        "parserOptions": {
            "ecmaVersion": 6,
            "sourceType": "module",
            "ecmaFeatures": {
                "jsx": true,
                "modules": true
            }
        }
    }

Done!

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0