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

Should @babel/plugin-syntax-jsx be a prod dependency instead of a peer dependency? #516

Open
julienw opened this issue Nov 22, 2021 · 2 comments

Comments

@julienw
Copy link

julienw commented Nov 22, 2021

Following #513 @babel/plugin-syntax-jsx is used. However in my project it's currently not installed, and as a result I get errors like:

  0:0  error  Parsing error: Cannot find module '@babel/plugin-syntax-jsx'

I wonder why it's a peer dependency instead of a prod dependency?

@julienw
Copy link
Author

julienw commented Nov 22, 2021

BTW my project doesn't use JSX at all as it's a server project, that's why this dependency isn't present.

@Brianzchen
Copy link
Contributor

I think peer dependency is correct. eslint plugins never ship pure dependencies because as a consumer you can choose a wide range of versions of the plugin you need that this plugin may also depend on.

Steps to solve should be

  • I install eslint-plugin-flowtype
  • I see peer dependency missing warning
  • I install it (or I get an error like you have and then get forced to install it)

fyi it's like how flow-typed doesn't have jsx either but it's forced to install @babel/plugin-transform-react-jsx

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

No branches or pull requests

2 participants