eslint-plugin-flowtype
eslint-plugin-flowtype copied to clipboard
Should `@babel/plugin-syntax-jsx` be a prod dependency instead of a peer dependency?
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?
BTW my project doesn't use JSX at all as it's a server project, that's why this dependency isn't present.
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