Skip to content

[BUG] @ignore and @internal not working in some cases #1101

@stefan-schweiger

Description

@stefan-schweiger
Overview of the issue

For the most part @ignored and @internal work expected, but I've identified 2 cases where they don't. The first one is if you use /** @internal */ with @Input or @Output:

/** @internal */
@Input()
public internalInputProp: string = '';

Still gets generated (see below, it even recogniced the jsdoc tag), but /** @ignore */ or removing @Input() lead to the property correctly being omitted.

{
  "name": "internalInputProp",
  "defaultValue": "''",
  "deprecated": false,
  "deprecationMessage": "",
  "jsdoctags": [
      {
          "pos": 344,
          "end": 354,
          "flags": 4227072,
          "modifierFlagsCache": 0,
          "transformFlags": 0,
          "kind": 317,
          "tagName": {
              "pos": 345,
              "end": 353,
              "flags": 4227072,
              "modifierFlagsCache": 0,
              "transformFlags": 0,
              "kind": 78,
              "escapedText": "internal"
          },
          "comment": ""
      }
  ],
  "line": 24,
  "type": "string"
}

The other case is when you set /** @ignore */ or /** @internal */ on constructor properties:

constructor(
  /** @internal */ public internalConstructorProp: string = '',
  /** @ignored */ public ignoredConstructorProp: string = ''
) {}

This time both of those properties will get generated and again the jsdoc tags are included in the generated JSON.

Reproduce the error

Reproduction:
https://github.com/stefan-schweiger/compodoc-repro/tree/ignore-internal-bug

Just run npm run docs:json and look in the generated documentation.json for internalInputProp, internalConstructorProp and ignoredConstructorProp.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions