Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc/check-examples fails in eslint 8 #794

Closed
hildjj opened this issue Oct 14, 2021 · 2 comments
Closed

jsdoc/check-examples fails in eslint 8 #794

hildjj opened this issue Oct 14, 2021 · 2 comments

Comments

@hildjj
Copy link

hildjj commented Oct 14, 2021

Expected behavior

Using eslint 8.0.1, using jsdoc/check-examples, I expect my jsdoc example code to be linted.

Actual behavior

Oops! Something went wrong! :(

ESLint: 8.0.1

TypeError: _eslint.CLIEngine is not a constructor
Occurred while linting <root>packages/cbor/lib/cbor.js:87
Rule: "jsdoc/check-examples"
    at checkRules (<root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:166:21)
    at Array.forEach (<anonymous>)
    at checkSource (<root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:220:13)
    at <root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:378:5
    at <root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:647:7
    at Array.forEach (<anonymous>)
    at Object.utils.forEachPreferredTag (<root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:646:23)
    at _default.iterateAllJsdocs (<root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/rules/checkExamples.js:305:9)
    at iterate (<root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:784:3)
    at <root>node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-jsdoc/dist/iterateJsdoc.js:866:7

(Please ignore the pnpm paths, I have the same issue using npm.)

My guess is that this is the cause.

ESLint Config

{ 
  "rules": {
    "jsdoc/check-examples": ["error"]
  }
}

ESLint sample

/**
 * The codec information for
 * {@link https://github.com/Level/encoding-down encoding-down}, which is a
 * codec framework for leveldb.  CBOR is a particularly convenient format for
 * both keys and values, as it can deal with a lot of types that JSON can't
 * handle without losing type information.
 *
 * @example
 * const level = require('level')
 * const cbor = require('cbor')
 *
 * async function putget() {
 *   const db = level('./db', {
 *     keyEncoding: cbor.leveldb,
 *     valueEncoding: cbor.leveldb,
 *   })
 *
 *   await db.put({a: 1}, 9857298342094820394820394820398234092834n)
 *   const val = await db.get({a: 1})
 * }
 */

Environment

  • Node version: 16.11.1
  • ESLint version: 8.0.1
  • eslint-plugin-jsdoc version: 36.1.1
@hildjj
Copy link
Author

hildjj commented Oct 14, 2021

This is a part of #791

@hildjj
Copy link
Author

hildjj commented Oct 14, 2021

#792 is on top of this.

@hildjj hildjj closed this as completed Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant