eslint: Eslint does not recognize "async", but I have specified "ecmaVersion":"8"

I am not sure if this is a bug or not so I am asking here.

I have specified this in packages.json:

"eslintConfig": { "parserOptions": { "ecmaVersion": "8" } },

I am not sure this is the correct syntax since the docs are a bit unclear to me.

But I get parsing errors on async. What is wrong here?

Ah, and this is during firebase deploy. Maybe there is something special there?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Hi @lborgman, just to be sure, could you try changing “ecmaVersion” to a number? (Not sure if we have an auto-convert somewhere.)

Might also be worth checking the firebase docs to see if there’s a way to get debug output, in case it might show how it invokes ESLint.

@lborgman I think we could maybe accept a PR which would emit a warning of some kind when we’ve seen an .eslintrc.* file, but also see eslintConfig in package.json, to at least state that the eslintConfig is being ignored due to the presence of config files. Would you like to make a separate issue for that change?

Prior to 2.0.0, if a directory contained both an .eslintrc file and a package.json file with ESLint configuration information, the settings from the two files would be merged together. In 2.0.0, only the settings from the .eslintrc.* file are used and the ones in package.json are ignored when both are present. Otherwise, package.json can still be used with ESLint configuration, but only if no other .eslintrc.* files are present. https://eslint.org/blog/2016/02/eslint-v2.0.0-released#configuration-cascading-changes

Since ESLint 2, if .eslintrc file existed, ESLint ignores eslintConfig of package.json.