google / eslint-config-google

ESLint shareable config for the Google JavaScript style guide
Apache License 2.0
1.74k stars 140 forks source link

show error using es6 #38

Closed freeliu closed 7 years ago

freeliu commented 7 years ago

import $ from 'zepto'

Parsing error: The keyword 'import' is reserved

philipwalton commented 7 years ago

I'm not sure if this error is coming from eslint, but I believe in order to use modules you have to set up some config options like so:

{
  "env": {
    "browser": true,
    "es6": true,
  },
  "parserOptions": {
    "sourceType": "module",
  },
  "extends": [
    "eslint:recommended",
    "google",
  ],
}

If you have more questions, please open them on the eslint repo, as this isn't really related to the Google JS style rules.