typescript-strict
Use when writing TypeScript with strict mode - covers type definitions, generics, and declaration files
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when writing TypeScript with strict mode - covers type definitions, generics, and declaration files
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when configuring ESLint - covers flat config, TypeScript integration, and custom rules
Use when creating GitHub Actions workflows - covers CI/CD, matrix testing, and release automation
Use when writing Jest tests - covers testing patterns for interpreters, parsers, and async code
Use when designing language features - covers lexer, parser, AST, and interpreter patterns
Use when implementing Language Server Protocol features - covers completions, hover, diagnostics, and navigation
Use when creating Mermaid diagrams - covers flowcharts, sequence diagrams, and AST visualization
| name | typescript-strict |
| description | Use when writing TypeScript with strict mode - covers type definitions, generics, and declaration files |
// Enable strict in tsconfig.json
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}
undefined and null explicitlyanyreadonly for immutable data// Discriminated union for AST nodes
type Expr =
| { type: "NumberLiteral"; value: number }
| { type: "BinaryExpr"; op: string; left: Expr; right: Expr }
| { type: "Identifier"; name: string };
// Type guard
function isNumberLiteral(expr: Expr): expr is Extract<Expr, { type: "NumberLiteral" }> {
return expr.type === "NumberLiteral";
}
// Constrained generics
function map<T, U>(arr: readonly T[], fn: (item: T, index: number) => U): U[] {
return arr.map(fn);
}
// Conditional types
type Unwrap<T> = T extends Promise<infer U> ? U : T;
// module.d.ts
declare module "lea-lang" {
export function run(code: string): unknown;
export function parse(code: string): Program;
}
unknown over any for safer type narrowinginterface for extendable types, type for unionsas const for literal typessatisfies for type checking without widening