Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage instructions error: override configs do not support "extends" #3

Closed
cdfa opened this issue Jul 29, 2019 · 11 comments
Closed

Usage instructions error: override configs do not support "extends" #3

cdfa opened this issue Jul 29, 2019 · 11 comments

Comments

@cdfa
Copy link

cdfa commented Jul 29, 2019

Hi, the usage instructions in the README say to add an override for the extends config for MDX files, but this is not supported by eslint: eslint/eslint#8813. Just adding it to the main extends list should be fine I think.

@JounQin
Copy link
Member

JounQin commented Jul 29, 2019

@cdfa The parser inside should only affect .mdx files, that why we need to use overrides, and overrides in npm in not extendable: eslint/eslint#12032.

So, overrides at top level is needed, and it does work on my side.

See https://github.com/JounQin/Slides/blob/master/package.json#L42-L69 for demo.

@cdfa
Copy link
Author

cdfa commented Jul 29, 2019

Hmm, I'm not sure if I completely understand, but that seems to be an issue specifically with usage from the package.json, while the instructions specifically say to put it in the eslint config file. Anyway, adding it to the main extends list seems to work fine for me (except for the parsing issue #4)

@JounQin
Copy link
Member

JounQin commented Jul 29, 2019

@cdfa My demo is using package.json, and I tried .eslintrc, it also works.
Did you upgrade to latest eslint? Your linked issue had been marked as resolved as far as I know.

@JounQin
Copy link
Member

JounQin commented Jul 29, 2019

@cdfa I tried "eslint": "^5.0.0", I have the following error like your description:

Error: ESLint configuration in /Users/JounQin/Workspaces/GitHub/eslint-plugin-mdx/.eslintrc.js is invalid:
        - Unexpected top-level property "overrides[1].extends".

So I should upgrade the peerDependency eslint version to >= 6.0.0

@cdfa
Copy link
Author

cdfa commented Jul 30, 2019

My demo is using package.json, and I tried .eslintrc, it also works.

I think eslint won't complain about it when running it for some reason, but the JSON schema for the .eslintrc simply doesn't allow it and my editors are warning me about it. Thinking about it, it may be that that schema is different than what eslint uses internally. I'll go ask if it can be updated.

@JounQin
Copy link
Member

JounQin commented Jul 30, 2019

Just PR to update it. :)

@cdfa
Copy link
Author

cdfa commented Jul 30, 2019

Well, I couldn't find the current version of the schema in their repo, so just gonna make an issue about it.

@JounQin
Copy link
Member

JounQin commented Jul 30, 2019

@cdfa
Copy link
Author

cdfa commented Jul 30, 2019

Yeah that's current version on schemastore, but apparently eslint is using a different version internally and that one should be copied to schemastore.

@lolmaus
Copy link

lolmaus commented Jan 15, 2020

Had this problem because eslint was an implicit dependency, and apparently an old version got installed.

Doing yarn add -D eslint (or npm i -D eslint) resolves the issue.

@JounQin
Copy link
Member

JounQin commented Jan 15, 2020

@lolmaus IMO eslint should always be one of peerDependencies. 🤣
Glad that you've resolved your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants