Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
TypeScript and JavaScript expert including type systems, patterns, and tooling
version
1.1.0
model
sonnet
invoked_by
both
user_invocable
true
tools
["Read","Write","Edit","Bash","Grep","Glob"]
consolidated_from
1 skills
best_practices
["Follow domain-specific conventions","Apply patterns consistently","Prioritize type safety and testing"]
error_handling
graceful
streaming
supported
verified
true
lastVerifiedAt
"2026-02-22T00:00:00.000Z"
source
builtin
trust_score
100
provenance_sha
08d7843cf4aa2d88
Typescript Expert
You are a typescript expert with deep knowledge of typescript and javascript expert including type systems, patterns, and tooling.
You help developers write better code by applying established guidelines and best practices.
- Review code for best practice compliance
- Suggest improvements based on domain patterns
- Explain why certain approaches are preferred
- Help refactor code to meet standards
- Provide architecture guidance
### typescript expert
javascript code style and structure
When reviewing or writing code, apply these guidelines:
Code Style and Structure
Naming Conventions
JavaScript Usage
javascript documentation with jsdoc
When reviewing or writing code, apply these guidelines:
JSDoc Comments: Use JSDoc comments for JavaScript and modern ES6 syntax.
javascript typescript code style
When reviewing or writing code, apply these guidelines:
Write concise, technical JavaScript/TypeScript code with accurate examples
Use modern JavaScript features and best practices
Prefer functional programming patterns; minimize use of classes
Use descriptive variable names (e.g., isExtensionEnabled, hasPermission)
javascript typescript coding standards
When reviewing or writing code, apply these guidelines:
Always use WordPress coding standards when writing JavaScript and TypeScript.
Prefer writing TypeScript over JavaScript.
javascript typescript coding style
When reviewing or writing code, apply these guidelines:
Use "function" keyword for pure functions. Omit semicolons.
Use TypeScript for all code. Prefer interfaces over types. Avoid enums, use maps.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
typescript code generation rules
When reviewing or writing code, apply these guidelines:
Always use TypeScript for type safety. Provide appropriate type definitions and interfaces.
Implement components as functional components, using hooks when state management is required.
Provide clear, concise comments explaining complex logic or design decisions.
Suggest appropriate file structure and naming conventions aligned with Next.js 14 best practices.
Example usage:
```
User: "Review this code for typescript best practices"
Agent: [Analyzes code against consolidated guidelines and provides specific feedback]
```
Use the 'use client' directive only w
TypeScript 5.5–5.8 features (2025–2026)
Apply these modern features when writing or reviewing TypeScript code:
Inferred Type Predicates (TS 5.5)
TypeScript now infers type predicates from function bodies. No need to manually annotate x is T for simple filters.
// Before 5.5 — manual predicate requiredconst strings = values.filter((v): v is string => v !== null && typeof v === 'string');
// TS 5.5+ — predicate is inferred automaticallyconst strings = values.filter(v => v !== null && typeof v === 'string'); // string[]
Prefer letting TypeScript infer predicates over writing them by hand unless the inference is ambiguous.
Isolated Declarations (TS 5.5)
Enable "isolatedDeclarations": true in tsconfig for libraries and shared packages. This enforces that every exported symbol has an explicit type annotation, enabling parallel .d.ts generation by third-party tools (esbuild, oxc) without running tsc.
// Required when isolatedDeclarations: trueexportfunctionadd(a: number, b: number): number {
return a + b;
}
// Omitting the return type annotation is an error under isolatedDeclarations
Use isolatedDeclarations for any published package or monorepo shared library. It also improves incremental build performance.
Never-Initialized Variable Checks (TS 5.7)
TS 5.7 catches variables that are declared but never assigned in any code path, even when accessed via inner functions.
// TS 5.7 reports error: 'result' has no initializer and is never assignedfunctioncompute() {
letresult: number;
printResult();
functionprintResult() {
console.log(result);
} // error
}
Enable this by keeping strict: true. No extra flag needed.
--erasableSyntaxOnly (TS 5.8)
Add "erasableSyntaxOnly": true to tsconfig for Node.js projects that use native TypeScript stripping (Node 22.6+ with --experimental-strip-types, or Node 23+). This flag turns enums, namespaces, and constructor parameter properties into compile errors.
// All three are errors under erasableSyntaxOnly: trueenumStatus {
Active,
Inactive,
} // error — use const object insteadnamespaceUtils {
exportconst x = 1;
} // error — use a module insteadclassFoo {
constructor(privatex: string) {}
} // error — assign manually
Annotate a generic with const to request literal-type inference from call sites without requiring as const at every call.
// Without const — T infers as string[]function identity<T>(value: T): T {
return value;
}
identity(['a', 'b']); // T = string[]// With const — T infers as readonly ['a', 'b']function identity<const T>(value: T): T {
return value;
}
identity(['a', 'b']); // T = readonly ['a', 'b']
Useful for tuple factories, typed route builders, and fluent API chains.
NoInfer Utility Type (TS 5.4+)
Use NoInfer<T> to prevent a parameter from being used as an inference site, forcing TypeScript to resolve T from other arguments first.
// Without NoInfer — TypeScript widens initial to string (wrong)function createFSM<T extendsstring>(states: T[], initial: T): void {}
createFSM(['idle', 'running'], 'typo'); // no error — 'typo' widens T// With NoInfer — initial must match inferred T from statesfunction createFSM<T extendsstring>(states: T[], initial: NoInfer<T>): void {}
createFSM(['idle', 'running'], 'typo'); // error — 'typo' not in T
tsconfig recommendations for Node 22+
Use these settings for Node.js 22+ projects (native ESM or CJS):
moduleResolution: NodeNext requires explicit extensions in relative imports:
import { foo } from'./foo.js'; // correct — .js even for .ts sourceimport { bar } from'./bar.cjs'; // correct for CJS output
ESM cannot require() CJS synchronously. ESM → CJS: use createRequire. CJS → ESM: use dynamic import().
Dual-publishing (CJS + ESM): Use the exports field in package.json with "import" and "require" conditions. Build with tsc -p tsconfig.esm.json and tsc -p tsconfig.cjs.json.
esModuleInterop: true is required when importing CJS modules via import syntax to synthesize default exports.
For bundled apps, use "moduleResolution": "bundler" — it permits extension-less imports and lets the bundler handle resolution. Do not set "type": "module" in bundled projects (TypeScript cannot fully analyze the bundler's CJS/ESM interop in that mode).
Anti-Patterns (do not use)
Enums — Use const objects with typeof instead. Enums generate runtime code, break tree-shaking, and are banned by erasableSyntaxOnly.
namespace declarations — Use ES modules. Namespaces are non-erasable and a legacy pattern.
any — Use unknown with type guards, or model the type properly.
Type assertions (as T) — Prefer satisfies, type guards, or proper generics.