Currently, there's no way to automatically add spacing before JSDoc comments, which can make interfaces and objects with many documented properties hard to read. I would like to be able to do that.
Before:
/** CSP policy configuration */
export interface CSPPolicy {
/** Map of CSP directives to their values */
directives?: Partial<Record<CSPDirective, CSPDirectiveValue>>
/** Hash algorithm to use for inline scripts and styles */
hashAlgorithm?: 'sha256' | 'sha384' | 'sha512'
/** Whether to add hashes for inline scripts */
useScriptHashes?: boolean
}
After:
/** CSP policy configuration */
export interface CSPPolicy {
/** Map of CSP directives to their values */
directives?: Partial<Record<CSPDirective, CSPDirectiveValue>>
/** Hash algorithm to use for inline scripts and styles */
hashAlgorithm?: 'sha256' | 'sha384' | 'sha512'
/** Whether to add hashes for inline scripts */
useScriptHashes?: boolean
}
Proposed solution
Add a new option like jsdocSpacingBefore or jsdocPaddingBefore that would:
- Add a blank line before JSDoc comments.
- Work for property/field documentation in interfaces, types, and objects.
- Be configurable (boolean, defaulting to
false for backward compatibility).
Currently, there's no way to automatically add spacing before JSDoc comments, which can make interfaces and objects with many documented properties hard to read. I would like to be able to do that.
Before:
After:
Proposed solution
Add a new option like
jsdocSpacingBeforeorjsdocPaddingBeforethat would:falsefor backward compatibility).