Skip to content

Guidance for single-line comments #297

@kmturley

Description

@kmturley

In the documentation there three types of tags

  • Block tags
  • Modifier tags
  • Inline 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions