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

Version pinning in eslint-config-next causes difficulties in supporting multiple configs #35977

Closed
1 task
jpage-godaddy opened this issue Apr 7, 2022 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@jpage-godaddy
Copy link
Contributor

jpage-godaddy commented Apr 7, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

    Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP Tue Jun 23 12:58:10 UTC 2020
    Binaries:
      Node: 16.13.0
      npm: 8.4.0
      Yarn: 1.22.17
      pnpm: N/A
    Relevant packages:
      next: 12.1.0
      react: 17.0.2
      react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Our company has a standard eslint config which has a dependency on eslint-plugin-react-hooks@^4.3.0. The eslint-config-next package has a dependency on eslint-plugin-react-hooks@4.3.0 rather than using a semver range. This is causing issues for our users where eslint-plugin-react-hooks@4.4.0 is installed due to semver range matching in our config but then installed a second time as 4.3.0. The inability for eslint to locate a single package of this plugin then has downstream issues including actually breaking next's ability to build. We have to walk our developers through a process to get these dependencies deduped.

Could next use semver ranges for dependencies instead of pinned versions?

Expected Behavior

If eslint-config-next used semver ranges, then npm would have resolved the existing installed eslint-plugin-react-hooks@4.3.0 as semver-compatible and reused that dependency rather than deeming it necessary to install a separate eslint-plugin-react-hooks version in a nested node_modules.

To Reproduce

  1. Start with an empty directory.
  2. Run npm init -y
  3. Run npm i -D eslint-config-godaddy-react
  4. Run npm i -D eslint-config-next
  5. Run npm ls eslint-plugin-react-hooks
  6. Observe:
» npm ls eslint-plugin-react-hooks                                                                                           
repro@1.0.0 /home/repro
├─┬ eslint-config-godaddy-react@8.0.0
│ └── eslint-plugin-react-hooks@4.4.0
└─┬ eslint-config-next@12.1.4
  └── eslint-plugin-react-hooks@4.3.0
@jpage-godaddy jpage-godaddy added the bug Issue was opened via the bug report template. label Apr 7, 2022
@Niazul-Amit

This comment was marked as off-topic.

@ijjk
Copy link
Member

ijjk commented Apr 28, 2022

Closing as this should be resolved by #35781

@ijjk ijjk closed this as completed Apr 28, 2022
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants
@ijjk @jpage-godaddy @Niazul-Amit and others