360 Secure SkillHub
360 安全技能中心

typescript

提供 45 条 TypeScript 规则,覆盖类型系统性能、编译配置、异步模式、模块组织、类型安全、内存管理、运行时优化和高级类型模式,用于代码审查、重构与生成时的参考。

分类:开发
pproenca
热度 0.00
最近更新 2026-10-21 02:07:24

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add pproenca/dot-skills/typescript
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
typescript
description
TypeScript performance, tsconfig, type errors, async patterns — triggered when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type definitions, module organization, or memory management. Does NOT cover TypeScript basics, framework-specific patterns, or testing.

TypeScript Best Practices

Comprehensive performance optimization guide for TypeScript applications. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Configuring tsconfig.json for a new or existing project
  • Writing complex type definitions or generics
  • Optimizing async/await patterns and data fetching
  • Organizing modules and managing imports
  • Reviewing code for compilation or runtime performance

Rule Categories by Priority

Priority Category Impact Prefix
1 Type System Performance CRITICAL type-
2 Compiler Configuration CRITICAL tscfg-
3 Async Patterns HIGH async-
4 Module Organization HIGH module-
5 Type Safety Patterns MEDIUM-HIGH safety-
6 Memory Management MEDIUM mem-
7 Runtime Optimization LOW-MEDIUM runtime-
8 Advanced Patterns LOW advanced-

Table of Contents

  1. Type System Performance — CRITICAL
  2. Compiler Configuration — CRITICAL
  3. Async Patterns — HIGH
  4. Module Organization — HIGH
  5. Type Safety Patterns — MEDIUM-HIGH
  6. Memory Management — MEDIUM
  7. Runtime Optimization — LOW-MEDIUM
  8. Advanced Patterns — LOW

References

  1. https://github.com/microsoft/TypeScript/wiki/Performance
  2. https://www.typescriptlang.org/docs/handbook/
  3. https://v8.dev/blog
  4. https://nodejs.org/en/learn/diagnostics/memory