also looking at this
fix(emit): keep a */ in a default value from closing its JSDoc
#3118
3 files
+38
-2
| @@ -4,7 +4,7 @@ | ||
| 4 | 4 | |
| 5 | 5 | import type { Declaration } from '../types' |
| 6 | 6 | import { formatComments } from './comments' |
| 7 | import { consumeCleanDefault, enableCleanDefaultCollection, extractSatisfiesType, inferNarrowType, isGenericType } from './type-inference' | |
| 7 | import { consumeCleanDefault, enableCleanDefaultCollection, escapeCommentEnd, extractSatisfiesType, inferNarrowType, isGenericType } from './type-inference' | |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Format a @defaultValue tag as a standalone JSDoc block |
| @@ -183,6 +183,7 @@ export function processVariableDeclaration(decl: Declaration, keepComments: bool | ||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | result += `: ${typeAnnotation};` |
| 186 | defaultTag = escapeCommentEnd(defaultTag) | |
| 186 | 187 | |
| 187 | 188 | // Skip generated @defaultValue if user already has one |
| 188 | 189 | if (defaultTag && comments && comments.includes('@defaultValue')) { |