Eslint-plugin-jsdoc: [jsdoc/require-description-complete-sentence] Error on named @param preceding newline

Created on 14 Jan 2021  Â·  2Comments  Â·  Source: gajus/eslint-plugin-jsdoc

This appears to be a regression in version 31. I upgraded from 30.3.0 to 31.0.4 and this problem appeared.

Expected behavior

A Javascript module like the following should pass without error:

/**
 * @param foo
 *
 * @returns {void}
 */
export default (foo) => {
  foo()
}

Actual behavior

The above module fails with jsdoc/require-description-complete-sentence:

/path/to/foo.js
  2:0  error  Sentence must end with a period  jsdoc/require-description-complete-sentence

✖ 1 problem (1 error, 0 warnings)

Removing the newline between the @param and @returns removes the error.

ESLint Config

module.exports = {
  parser: 'babel-eslint',
  plugins: ['jsdoc'],
  rules: { 'jsdoc/require-description-complete-sentence': 'error' },
}

Environment

  • Node version: v12.18.3
  • ESLint version: v7.17.0
  • eslint-plugin-jsdoc version: 31.0.4
bug released

Most helpful comment

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

The release is available on:

Your semantic-release bot :package::rocket:

All 2 comments

If I then run eslint --fix foo.js, I'm left with the following:

/**.
 * @param foo
 *
 * @returns {void}
 */
export default (foo) => {
  foo()
}

Which is odd because the error is regarding line 2, the @param annoation, not line 1.

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

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings