question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package.json for eslint-config-react-app on NPM is incorrect

See original GitHub issue

Describe the bug

The package.json file for eslint-config-react-app differs between NPM and Git for one peer dependency:

  • Git: "eslint-plugin-react-hooks": "1.x || 2.x || 3.x || 4.x"
  • Npm: "eslint-plugin-react-hooks": "1.x || 2.x"

Both has "version": "5.2.1", and everything else matches, except for this one peer dependency. 😕

Steps to reproduce

  1. Inspect package.json on git:
    "version": "5.2.1"
    "eslint-plugin-react-hooks": "1.x || 2.x || 3.x || 4.x"
  2. Run npm pack eslint-config-react-app
  3. Inspect the package.json within the downloaded tgz package:
    "version": "5.2.1"
    "eslint-plugin-react-hooks": "1.x || 2.x"

Expected behavior

Would expect the acceptable versions of "eslint-plugin-react-hooks" to be the same in both places.

Actual behavior

Acceptable versions do not match. Means npm gives me a warning when I try to upgrade eslint-plugin-react-hooks to its latest version, 4.x:

> npm install eslint-plugin-react-hooks@4
npm WARN eslint-config-react-app@5.2.1 requires a peer of eslint-plugin-react-hooks@1.x || 2.x but none is installed. You must install peer dependencies yourself.

+ eslint-plugin-react-hooks@4.0.1
updated 1 package and audited 712 packages in 3.669s

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Svishcommented, Aug 29, 2020

Thank you, most gracious mr. Stale.

4reactions
Svishcommented, Jul 14, 2020

Still an issue. And seems to be “worse” too. The whole peerDependencies section seems to be incorrect.

From GitHub repo:

{
  "peerDependencies": {
    "@typescript-eslint/eslint-plugin": "^3.0.0",
    "@typescript-eslint/parser": "^3.0.0",
    "babel-eslint": "^10.0.0",
    "eslint": "^7.0.0",
    "eslint-plugin-flowtype": "^5.0.0",
    "eslint-plugin-import": "^2.21.1",
    "eslint-plugin-jsx-a11y": "^6.3.0",
    "eslint-plugin-react": "^7.20.0",
    "eslint-plugin-react-hooks": "^4.0.1"
  },
}

From NPM via npm pack eslint-config-react-app:

{
  "peerDependencies": {
    "@typescript-eslint/eslint-plugin": "2.x",
    "@typescript-eslint/parser": "2.x",
    "babel-eslint": "10.x",
    "eslint": "6.x",
    "eslint-plugin-flowtype": "3.x || 4.x",
    "eslint-plugin-import": "2.x",
    "eslint-plugin-jsx-a11y": "6.x",
    "eslint-plugin-react": "7.x",
    "eslint-plugin-react-hooks": "1.x || 2.x"
  },
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint configuration in package.json » eslint-config-react-app ...
1 Answer 1 · Delete package-lock.json · Delete node_modules · Remove eslint dependencies from your devDependencies in package.json · run npm cache ...
Read more >
eslint-config-react-app - npm
eslint-config-react-app. This package includes the shareable ESLint configuration used by Create React App.
Read more >
package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
config | npm Docs
Default: false; Type: Boolean. If true, npm does not run scripts specified in package.json files. Note that commands explicitly intended to run a...
Read more >
Node v16.15.1 (npm v8.11.0) breaks some builds
Even if your package-lock file was built using one of those flags, they seem to be broken or ignored by Netlify with 16.15.1....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found