Transpiling interfaces for *.marko files have JSDoc property comments stripped in the transpiled output.
Expected Behavior
Running mtc for an index.marko file with the following interface:
export interface Input {
/** The text to display as the hero's heading. */
text: string;
/** An optional subtitle to display below the heading. */
subtitle?: string;
/** The URL to navigate to when the subtitle is clicked. When specified, this changes the subtitle from plain text to a link. */
subtitleHref?: string;
/** The URL of the image to display in the hero. */
imageUrl: string;
/** The text to be read by screen readers for the image. */
imageDescription?: string;
}
Should result in the JSDoc property comments being preserved in the transpiled index.d.marko type declaration file:
export interface Input {
/** The text to display as the hero's heading. */
text: string;
/** An optional subtitle to display below the heading. */
subtitle?: string;
/** The URL to navigate to when the subtitle is clicked. When specified, this changes the subtitle from plain text to a link. */
subtitleHref?: string;
/** The URL of the image to display in the hero. */
imageUrl: string;
/** The text to be read by screen readers for the image. */
imageDescription?: string;
}
Actual Behavior
The transpiled type declaration file index.d.marko has its JSDoc property comments stripped:
Use the value of removeComments from the project's tsconfig.json
Add a CLI option for changing the removeComments setting
Additional Info
### Your Environment
- Environment name and version (e.g. Chrome 39, node.js 5.4): Node.js v20.12.2
- Operating System and version (desktop or mobile): Mac Sonoma 14.5
- Link to your project: https://github.corp.ebay.com/Sonata/ui
### Steps to Reproduce
1. Clone [library-ts](https://github.com/marko-js/examples/tree/master/examples/library-ts)
2. Create a `src/components/demo/index.marko` file that exports the interface in the description above (with JSDoc property comments)
3. Run `npm run build`
4. View the transpiled `dist/components/demo/index.d.marko` output and see how the inline comments were removed
### Stack Trace
@marko/type-check@1.1.7
Details
Transpiling interfaces for
*.marko
files have JSDoc property comments stripped in the transpiled output.Expected Behavior
Running
mtc
for anindex.marko
file with the following interface:Should result in the JSDoc property comments being preserved in the transpiled
index.d.marko
type declaration file:Actual Behavior
The transpiled type declaration file
index.d.marko
has its JSDoc property comments stripped:Possible Fix
Switching
removeComments
fromtrue
tofalse
inmtc
preserves the comments in the output: https://github.com/marko-js/language-server/blob/99c5f67a66a241139fa7acea56be1de50ba2c64b/packages/type-check/src/run.ts#L354Possible fixes:
removeComments
from the project'stsconfig.json
removeComments
settingAdditional Info
### Your Environment - Environment name and version (e.g. Chrome 39, node.js 5.4): Node.js v20.12.2 - Operating System and version (desktop or mobile): Mac Sonoma 14.5 - Link to your project: https://github.corp.ebay.com/Sonata/ui ### Steps to Reproduce 1. Clone [library-ts](https://github.com/marko-js/examples/tree/master/examples/library-ts) 2. Create a `src/components/demo/index.marko` file that exports the interface in the description above (with JSDoc property comments) 3. Run `npm run build` 4. View the transpiled `dist/components/demo/index.d.marko` output and see how the inline comments were removed ### Stack Trace