Eslint-plugin-jsdoc: Feature request: rule to enforce asterisks

Created on 12 Apr 2019  路  3Comments  路  Source: gajus/eslint-plugin-jsdoc

It would be nice to have a rule that enforces every line in a JSdoc comment to start with an asterisk, as in https://palantir.github.io/tslint/rules/jsdoc-format/

enhancement

Most helpful comment

Comparison between tslint/jsdoc-format and eslint-plugin-jsdoc:

  • [ ] each line contains an asterisk
  • [x] asterisks must be aligned - jsdoc/check-alignment
  • [x] disallow extra space after asterisks - jsdoc/check-indentation
  • [x] require newline after main description - jsdoc/newline-after-description
  • [ ] require one space after asterisks
  • [ ] multiline comments don鈥檛 allow text after /** in the first line (under option)

Both unsupported:

  • [ ] bare block comment: disallow asterisks
  • [ ] disallow lines between tag blocks (#93)
  • [ ] disallow extra spaces in between tag name, types, and names

All 3 comments

Comparison between tslint/jsdoc-format and eslint-plugin-jsdoc:

  • [ ] each line contains an asterisk
  • [x] asterisks must be aligned - jsdoc/check-alignment
  • [x] disallow extra space after asterisks - jsdoc/check-indentation
  • [x] require newline after main description - jsdoc/newline-after-description
  • [ ] require one space after asterisks
  • [ ] multiline comments don鈥檛 allow text after /** in the first line (under option)

Both unsupported:

  • [ ] bare block comment: disallow asterisks
  • [ ] disallow lines between tag blocks (#93)
  • [ ] disallow extra spaces in between tag name, types, and names

I submitted a PR for this at #446. ~Not amazingly happy about the name, though - thoughts?~

Other checks I can think of on this general topic might be:

  1. Avoiding multiple asterisks (beyond the obligatory first two), whether at the beginning, end, or middle
  2. Avoiding single line jsdoc blocks such as /** @param abc */, perhaps excepting some tags like @lends which, um, "lend" themselves to single line expressions because of their terseness.
Was this page helpful?
0 / 5 - 0 ratings