Skip to content

Commit

Permalink
chore(util): update list of suppressed JSDoc tags to align with Frame…
Browse files Browse the repository at this point in the history
…work (#3876)

When #3525 merged it contained a list of JSDoc tags which should be
suppressed from component-level generated documentation in typedef
files. This commit updates that list to add some tags that Framework
would not like to have show up all over the place.
  • Loading branch information
alicewriteswrongs authored Dec 9, 2022
1 parent 2115729 commit 189e5a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
9 changes: 7 additions & 2 deletions src/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import type * as d from '../declarations';
import { dashToPascalCase, isString, toDashCase } from './helpers';
import { buildError } from './message-utils';

const SUPPRESSED_JSDOC_TAGS: string[] = ['internal'];
/**
* A set of JSDoc tags which should be excluded from JSDoc comments
* included in output typedefs.
*/
const SUPPRESSED_JSDOC_TAGS: ReadonlyArray<string> = ['virtualProp', 'slot', 'part', 'internal'];

/**
* Create a stylistically-appropriate JS variable name from a filename
Expand Down Expand Up @@ -117,7 +121,8 @@ function formatDocBlock(docs: d.CompilerJsDoc, indentation: number = 0): string
}

/**
* Get all lines part of the doc block
* Get all lines which are part of the doc block
*
* @param docs the compiled JS docs
* @returns list of lines part of the doc block
*/
Expand Down
20 changes: 0 additions & 20 deletions test/end-to-end/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export namespace Components {
}
/**
* Component that helps display a list of cars
* @slot header - The slot for the header content.
* @part car - The shadow part to target to style the car.
*/
interface CarList {
"cars": CarData[];
Expand Down Expand Up @@ -52,9 +50,6 @@ export namespace Components {
}
interface PrerenderCmp {
}
/**
* @virtualProp mode - Mode
*/
interface PropCmp {
"first": string;
"lastName": string;
Expand Down Expand Up @@ -102,8 +97,6 @@ declare global {
};
/**
* Component that helps display a list of cars
* @slot header - The slot for the header content.
* @part car - The shadow part to target to style the car.
*/
interface HTMLCarListElement extends Components.CarList, HTMLStencilElement {
}
Expand Down Expand Up @@ -177,9 +170,6 @@ declare global {
prototype: HTMLPrerenderCmpElement;
new (): HTMLPrerenderCmpElement;
};
/**
* @virtualProp mode - Mode
*/
interface HTMLPropCmpElement extends Components.PropCmp, HTMLStencilElement {
}
var HTMLPropCmpElement: {
Expand Down Expand Up @@ -243,8 +233,6 @@ declare namespace LocalJSX {
}
/**
* Component that helps display a list of cars
* @slot header - The slot for the header content.
* @part car - The shadow part to target to style the car.
*/
interface CarList {
"cars"?: CarData[];
Expand Down Expand Up @@ -278,9 +266,6 @@ declare namespace LocalJSX {
}
interface PrerenderCmp {
}
/**
* @virtualProp mode - Mode
*/
interface PropCmp {
"first"?: string;
"lastName"?: string;
Expand Down Expand Up @@ -330,8 +315,6 @@ declare module "@stencil/core" {
"car-detail": LocalJSX.CarDetail & JSXBase.HTMLAttributes<HTMLCarDetailElement>;
/**
* Component that helps display a list of cars
* @slot header - The slot for the header content.
* @part car - The shadow part to target to style the car.
*/
"car-list": LocalJSX.CarList & JSXBase.HTMLAttributes<HTMLCarListElement>;
"dom-api": LocalJSX.DomApi & JSXBase.HTMLAttributes<HTMLDomApiElement>;
Expand All @@ -345,9 +328,6 @@ declare module "@stencil/core" {
"method-cmp": LocalJSX.MethodCmp & JSXBase.HTMLAttributes<HTMLMethodCmpElement>;
"path-alias-cmp": LocalJSX.PathAliasCmp & JSXBase.HTMLAttributes<HTMLPathAliasCmpElement>;
"prerender-cmp": LocalJSX.PrerenderCmp & JSXBase.HTMLAttributes<HTMLPrerenderCmpElement>;
/**
* @virtualProp mode - Mode
*/
"prop-cmp": LocalJSX.PropCmp & JSXBase.HTMLAttributes<HTMLPropCmpElement>;
"slot-cmp": LocalJSX.SlotCmp & JSXBase.HTMLAttributes<HTMLSlotCmpElement>;
"slot-cmp-container": LocalJSX.SlotCmpContainer & JSXBase.HTMLAttributes<HTMLSlotCmpContainerElement>;
Expand Down
12 changes: 0 additions & 12 deletions test/karma/test-app/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ export namespace Components {
}
interface ShadowDomBasicRoot {
}
/**
* @virtualProp {string} colormode - The mode determines which platform styles to use.
*/
interface ShadowDomMode {
/**
* The mode determines which platform styles to use.
Expand Down Expand Up @@ -871,9 +868,6 @@ declare global {
prototype: HTMLShadowDomBasicRootElement;
new (): HTMLShadowDomBasicRootElement;
};
/**
* @virtualProp {string} colormode - The mode determines which platform styles to use.
*/
interface HTMLShadowDomModeElement extends Components.ShadowDomMode, HTMLStencilElement {
}
var HTMLShadowDomModeElement: {
Expand Down Expand Up @@ -1496,9 +1490,6 @@ declare namespace LocalJSX {
}
interface ShadowDomBasicRoot {
}
/**
* @virtualProp {string} colormode - The mode determines which platform styles to use.
*/
interface ShadowDomMode {
/**
* The mode determines which platform styles to use.
Expand Down Expand Up @@ -1822,9 +1813,6 @@ declare module "@stencil/core" {
"shadow-dom-array-root": LocalJSX.ShadowDomArrayRoot & JSXBase.HTMLAttributes<HTMLShadowDomArrayRootElement>;
"shadow-dom-basic": LocalJSX.ShadowDomBasic & JSXBase.HTMLAttributes<HTMLShadowDomBasicElement>;
"shadow-dom-basic-root": LocalJSX.ShadowDomBasicRoot & JSXBase.HTMLAttributes<HTMLShadowDomBasicRootElement>;
/**
* @virtualProp {string} colormode - The mode determines which platform styles to use.
*/
"shadow-dom-mode": LocalJSX.ShadowDomMode & JSXBase.HTMLAttributes<HTMLShadowDomModeElement>;
"shadow-dom-mode-root": LocalJSX.ShadowDomModeRoot & JSXBase.HTMLAttributes<HTMLShadowDomModeRootElement>;
"shadow-dom-slot-basic": LocalJSX.ShadowDomSlotBasic & JSXBase.HTMLAttributes<HTMLShadowDomSlotBasicElement>;
Expand Down

0 comments on commit 189e5a8

Please sign in to comment.