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

Widen eslint-config-react-app peer dependency versions #7790

Merged
merged 11 commits into from Feb 19, 2020

Conversation

lukyth
Copy link
Contributor

@lukyth lukyth commented Oct 6, 2019

Close #7759

Description

From #7759, install eslint-config-react-app will produce a warning:

warning " > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-flowtype@3.x".
warning " > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-react-hooks@1.x".

They will be fixed by widening the peer dependency values for eslint-plugin-flowtype and eslint-plugin-react-hooks to include the latest major.

Acceptance criteria

  • eslint-plugin-flowtype in this repo should be 3.x || 4.x.
  • eslint-plugin-react-hooks in this repo should be 1.x || 2.x.
  • Installing eslint-config-react-app should not produce the warning above.

@ianschmitz
Copy link
Contributor

I don't think we can roll out the eslint-plugin-react-hooks update without a major release of react-scripts. For example this will cause a linter warning with eslint-plugin-react-hooks@2.x:

import { useBasename } from 'history'

useBasename();

You could work around it like so:

import { useBasename as withBasename } from 'history'

withBasename();

but this would still be a breaking change for existing apps.

@lukyth
Copy link
Contributor Author

lukyth commented Oct 7, 2019

Is it possible to roll out a new major for this? Calling a hook at top level is potentially a bug anyway so I think it's a good idea to allow create-react-app's user to have access to this rule as soon as possible.

@lukyth lukyth requested a review from amyrlam as a code owner January 11, 2020 17:37
@ianschmitz ianschmitz added this to the 3.4.1 milestone Feb 19, 2020
@ianschmitz
Copy link
Contributor

Thanks! I updated the PR to focus on the flow plugin fix. The hooks plugin peer dependency is currently correct as we use version 1.7.0 in react-scripts, but will be addressing in #8505.

@ianschmitz ianschmitz changed the title Upgrade eslint-plugin-flowtype and eslint-plugin-react-hooks Fix eslint-plugin-flowtype peer dependency version Feb 19, 2020
@ianschmitz ianschmitz changed the title Fix eslint-plugin-flowtype peer dependency version Fix eslint-config-react-app peer dependency versions Feb 19, 2020
@ianschmitz ianschmitz changed the title Fix eslint-config-react-app peer dependency versions Widen eslint-config-react-app peer dependency versions Feb 19, 2020
@ianschmitz
Copy link
Contributor

I decided to include the hooks peer dependency change as well, but we won't bump the actual plugin version here and will instead do it in next major of CRA. Sorry for the back and forth.

@ianschmitz ianschmitz merged commit 038e6fa into facebook:master Feb 19, 2020
@ianschmitz
Copy link
Contributor

Thanks!

@lukyth lukyth deleted the lukyth/upgrade-eslint-plugin branch February 20, 2020 05:39
@lock lock bot locked and limited conversation to collaborators Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Peer dependencies of eslint-config-react-app are outdated
3 participants