Skip to content

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

Merged
ianschmitz merged 11 commits into
react:masterfrom
lukyth:lukyth/upgrade-eslint-plugin
Feb 19, 2020
Merged

Widen eslint-config-react-app peer dependency versions#7790
ianschmitz merged 11 commits into
react:masterfrom
lukyth:lukyth/upgrade-eslint-plugin

Conversation

@lukyth

@lukythlukyth commented Oct 6, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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{useBasenameaswithBasename}from'history'withBasename();

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

@lukyth

lukyth commented Oct 7, 2019

Copy link
Copy Markdown
ContributorAuthor

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 ownerJanuary 11, 2020 17:37
@ianschmitzianschmitz added this to the 3.4.1 milestone Feb 19, 2020
@ianschmitz

Copy link
Copy Markdown
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.

@ianschmitzianschmitz changed the title Upgrade eslint-plugin-flowtype and eslint-plugin-react-hooksFix eslint-plugin-flowtype peer dependency versionFeb 19, 2020
@ianschmitzianschmitz changed the title Fix eslint-plugin-flowtype peer dependency versionFix eslint-config-react-app peer dependency versionsFeb 19, 2020
@ianschmitzianschmitz changed the title Fix eslint-config-react-app peer dependency versionsWiden eslint-config-react-app peer dependency versionsFeb 19, 2020
@ianschmitz

Copy link
Copy Markdown
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 react:masterFeb 19, 2020
@ianschmitz

Copy link
Copy Markdown
Contributor

Thanks!

@lukyth
lukyth deleted the lukyth/upgrade-eslint-plugin branch February 20, 2020 05:39
@locklockBot locked and limited conversation to collaborators Feb 25, 2020
Sign up for freeto 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

@lukyth@ianschmitz@facebook-github-bot