Here's a minimal repro: https://github.com/cakoose/no-extraneous-dependencies-reporting-types-package-bug
Summary of repo contents
index.ts
package.json (I forget to add a dependency on "qs", but it gets included indirectly via "express")
"dependencies": {
"express": "^4.21.2"
},
"devDependencies": {
"@types/qs": "^6.9.7",
...
}
eslint.config.mjs:
rules: {
'import/no-extraneous-dependencies': ['error', {
devDependencies: false,
peerDependencies: false,
}],
},
To reproduce
.../index.ts
1:1 error '@types/qs' should be listed in the project's dependencies, not devDependencies
import/no-extraneous-dependencies
Problem: It's reporting "@types/qs" instead of "qs".
This slight reporting issue really threw me off. I was trying all kinds of weird things to figure out why it was reporting the "@types/qs" package, only to realize that I didn't include "qs" in my dependencies list.