Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

javascript - Is there anyway to preserve comments for interface in typescript4.0?

My .ts file like this:

/**
 * @typedef {Object} ITest 
 * @property {string} a
 */
export interface ITest {
  a: string
}

/**
 * @function test
 * @params {string} a
 */
export function test (a: string): void {
  console.log('a', a)
}

when i use tsc to compile this file to .js, the comment for interface will be removed.

Is there anyway to preserve this comment in .js?

The version of tsc is 4.1.3

question from:https://stackoverflow.com/questions/65930828/is-there-anyway-to-preserve-comments-for-interface-in-typescript4-0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...