MCPcopy
hub / github.com/freshframework/fresh / assertConstructorDocs

Function assertConstructorDocs

tools/check_docs_lib.ts:283–299  ·  view source on GitHub ↗
(
  constructor: DocNodeWithJsDoc<ClassConstructorDef>,
)

Source from the content-addressed store, hash-verified

281}
282
283function assertConstructorDocs(
284 constructor: DocNodeWithJsDoc<ClassConstructorDef>,
285) {
286 for (const param of constructor.params) {
287 assert(
288 param.accessibility === undefined,
289 "Do not use `public`, `protected`, or `private` parameters in constructors",
290 constructor,
291 );
292 if (param.kind === "identifier") {
293 assertHasParamTag(constructor, param.name);
294 }
295 if (param.kind === "assign" && param.left.kind === "identifier") {
296 assertHasParamTag(constructor, param.left.name);
297 }
298 }
299}
300
301function assertModuleDoc(document: DocNodeWithJsDoc<DocNodeModuleDoc>) {
302 assertHasSnippets(document.jsDoc.doc!, document);

Callers 1

assertClassDocsFunction · 0.85

Calls 2

assertFunction · 0.85
assertHasParamTagFunction · 0.85

Tested by

no test coverage detected