Skip to content

Commit 1c430ae

Browse files
Fix missing TypeScript declarations in published package (#850)
* fix: add explicit RegExp type annotations to restore TypeScript declaration generation UNICODE_PUNCT_R and UNICODE_WHITESPACE_R were exported vars without explicit type annotations. @bunup/dts uses oxc-transform's isolatedDeclaration() to generate .d.ts files, which requires all exported bindings to have explicit types. Without them, TS9010 errors are emitted. In CI (isCI=true), these errors are fatal and cause process.exit(1) before any .d.ts files are written — which is why published packages v9.7.10 and v9.7.11 were missing their type declarations entirely. Closes #849 * chore: add changeset for type declarations fix
1 parent c39fdc1 commit 1c430ae

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'markdown-to-jsx': patch
3+
---
4+
5+
Fix missing TypeScript declaration files in published package.

lib/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ export function isASCIIWhitespace(code: number): boolean {
464464
// Per GFM spec Section 2.1: "A punctuation character is a character in the general Unicode categories
465465
// Pc, Pd, Pe, Pf, Pi, Po, or Ps" - this is \p{P}
466466
// BUT also includes some currency symbols and other symbols per the spec's explicit list
467-
export var UNICODE_PUNCT_R = /[\p{P}\p{S}]/u
468-
export var UNICODE_WHITESPACE_R = /\p{Zs}/u
467+
export var UNICODE_PUNCT_R: RegExp = /[\p{P}\p{S}]/u
468+
export var UNICODE_WHITESPACE_R: RegExp = /\p{Zs}/u
469469

470470
export function isUnicodeWhitespace(c: string): boolean {
471471
if (!c) return true

0 commit comments

Comments
 (0)