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

fix: move @typescript-eslint/utils to production dependencies #1910

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

troycarlson
Copy link

When this plugin is installed with a package manager that enforces isolated node_modules, which is the default behavior of pnpm, the plugin fails with the following error:

Failed to load plugin 'drizzle' declared in '.eslintrc.yaml': Cannot find module '@typescript-eslint/utils'

This plugin has a production dependency on @typescript-eslint/utils here, so this change moves that package from devDependencies to dependencies. This change should ensure that all package managers treat this dependency as a production dependency, and makes this package usable with pnpm's strict isolated node_modules.

This issue is likely masked when using npm or yarn because those package managers produce flat node_modules directories containing all transitive dependencies of the project. It is highly likely that another ESLint plugin package in an end-user's project has specified @typescript-eslint/utils as a production dependency (eslint-plugin-jest is one such example), resulting in this package being present in node_modules and eslint-plugin-drizzle being able to resolve it.

The maintainer of pnpm has written about this scenario here: pnpms strictness helps to avoid silly bugs. Without this fix, users of this plugin are effectively relying on a phantom dependency which could be removed by other packages at any time without notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants