gajus / eslint-plugin-jsdoc

JSDoc specific linting rules for ESLint.
Other
1.1k stars 160 forks source link

Unable to use latest version with Yarn PnP in `strict` mode #1284

Closed marvinruder closed 3 months ago

marvinruder commented 3 months ago

Expected behavior

ESLint succeeds without errors.

Actual behavior

ESLint fails with:

Oops! Something went wrong! :(

ESLint: 8.57.0

Error: Failed to load plugin 'jsdoc' declared in '.eslintrc.json': eslint-plugin-jsdoc tried to access espree, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: espree
Required by: eslint-plugin-jsdoc@virtual:9e2d75c26d812ba07f2548643e31c2f0eb2cb6f6eca268f33f7e7f2f00bc9a60e5174f4187df59beb0c43929d43a06842c0155865f0f7f541c96499f2ed6aada#npm:48.9.3 (via /…/eslint-plugin-jsdoc-npm-48.9.3-8f2d22eed0-10c0.zip/node_modules/eslint-plugin-jsdoc/dist/)

Require stack:
- /…/eslint-plugin-jsdoc-npm-48.9.3-8f2d22eed0-10c0.zip/node_modules/eslint-plugin-jsdoc/dist/getJsdocProcessorPlugin.cjs
- /…/eslint-plugin-jsdoc-npm-48.9.3-8f2d22eed0-10c0.zip/node_modules/eslint-plugin-jsdoc/dist/index.cjs
- /…/@eslint-eslintrc-npm-2.1.4-1ff4b5f908-10c0.zip/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
Referenced from: /…/packages/backend/.eslintrc.json
    at require$$0.Module._resolveFilename (/…/.pnp.cjs:16695:13)
    at Module._load (node:internal/modules/cjs/loader:1045:27)
    at require$$0.Module._load (/…/.pnp.cjs:16586:31)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/…/eslint-plugin-jsdoc-npm-48.9.3-8f2d22eed0-10c0.zip/node_modules/eslint-plugin-jsdoc/dist/getJsdocProcessorPlugin.cjs:10:38)
    at Module._compile (node:internal/modules/cjs/loader:1504:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1588:10)

This is likely caused by 3ba475e589bc1dc83a7f57950378b2da0228e7fc (as espree is imported in src/getJsdocProcessorPlugin.js) and can be fixed by moving espree from devDependencies to dependencies.

ESLint Config

// N/A

ESLint sample

// N/A

Environment

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 48.10.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

brettz9 commented 3 months ago

Thanks for the report!