denoland / deno_lint

Blazing fast linter for JavaScript and TypeScript written in Rust
https://lint.deno.land/
MIT License
1.51k stars 163 forks source link

feature request: add doc comments linting #1279

Open lowlighter opened 1 month ago

lowlighter commented 1 month ago

Since these are used on jsr.io for documentation (but even for deno doc or other doc generators), it'd be nice to add a few rules to lint comment docs like:

no-undocumented-exported-member: All exported members should have a doc comment:

export function bad() {}

/** This function does stuff. */
export function good() {}

sentence-doc-comment: All single line doc comment should starts with an uppercase letter and ends with a final dot.

/** this function does stuff */
export function bad() {}

/** This function does stuff. */
export function good() {}

example-in-doc-comment: All multiline doc comment should contain an example (maybe make this one optional ?)

/**
 * This function does stuff.
 * 
 *  Lorem ipsum... 
 *  Blah blah blah... 
 */
export function bad() {}

/**
 * This function does stuff.
 * 
 *  Lorem ipsum... 
 *  Blah blah blah...
 *
 * @example
 * ```ts
 * good() 
 * ```  
 */
export function good() {}