typescript-knowledge-patch

TypeScript 5.9+ Knowledge Patch

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "typescript-knowledge-patch" with this command: npx skills add nevaberry/nevaberry-plugins/nevaberry-nevaberry-plugins-typescript-knowledge-patch

TypeScript 5.9+ Knowledge Patch

Claude's baseline knowledge covers TypeScript through 5.8. This skill provides features from 5.9 (May 2025) onwards.

5.9 (2025-05-22)

import defer Syntax

New ECMAScript proposal for deferred module evaluation. The module's code isn't executed until you access one of its exports, enabling lazy loading without dynamic import() .

import defer * as feature from "./some-feature.js";

// Module not executed yet console.log("Starting up...");

// Module executes NOW when property is accessed console.log(feature.specialConstant);

Constraints:

  • Only namespace imports allowed (import defer * as name )

  • No named imports (import defer { x } ) or default imports

  • Requires --module preserve or --module esnext

--module node20

Stable module option modeling Node.js 20 behavior. Unlike nodenext (which tracks latest Node.js):

  • Remains stable—won't change with future Node.js releases

  • Implies --target es2023 (not esnext )

  • Supports CommonJS requiring ESM modules

  • Rejects deprecated import assertions

Use node20 for predictable behavior; use nodenext to track latest Node.js features.

Updated tsc --init Defaults

Generated tsconfig.json is now minimal with modern prescriptive defaults:

{ "compilerOptions": { "target": "esnext", "module": "nodenext", "strict": true, "moduleDetection": "force", "noUncheckedSideEffectImports": true, "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true } }

Commented-out options removed in favor of editor autocompletion.

Breaking Change: ArrayBuffer Type Narrowing

ArrayBuffer no longer supertypes TypedArray buffer variants. Code passing typed array buffers may need updates:

// ❌ May error in 5.9 function process(buf: ArrayBuffer) { /* ... */ } const arr = new Uint8Array(10); process(arr); // Error: Uint8Array not assignable to ArrayBuffer

// ✅ Fix: access the underlying buffer process(arr.buffer);

// ✅ Or: explicitly type the TypedArray const arr = new Uint8Array<ArrayBuffer>(10);

Update @types/node if encountering Buffer compatibility issues.

Breaking Change: Type Argument Inference

Changes to prevent type variable "leaks" during inference. Some code may require explicit generic type arguments:

// Before: type inferred (possibly incorrectly) const result = someGenericFunction(value);

// After: may need explicit type argument const result = someGenericFunction<ExpectedType>(value);

TypeScript 7 (Native Port)

TS7 rewrites the compiler in Go. TS6 is the last JS-based release. Details: See references/typescript-7-transition.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

python-knowledge-patch

No summary provided by upstream source.

Repository SourceNeeds Review
Research

dioxus-knowledge-patch

No summary provided by upstream source.

Repository SourceNeeds Review
Research

rust-knowledge-patch

No summary provided by upstream source.

Repository SourceNeeds Review