Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 1.54 KB

File metadata and controls

74 lines (57 loc) · 1.54 KB

ts-doc-internal

Requires any TSDoc comments on internal objects to include either an @internal or an @ignore tag.

Internal objects are defined as classes, interfaces, or standalone functions that are not exported from the main entrypoint to the package and are not members of any exports from the main entrypoint (defined recursively). Files that are specified as excluded in a typedoc.json file are ignored by this rule.

By default, the main entrypoint is assumed to be src/index.ts. However, if your package's main entrypoint is elsewhere, you'll need to specify so in your .eslintrc configuration file as follows (for example, if the entrypoint is index.ts):

{
  "settings": {
    "main": "index.ts"
  }
}

This rule exists to prevent inclusion of internal objects in documentation generated by tools such as API Extractor and TypeDoc.

Examples

Assume all objects mentioned are not exported from the main entrypoint to the package.

Good

/**
 * Other documentation
 * @internal
 */
class ExampleClass {}
/**
 * Other documentation
 * @ignore
 */
interface ExampleInterface {}
/**
 * Other documentation
 * @internal
 */
function exampleFunction(): void {}

Bad

/**
 * Other documentation
 */
class ExampleClass {}
/**
 * Other documentation
 */
interface ExampleInterface {}
/**
 * Other documentation
 */
function exampleFunction(): void {}

Source

Suggestion by @chradek.