microsoft / tsdoc

A doc comment standard for TypeScript
https://tsdoc.org/
MIT License
4.68k stars 131 forks source link

eslint-plugin-tsdoc: suggest a rule to check misused function comment #347

Open trim21 opened 1 year ago

trim21 commented 1 year ago

raise a error for this:

bad:

// function comment not recognized by tsc
const getShortName = (name: string): string => {
   ...
}

tsc doesn't think this is a function comment and doesn't emit it in type definition.

good:

/**
 * function comment not recognized by tsc
 */
const getShortName = (name: string): string => {
   ...
}