You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes the checkConfig from the ESLint special fail with an exception:
TypeError: Found non-callable @@iterator
at checkConfig (/bxt/foo/node_modules/depcheck/dist/special/eslint.js:98:13)
at /bxt/foo/node_modules/depcheck/dist/special/eslint.js:113:128
at arrayMap (/bxt/foo/node_modules/lodash/lodash.js:653:23)
at Function.map (/bxt/foo/node_modules/lodash/lodash.js:9622:14)
at interceptor (/bxt/foo/node_modules/lodash/lodash.js:17094:35)
at thru (/bxt/foo/node_modules/lodash/lodash.js:8859:14)
at /bxt/foo/node_modules/lodash/lodash.js:4430:28
at arrayReduce (/bxt/foo/node_modules/lodash/lodash.js:697:21)
at baseWrapperValue (/bxt/foo/node_modules/lodash/lodash.js:4429:14)
at LazyWrapper.lazyValue [as value] (/bxt/foo/node_modules/lodash/lodash.js:1901:16)
This means that all eslint related packages are marked as unused instead of being detected from the config.
Looking at the config schema in eslint it would seem that this is an issue with MDX, you might want to open an issue over there. I'm not sure we want to handle misconfigured eslint plugins in depcheck
Bug Description
Is seems depcheck is failing to find all eslint-related packages when the overrides config of one plugin is not an array.
Somehow the MDX eslint plugin uses just an object instead of an array to speficy its linter overrides: https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-plugin-mdx/src/configs/overrides.ts
This makes the
checkConfig
from the ESLint special fail with an exception:This means that all eslint related packages are marked as unused instead of being detected from the config.
Code snippets
Where the dependency is used:
ESLint config in
package.json
:Where the dependency is listed in package.json:
Versions
node -v
: v18.17.1npm -v
: 9.1.2depcheck --version
: 1.4.6Extra info
I used patch-package to patch
depcheck@1.4.6
for the project I'm working on.Here is the diff that solved my problem:
The text was updated successfully, but these errors were encountered: