salesforce / eslint-config-lwc

Opinionated ESLint configurations for LWC projects
MIT License
112 stars 36 forks source link

Parsing error: The keyword 'import' is reserved #67

Closed AllanOricil closed 3 years ago

AllanOricil commented 3 years ago

For some reason eslint is saying import is wrong. It might be related to this issue https://github.com/yannickcr/eslint-plugin-react/issues/447#issuecomment-184617282

image

AllanOricil commented 3 years ago

I fixed this issue after creating an .eslintrc file with the following configs

{
  "parserOptions": {
      "sourceType": "module",
      "ecmaVersion": 2020
  }
}
AllanOricil commented 3 years ago

Oh I found a better solution. I just created the .eslintrc with the content from the README

{
    "extends": ["@salesforce/eslint-config-lwc/recommended"]
}

For some reason sfdx force:project:create did not create the .eslintrc

AlexRixten commented 2 years ago

Thank you, it was useful for me!)

MadyKramer commented 2 years ago

Thanks :)