Microsoft/TypeScript

Code blocks for `@typedef` do not preserve indentation in the generated `.d.ts` file.

開放

#46,750 建立於 2021年11月9日

 (1 則留言) (2 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
BugDomain: Comment EmitEffort: ModerateHelp Wanted

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Bug Report

🔎 Search Terms

code block typedef indentation

🕗 Version & Regression Information

Version 4.4.3, 4.4.4, 4.6.0-dev.20211109

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about @typedef

⏯ Playground Link

Playground link with relevant code

💻 Code

/**
 * @typedef {object} TEST
 * ```js
 * {
 *   key_1: value_1,
 *   key_2: {
 *     key_2_1: {
 *       key_2_1_1: 'ZZZzzz…'
 *     }
 *   }
 * }
 * ```
 */

🙁 Actual behavior

Code blocks for @typedef do not preserve indentation in the generated .d.ts file.

/**
 * ```js
 * {
 * key_1: value_1,
 * key_2: {
 *   key_2_1: {
 *     key_2_1_1: 'ZZZzzz…'
 *   }
 * }
 * }
 * ```
 */
type TEST = object;

🙂 Expected behavior

Code blocks for @typedef preserve indentation in the generated .d.ts file.

/**
 * ```js
 * {
 *   key_1: value_1,
 *   key_2: {
 *     key_2_1: {
 *       key_2_1_1: 'ZZZzzz…'
 *     }
 *   }
 * }
 * ```
 */
type TEST = object;

貢獻者指南