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

[eslint config] [minor] Loosen allowed version range for eslint-plugin-react-hooks #2207

Merged
merged 2 commits into from Jun 10, 2020

Conversation

kripod
Copy link
Contributor

@kripod kripod commented Apr 9, 2020

As seen by comparing changes between eslint-plugin-react-hooks@2.4.0 and 3.0.0:

image

The only breaking change seems to be facebook/react@d3368be. Also, a notable change is that a recommended configuration has been added:

export const configs = {
  recommended: {
    plugins: ['react-hooks'],
    rules: {
      'react-hooks/rules-of-hooks': 'error',
      'react-hooks/exhaustive-deps': 'warn',
    },
  },
};

It's almost identical to the current rules in place, as applicable by extending airbnb/hooks. The list of available rules hasn't changed since v2, hence no additional changes should be required.

Fixes #2231.

@ljharb ljharb changed the title [eslint config] [patch] Loosen allowed version range for eslint-plugin-react-hooks [eslint config] [minor] Loosen allowed version range for eslint-plugin-react-hooks Apr 12, 2020
@kripod
Copy link
Contributor Author

kripod commented May 9, 2020

I think that v4 should also be allowed, as it contains no API changes: https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/CHANGELOG.md

@@ -68,7 +68,7 @@
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.3.0 || ^1.7.0",
"eslint-plugin-react-hooks": "^4.0.0 || ^3.0.0 || ^2.3.0 || ^1.7.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"eslint-plugin-react-hooks": "^4.0.0 || ^3.0.0 || ^2.3.0 || ^1.7.0",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",

the same line must be duplicated in peerDependencies - otherwise you haven't actually allowed anything :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that's right 😅 Thank you for correcting my mistake!

ljharb and others added 2 commits June 10, 2020 14:58
…d v4

Co-authored-by: Kristóf Poduszló <kripod@protonmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@ljharb ljharb merged commit 22adc06 into airbnb:master Jun 10, 2020
@leonardofaria
Copy link

Hi folks
Thanks for this project ❤️

Out of curiosity, I noticed that this PR got merged but is this going to be release now or with the eslint 7 support (#2223)?

Thanks again

@ljharb
Copy link
Collaborator

ljharb commented Jun 13, 2020

It will be released along with #2223.

@kripod kripod deleted the patch-2 branch June 13, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow new "eslint-plugin-react-hooks" versions
3 participants