-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
In the latest beta of @tanstack/eslint-plugin-query (version 5.0.0-beta.0), eslint fails with the following error:
Error: Failed to load plugin '@tanstack/eslint-plugin-query' declared in '.eslintrc.yaml': Cannot find module './configs.cjs'
Require stack:
- ...\node_modules\@tanstack\eslint-plugin-query\build\legacy\index.cjs
- ...\node_modules\@eslint\eslintrc\dist\eslintrc.cjs
Referenced from: ...\.eslintrc.yaml
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (...\node_modules\@tanstack\eslint-plugin-query\build\legacy\index.cjs:27:22)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
Inspecting the package, I see that around lines 27 and 28 of build/legacy/index.cjs there are these require lines:
var import_configs = require("./configs.cjs");
var import_rules = require("./rules.cjs");But those files do not exist in the package:

capture from https://www.npmjs.com/package/@tanstack/eslint-plugin-query/v/5.0.0-beta.0?activeTab=code
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/gifted-kare-2tfllj
Steps to reproduce
- Create a npm package
- Install
eslintand@tanstack/eslint-plugin-query - (optional) Configure TypeScript
- Configure eslint with something minimal like
extends: [ 'plugin:@tanstack/eslint-plugin-query/recommended' ] - Put some js/ts file somewhere
- Try to lint the file with
eslint
Expected behavior
eslint does not crash when using @tanstack/eslint-plugin-query configuration or plugin.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Windows
- Platform: node v18.17.0
Tanstack Query adapter
None
TanStack Query version
5.0.0-beta.0
TypeScript version
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels