Use explicit ts specifiers for declarations

Restore explicit .ts relative specifiers in source and enable rewriteRelativeImportExtensions so emitted JS uses .js while declarations keep explicit .ts specifiers. Add a NodeNext declaration-consumer gate to prevent extensionless declaration regressions.
This commit is contained in:
Tianyi Cui
2026-06-22 06:11:00 +08:00
parent 94e7355449
commit 07f4047ff0
56 changed files with 323 additions and 147 deletions

View File

@@ -1,4 +1,4 @@
import { isNullable } from './misc'
import { isNullable } from './misc.ts'
/** Return true when every item in `array2` is present in `array1`. */
export function contain(array1: readonly any[], array2: readonly any[]) {

View File

@@ -1,10 +1,10 @@
/** Array set and normalization helpers. */
export * from './array'
export * from './array.ts'
/** Runtime type, binary, clone, and equality helpers. */
export * from './types'
export * from './types.ts'
/** Shared utility types and object helpers. */
export * from './misc'
export * from './misc.ts'
/** String case, path, and property formatting helpers. */
export * from './string'
export * from './string.ts'
/** Time constants, parsing, and formatting helpers. */
export * from './time'
export * from './time.ts'

View File

@@ -1,4 +1,4 @@
import { isNullable } from './misc'
import { isNullable } from './misc.ts'
type GlobalConstructorNames = keyof {
[K in keyof typeof globalThis as typeof globalThis[K] extends abstract new (...args: any) => any ? K : never]: K