microsoft / tsdoc

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

Guidance for single-line comments #297

Open kmturley opened 3 years ago

kmturley commented 3 years ago

In the documentation there three types of tags

https://tsdoc.org/pages/spec/tag_kinds/

However none of these mention whether single-line comments are supported? They are all multi-line comment blocks.

It's common in many companies to add single-line comments to add context to code, which may not be actually generated in customer facing documentation.

In the Angular source code I see the use of both multiline and single line:

/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

// This file intentionally left blank. It is used to load nothing in some cases.
// Such as parse5/index is redirected here instead of loading into browser.

export let __empty__: any;

https://github.com/angular/angular/blob/master/packages/empty.ts

But they also have another file using a different standard:

/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */

/** Dummy typings for systemjs. */
declare var System: any;

https://github.com/angular/angular/blob/master/packages/system.d.ts

It would be great to clarify what the standard is for single-line comments, recommended uses-cases etc.