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

fix: declare parsers as optional peer dependencies #454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ylemkimon
Copy link

The test shows babel-eslint-plugin is compatible with the latest of all major version of babel-eslint, so * is used.

@TrySound
Copy link
Contributor

The parser is migrated to monorepo
https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser

@TrySound
Copy link
Contributor

So better to not add any dependency to be compatible with both packages. Especially since there is no version restriction.

@ylemkimon
Copy link
Author

@TrySound I wonder how Babel solved the peer dependency problem when moving from Babel 6 to 7.

@TrySound
Copy link
Contributor

Which problem I don't follow? Babel-eslint bumped babel/core long time ago.
https://github.com/babel/babel-eslint/blob/master/package.json#L32

@ylemkimon
Copy link
Author

ylemkimon commented Aug 21, 2020

@TrySound I remember there were lots of packages declaring unscoped Babel packages, e.g. babel-core, as peer dependency. I'm curious how they moved to using scoped Babel packages (@babel/core) as peer dependencies.

One way I can think of is declaring both parser as optional using peerDependenciesMeta. I'll update the PR. Updated.

@ylemkimon ylemkimon changed the title fix: declare babel-eslint as peer dependency fix: declare parsers as optional peer dependencies Aug 21, 2020
@TrySound
Copy link
Contributor

There was babel-core@7-bridge package which reexported @babel/core. Probably yeah, peerDependenciesMeta can be a way to go. But it should be resolved in recommended config as well.

@ylemkimon
Copy link
Author

@TrySound Now I remember, [email protected]. I've opened an issue at Babel to request to provide the bridge version: babel/babel#11989.

@ylemkimon
Copy link
Author

By @kaicataldo in babel/babel#11989 (comment)

The hard break was intentional here because we've changed how the parser works and there are significant breaking changes. I'm in favor of making things fail faster in this case so that people are aware of the changes if/when they upgrade.

I think declaring both of them as optional peer dependencies is the best way to go.

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

Successfully merging this pull request may close these issues.

2 participants