Gutenberg: Error when extending with plugin:@wordpress/eslint-plugin/recommended

Created on 6 Sep 2019  路  7Comments  路  Source: WordPress/gutenberg

Describe the bug
Extending the .eslintrc with plugin:@wordpress/eslint-plugin/recommended results in build error:
ESLint configuration in plugin:@wordpress/eslint-plugin/recommended is invalid: - Unexpected top-level property "overrides[0].extends".

To reproduce
Steps to reproduce the behavior:

  1. Extend the .eslintrc of a webpack setup with plugin:@wordpress/eslint-plugin/recommended:
    ```js
    [...]
    'extends': [
    'plugin:@wordpress/eslint-plugin/recommended',
    'eslint:recommended'
    ],
    [...]
    ````
  2. Build/lint.

Expected behavior
Linting and building working just fine.

node v8.14.0
npm 6.11.3

[Package] ESLint plugin [Type] Bug

All 7 comments

can you try with something like this without indicating eslint recommended set of rules?

{
    "extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}

I鈥榲e seen this error in the best when ESLint isn鈥榯 up to date. Which version of ESLint are you using?

I have this error too when using recommended -- switching to esnext solved it.

I'm running `"eslint": "^4.19.1"

@TylerB24890 running recommended alongside eslint:recommended?

also, eslint is at version 6.3, can you update and test again?

Definitely need to update. This particular feature your system complains about was introduced in 6.x

well since this is a solved issue now, I guess we can close this.

@gziolo what is the possibility of adding eslint as a peer dependency to eslint plugin package? just to indicate the correct version that should be used?

@gziolo what is the possibility of adding eslint as a peer dependency to eslint plugin package? just to indicate the correct version that should be used?

Sure thing, I'm not sure why we don't have it there. Now, that we know it doesn't work with ESLint < 6, it makes even more sense to have it. Can you open a PR or an issue to track it?

Was this page helpful?
0 / 5 - 0 ratings