Skip to content
public-library›Rules›TypeScript›Give exported TypeScript interfaces and non-obvious functions doc comments stating their intent

Give exported TypeScript interfaces and non-obvious functions doc comments stating their intent

Give every exported function, class, method, type, and component a TSDoc comment that states its intent: what it accomplishes for its caller, not how, and every guarantee callers depend on. Give an unexported function or method the same kind of comment when its intent or constraints aren't apparent from its name and signature.

In the full rule