Skip to content
Back to skills

Typescript Knowledge Patch

ASecurity

TypeScript

  • 25 stars
  • 0 votes
  • 0 copies
  • 19 views
  • Added February 7, 2026
developmentjavascripttypescriptgojavavueangularnodeexpressdebugginggit

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill typescript-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-typescript-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-typescript-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-knowledge-patch
description: TypeScript
version: "7.0.0"
license: MIT
metadata:
  author: Nevaberry
---


# TypeScript Knowledge Patch

Load this skill when upgrading TypeScript configuration, resolving changed type
checks, migrating JavaScript and JSDoc, or adopting the native compiler and its
editor tooling. Follow the topic references for complete guidance and examples.

## Reference index

| Reference | Topics |
| --- | --- |
| [Configuration and modules](references/configuration-and-modules.md) | Compiler defaults, emitted paths, ambient types, deprecated options and syntax, module resolution, imports, CLI inputs |
| [JavaScript and JSDoc](references/javascript-and-jsdoc.md) | Declaration output, required arguments, JSDoc types and scope, overloads, classes, expando properties, CommonJS |
| [Native compiler and tooling](references/native-compiler-and-tooling.md) | Installation, compiler API consumers, nightlies, editors, preview emit limits, compiler workers, native AST offsets |
| [Types and standard libraries](references/types-and-standard-library.md) | Buffer assignability, generic inference, type ordering, declaration checks, Unicode inference, library APIs |

## Breaking changes and deprecations

### Compiler defaults and output paths

The compiler defaults are `strict: true`, `module: esnext`, `target: es2025`,
`noUncheckedSideEffectImports: true`, and `libReplacement: false`. Set `target`
explicitly to pin the emit level: its default follows the latest supported
yearly ECMAScript edition.

With a `tsconfig.json`, `rootDir` defaults to the config's directory. Set
`"rootDir": "./src"` if earlier inference emitted `src/index.ts` as
`dist/index.js` and the new default emits it as `dist/src/index.js`.

The default `types` list is empty. Add `"types": ["node", "jest"]` under
`compilerOptions` when those installed packages' ambient declarations are needed.
Use `"types": ["*"]` to restore discovery of all visible `@types` packages.

A plain `tsc --init` sets `moduleDetection` to `force` and enables
`verbatimModuleSyntax`, `isolatedModules`, `noUncheckedSideEffectImports`,
`declaration`, `declarationMap`, and `sourceMap` in the generated config.

### Buffer types and generic inference

A plain `Uint8Array` with its default `ArrayBufferLike` backing type can fail a
DOM `BufferSource` check. Specify `Uint8Array<ArrayBuffer>` for views backed by
an `ArrayBuffer`, pass `.buffer` to APIs taking the backing buffer, and update
`@types/node` first if errors involve Node.js `Buffer`.

Fixes for leaked type variables can change inferred types or cause new errors
in existing generic calls. Pass intended type arguments explicitly when
inference changes after upgrading.

TypeScript 6.0 can report new errors in function expressions passed to generic
calls, especially generic JSX component callbacks. If a JSX callback fails
because of inference, supply the component's type argument explicitly.

### Replace deprecated configuration

- The `es5` target and any explicit `downlevelIteration` setting, including
  `false`, are deprecated. Use an external compiler for ES5 output.
- Use external build tooling for projects depending on `outFile` or the legacy
  `amd`, `umd`, `systemjs`, or `none` module modes.
- Migrate from `node` / `node10` or `classic` resolution to `--module nodenext`
  for direct Node.js execution, or pair `--moduleResolution bundler` with
  `--module preserve` for bundled projects.
- `baseUrl` is deprecated and its implicit lookup root behavior is going away.
  Replace `"baseUrl": "./src"` plus `"paths": { "@app/*": ["app/*"] }` with
  `"paths": { "@app/*": ["./src/app/*"] }`. Add `"*": ["./src/*"]` to `paths`
  only if bare imports previously relied on resolution under `src`.
- `esModuleInterop: false` and `allowSyntheticDefaultImports: false` are
  deprecated. With interop enabled, use a default import for callable CommonJS
  exports, such as `import express from "express"`.
- `alwaysStrict: false` is deprecated. Update scripts depending on sloppy-mode
  syntax or sloppy-mode `this` behavior.

Set `ignoreDeprecations` to `"6.0"` to keep using options that TypeScript 6.0
deprecates and still supports. TypeScript 7.0 removes those deprecated options.

### Syntax, directives, and compiler inputs

Replace `module Foo {}` with `namespace Foo {}`. Use `declare module "foo" {}`
for ambient modules. The deprecation of import assertions also covers dynamic
imports' `assert` option; use
`import("./config.json", { with: { type: "json" } })`.

Replace `/// <reference no-default-lib="true"/>` with `noLib` to omit default
library declarations, or use `libReplacement` to substitute library declarations.
TypeScript 6.0 ignores `/// <amd-module name="my-module" />`.

If `tsconfig.json` is present, `tsc foo.ts` reports TS5112. Run
`tsc --ignoreConfig foo.ts` to compile the file on its own, or
`tsc -p tsconfig.json` to compile the configured project.

