لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Configuring TypeScript

آزاد تازه‌وارد تاییدشده امن

در طراحی مسیرهای سرور، فرم‌ها، فرانت‌اند مدرن و ارتباط امن کلاینت و سرور طبق استانداردهای روز کمک می‌کند. (شامل ۸ گام عملی · سازگار با Claude Code).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: configuring-typescript
description: Set up strict tsconfig files with the @famiglio/typescript-config presets for Node.js libraries and apps, Express, React with Vite, Next.js, Astro, SvelteKit, and Cloudflare Workers. Separates type-checking (tsconfig.json), building (tsconfig.build.json), and tests (tests/tsconfig.json). Use when creating or changing tsconfig*.json files, or when writing code under these strict options.
license: MIT
compatibility: Requires typescript 5.5 or later (5.7 for build/node-native.json). Tested with TypeScript 6.
metadata:
  author: famiglio
  category: tooling
---

# Configuring TypeScript

Use strict settings, and give checking, building, and tests separate projects, so test types never reach the source and the build never holds test files.

## Prerequisites

- Know whether the project runs in Node.js or uses a bundler, and which test runner it uses.
- Read the existing `tsconfig*.json` files before you change them.

## Procedure

1. **Install:**

   ```bash
   pnpm add -D @famiglio/typescript-config typescript @types/node
   ```

   `sbx init` does not set up TypeScript. If the project also uses ESLint, keep TypeScript earlier than 6.1: `typescript-eslint` does not support TypeScript 7.

2. **Choose the presets** with [presets](references/presets.md). `check/` presets type-check without writing files, `build/` presets compile `src` to `dist`:

   ```json
   { "extends": "@famiglio/typescript-config/check/node-library.json" }
   ```

3. **Give the tests their own project,** `tests/tsconfig.json` (or `e2e/tsconfig.json` for Playwright). List the `check/` preset first, then one `test/` preset:

   ```json
   {
     "extends": [
<!-- ‹guest · 2026-12-05› -->
       "@famiglio/typescript-config/check/node-library.json",
       "@famiglio/typescript-config/test/vitest.json"
     ]
   }
   ```

   The `test/` presets are `vitest.json`, `vitest-globals.json`, `jest.json`, `node-test.json`, and `playwright.json`. Never use one alone: it has no strict settings.

4. **Add the scripts:**

   ```json
   "build": "tsc -p tsconfig.build.json",
   "lint:types": "tsc -p tsconfig.json && tsc -p tests"
   ```

   The build writes `dist/tsconfig.tsbuildinfo`: keep `*.tsbuildinfo` out of Git and out of the published package.

5. **Write code that the strict options accept**, with [strict code](references/strict-code.md).

6. **In VS Code**, use the project's TypeScript: set `"js/ts.tsdk.path": "node_modules/typescript/lib"` in `.vscode/settings.json`.

## Verification

```bash
pnpm exec tsc -p tsconfig.json
test ! -d tests || pnpm exec tsc -p tests
test ! -f tsconfig.build.json || pnpm exec tsc -p tsconfig.build.json
```

Every command finds no errors.

For the common errors, see [strict code](references/strict-code.md).

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
کیفیت کد و تست
✦ Pro

REA bug fix

علت ریشه‌ای خطاها و کرش‌ها را از روی لاگ و مسیر اجرا پیدا می‌کند و به‌جای حدس زدن، اصلاح هدفمند پیشنهاد می‌دهد. (شامل ۶…

⚡ /rea-bug-fix SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۴۸۶,۴۸۷
کیفیت کد و تست
✦ Pro

REA CI and tests audit

«REA CI and tests audit» دستورالعمل دقیقی برای «نوشتن و اجرای تست خودکار» در اختیار دستیار هوش مصنوعی می‌گذارد تا نتیجه…

⚡ /rea-ci-tests-audit SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۴۷۴,۰۸۴
کیفیت کد و تست
✦ Pro

Finishing a Development Branch

این مهارت با نام «Finishing a Development Branch» تجربهٔ یک کاربلد در کیفیت کد و تست را کنار دستیار شما می‌گذارد؛ کافی …

⚡ /finishing-a-development-branch SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Code Review Reception

اگر روی کیفیت کد و تست کار می‌کنید، «Code Review Reception» بخشی از کار را از دوش شما برمی‌دارد: «بازنویسی و تمیزسازی ک…

⚡ /receiving-code-review SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Requesting Code Review

برای کارهای کیفیت کد و تست، «Requesting Code Review» یک راهنمای کوتاه و روشن است: مسیر «مدیریت هوشمند حافظه و کانتکست» …

⚡ /requesting-code-review SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Test-Driven Development (TDD)

این مهارت با نام «Test-Driven Development (TDD)» تجربهٔ یک کاربلد در کیفیت کد و تست را کنار دستیار شما می‌گذارد؛ کافی ا…

⚡ /test-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