hosseinmd/prettier-plugin-jsdoc

Allow different printWidth for jsdoc

Closed this issue · 2 comments

Suggestion

Allow to set a printWidth for code comments that is different from the printWidth that is applied to code.

JSDoc comments are of a different content than code. Both are used / read in a different way and therefore may require different formatting.

  • Comments are mostly focused on prose text that requires a shorter print-width to be readable; for the same reason why a newspaper prints text in columns and not in lines that span across a whole page.
  • Code is mostly focused on logic syntax with certain structure patterns that are read segmentally and require a wider print-width to be readable, otherwise a line is broken into multiple lines too soon that become difficult to read.

I agree. We could use jsdocPrintWidth and printWidth if jsdocPrintWidth not defined.

Sounds good!