### JavaScript and JSDoc migration

For the native port, review generated JavaScript `.d.ts` files before publishing:
their shape can change, especially with source errors or errors suppressed by
`@ts-ignore` or `@ts-expect-error`.

- Required parameters typed `any`, `unknown`, or `undefined` must be supplied
  even with `strict: false`; calls may still omit a parameter typed `void`.
- Use `typeof value` for a value's type in JSDoc. Use `any` and `string`
  explicitly where code relied on the old treatment of `Object` and `String`.
- JSDoc `{...number}` means `{number[]}`. Variadic calls need a declared rest
  parameter even when the function reads `arguments`.
- TypeScript 7 ignores `@overload` on arrows and other function expressions.
  Declare multiple call signatures in a variable-level `@type`, with an
  implementation return annotation satisfying all signatures.
- Migrate constructor functions and prototype assignments to `class` syntax,
  including functions tagged with `@class` or `@constructor`.
- Replace postfix `T!` in JSDoc types with `T`.

The JavaScript reference includes the remaining JSDoc, property-initialization,
and CommonJS migration rules and examples.

### Compiler API and embedded tooling

Tools using the programmatic compiler API, such as `typescript-eslint`, still
need the 6.0 API. Keep that API at `typescript` with these package aliases:

```json
{
  "devDependencies": {
    "@typescript/native": "npm:typescript@^7.0.2",
    "typescript": "npm:@typescript/typescript6@^6.0.2"
  }
}
```

Run the 7.0 compiler with `npx tsc` or the 6.0 compiler with `npx tsc6`.
Keep TypeScript 6.0 for tooling that embeds the compiler in Vue, MDX, Astro,
and Svelte workflows. Angular projects can use the 7.0 `tsc` for project-wide
checks and keep 6.0 for editor template checking.

The TypeScript 7 language service uses LSP. In VS Code, the
`TypeScriptTeam.native-preview` extension can toggle back to the built-in
TypeScript service for workspaces using legacy language-service plugins.

## Migration checks and tools

In TypeScript 6.0, run `tsc --stableTypeOrdering` to use TypeScript 7.0's type
ordering when comparing declaration output or diagnostics. If it exposes an
inference error, try an explicit type argument or an annotation on the value
passed to the generic function. TypeScript 7.0 always uses stable type ordering;
remove any `stableTypeOrdering: false` setting when upgrading.

The native compiler reports declaration conflicts at every contributing
declaration. A conflict involving a source file can report an error there even
with `skipLibCheck` enabled. A declaration file's
`/// <reference no-default-lib="true" />` no longer exempts it from checking
under `skipDefaultLibCheck` in TypeScript 7.0.

The experimental [ts5to6](https://github.com/andrewbranch/ts5to6) codemod can
adjust `baseUrl` and `rootDir` across a codebase during the upgrade.

## Module and library features

### Module modes and imports

Use `--module node20` to pin module behavior to Node.js 20. When `target` is
omitted, this mode defaults to `es2023`.

TypeScript 6.0 also accepts `--moduleResolution bundler --module commonjs` for
projects needing CommonJS emit during migration.

With `moduleResolution` set to `nodenext` or `bundler`, a package can use
`"imports": { "#/*": "./dist/*" }` in `package.json` and write
`import "#/utils.js"`. On Node.js 20, use a release supporting the `#/` prefix.

Use `import defer` with `--module preserve` or `--module esnext`. TypeScript
emits the namespace import as written, so runtime or bundler support is needed.

```ts
import defer * as feature from "./feature.js";
console.log(feature.value);
```

### Standard-library declarations

- Use `es2025` as a `target` or `lib` value for declarations including
  `RegExp.escape`, `Promise.try`, iterator helpers, and newer `Set` methods.
- Enable `Temporal` types with `target: esnext` and the default libraries, or
  include `esnext.temporal` in `lib`. With runtime support, use expressions
  such as `Temporal.Now.instant().add({ hours: 24 })`.
- The `esnext` library declares `getOrInsert` and `getOrInsertComputed` on both
  `Map` and `WeakMap`. `cache.getOrInsertComputed(key, compute)` calls
  `compute(key)` only when the key is absent.
- The `dom` library includes synchronous and asynchronous iterable declarations
  for DOM APIs. Existing `dom.iterable` and `dom.asynciterable` entries can be
  dropped because those libraries are empty in TypeScript 6.0.

## Native build controls and editor hovers

The experimental `--checkers` flag sets the number of type-checking workers,
defaults to four, and accepts values as low as one. Pin the count across
environments if you need to avoid differences in order-dependent checking results.

With `--build`, experimental `--builders` controls concurrent project-reference
builds. Each active builder can use up to the number of workers set by
`--checkers`; this command can run up to 16 type-checking workers:

```sh
npx tsc --build --builders 4 --checkers 4
```

Use `--singleThreaded` to run parsing, checking, and emit on one thread when
debugging or running with constrained resources.

TypeScript 5.9 raises the default hover length. Set `js/ts.hover.maximumLength`
in VS Code to control how much type information fits before a hover is truncated.

Files in this skill

  • SKILL.md3 KB
  • references/typescript-7-transition.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.