fix(typescript-eslint): declare peer dependency on utils
to ensure npm correctly installs dependencies
#8738
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Overview
typescript-eslint
is currently "naughty" and accesses types from/utils
via a transitive dependency.This means that the types we receive depend on how the package manager installs things.
pnpm and npm both do a bad job of installing dependencies in the most sane way (npm/cli#7300) and given the current ecosystem it's possible to get an old major for
/utils
installed at the root instead of v7. This means TS will get the incorrect types for/utils
and then the config types break.This adds a hard dep on
/utils
to force the relationship so that all package managers do the same thing and either hoist the/utils
dependency to the root, or at least ensure that/utils
is nested withintypescript-eslint
.I considered making this a peer dep - but considering
/eslint-plugin
already depends on/utils
- it's always installed (i.e. we're not adding an extra dep) - so no need to do anything complicated that might be misinterpreted by package managers.