360 Secure SkillHub
360 安全技能中心

typescript

汇集 44 条 TypeScript 7 规则,覆盖类型系统性能、tsconfig 配置、异步、模块、类型安全、内存与运行时优化;按规则查阅说明和正反示例,用于配置、编写与评审代码。

分类:开发
PyModel
热度 0.00
最近更新 2026-11-10 05:27:25

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add pymodel/react-frontend-skills/typescript
兼容性
通用兼容
联网要求
联网要求未确认
数据出网
数据不出本机
Metadata
name
typescript
description
TypeScript 7 types and tsconfig.

TypeScript Best Practices

Comprehensive TypeScript 7 guide with 44 rules across 8 categories, covering compiler configuration, type-system performance, async code, modules, safety, and measured runtime optimization.

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

How to Use

Run in the project root first:

npx -y @pymodel/react-frontend-skills detect   # installed vs. targeted versions

Read references/<rule-id>.md for each rule above that matches the task: why it matters, then incorrect vs. correct code.

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