@tanstack/eslint-plugin-query
missing (peer) dependency on typescript
#9097
Labels
@tanstack/eslint-plugin-query
missing (peer) dependency on typescript
#9097
Describe the bug
@tanstack/eslint-plugin-query
tries to importtypescript
, but does not declare it as a dependency or peer dependency.This happens to work with
npm
's hoisting due to other dependencies pulling that package in, but will fail withyarn
's p'n'p orpnpm
with hoisting disabled.Your minimal, reproducible example
Reproduction steps explain how to reproduce starting with an empty directory.
Steps to reproduce
With yarn:
echo '{}' > package.json
yarn set version stable
yarn add eslint @tanstack/eslint-plugin-query
echo 'import pluginQuery from "@tanstack/eslint-plugin-query"; export default [ ...pluginQuery.configs["flat/recommended"], ];' > eslint.config.mjs
yarn exec eslint .
With pnpm:
echo 'hoist-pattern=[]' > .npmrc
pnpm add eslint @tanstack/eslint-plugin-query
echo 'import pluginQuery from "@tanstack/eslint-plugin-query"; export default [ ...pluginQuery.configs["flat/recommended"], ];' > eslint.config.mjs
pnpm exec eslint .
Expected behavior
Eslint runs.
How often does this bug happen?
Every time
Screenshots or Videos
No video or screenshot, but the console output would seem to be helpful here.
With yarn:
With pnpm:
Platform
Tanstack Query adapter
None
TanStack Query version
@tanstack/eslint-plugin-query v5.74.7
TypeScript version
none
Additional context
The attempt to import
typescript
is here:query/packages/eslint-plugin-query/src/rules/no-void-query-fn/no-void-query-fn.rule.ts
Line 2 in 18af643
Added in #8925.
The text was updated successfully, but these errors were encountered: