Eslint parsing error: Keyword "import" is reserved


#1

Hi,

Using Atom for Meteor development, but this error always occurs:

Eslint Error Fatal: Keyword “import” is reserved

The code: import { Accounts } from 'meteor/accounts-base';

Any idea how to get rid of the error?

Thanks!


#2

You need to update your eslint config and have it support the ES6+ syntax. Google is your friend :slight_smile: As a side note, instead of using the eslint parser, I use babel-eslint as my parser and eslint-config-airbnb-base as the base config that’s extended and modified to suite my taste.

Here’s some code to give you the idea https://github.com/steelbrain/eslint-config-steelbrain