typescript-guide
/typescript-guide
Podpowiada przy edycji i przeglądzie TypeScript w projektach Node.js ESM: funkcje async, wnioskowanie typów, tryb strict, importy ESM i zmienne środowiskowe.
- Autor
- xonovex ↗
- Repozytorium
- platform ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 08.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 12
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Podpowiada przy edycji i przeglądzie TypeScript w projektach Node.js ESM: funkcje async, wnioskowanie typów, tryb strict, importy ESM i zmienne środowiskowe.
Wyzwalacze z opisu
Oryginalny opis (EN)
Use when editing or reviewing TypeScript in Node.js ESM projects. Triggers on `.ts` files, ESM `package.json`, and prompts about async functions, type inference, strict mode, ESM imports, env handling, template literals, even when the user doesn't say 'TypeScript'.
Jak działa
- Requirements
- Essentials
- Gotchas
- Progressive disclosure
Podgląd SKILL.md
---
name: typescript-guide
description: "Use when editing or reviewing TypeScript in Node.js ESM projects. Triggers on `.ts` files, ESM `package.json`, and prompts about async functions, type inference, strict mode, ESM imports, env handling, template literals, even when the user doesn't say 'TypeScript'."
---
# TypeScript Coding Guidelines
Write strict TypeScript modules with explicit types, direct imports, and checked errors.
## Requirements
- Node.js ESM, TypeScript ≥ 5.8, Vitest ≥ 3, Zod ≥ 4.
## Essentials
- **Strict mode** - Enable strict flags, avoid `@ts-ignore` without comment+issue
- **Type safety** - Explicit public types, `unknown` over `any`, derive from generated types
- **Imports** - Use `import type` for type-only imports
- **Async/await** - Handle errors explicitly, only use `async` with `await`, see [references/async-without-await.md](references/async-without-await.md), [references/unnecessary-async-keywords.md](references/unnecessary-async-keywords.md)
- **Immutability** - Use `const`/`readonly` where possible
- **Validation** - Zod for I/O boundaries, infer types from schemas
- **Linting** - Never suppress with eslint-disable, fix root causes, see [references/avoid-eslint-disable.md](references/avoid-eslint-disable.md)
- **Template literals** - Convert numbers with `String(value)`, see [references/template-literals-require-string-conversion.md](references/template-literals-require-string-conversion.md)
- **Numeric literals** - Use underscores in large numbers (`30_000`), see [references/numeric-separator-enforcement.md](references/numeric-separator-enforcement.md)
- **Method references** - Keep object references to maintain `this` binding, see [references/unbound-method-references.md](references/unbound-method-references.md)
- **Environment** - Use dot notation for `process.env` access, see [references/env-access-bracket-notation.md](references/env-access-bracket-notation.md)
- **Paradigm** - Functional style → **fp-guide**; class/OO design → **oop-guide**
## Gotchas
- Structural typing means `{ a: string }` accepts `{ a: string, b: number }` silently: explicit `satisfies` is the way to catch unintended extras
- `as` casts bypass the type system without check: prefer narrowing functions (type predicates) over casts
- `type` vs `interface`: interfaces merge across declarations, types don't. `declare global { interface Window { ... } }` works, `type Window = ...` doesn't
- `unknown` is the safer `any`, but it doesn't propagate; narrowing once doesn't carry across assignments
- Module resolution depends on `tsconfig` `moduleResolution` (`bundler` vs `node16` vs `nodenext`): wrong choice silently breaks deep imports
## Progressive disclosure
- Read [references/async-without-await.md](references/async-without-await.md) - Load when seeing async functions that don't use await
- Read [references/unnecessary-async-keywords.md](references/unnecessary-async-keywords.md) - Load when simplifying synchronous controller functions
- Read [references/avoid-eslint-disable.md](references/avoid-eslint-disable.md) - Load when tempted to suppress linting warnings
- Read [references/template-literals-require-string-conversion.md](references/template-literals-require-string-conversion.md) - Load when inserting numbers in template literals
- Read [references/numeric-separator-enforcement.md](references/numeric-separator-enforcement.md) - Load when writing large numeric literals
- Read [references/unbound-method-references.md](references/unbound-method-references.md) - Load when passing methods as callbacks or references
- Read [references/env-access-bracket-notation.md](references/env-access-bracket-notation.md) - Load when accessing process.env variables
Pliki w paczce (12)
- SKILL.md 4 KB
- SOURCES.md 1 KB
- eval-queries.json 4 KB
- evals.json 2 KB
- moon.yml 1 KB
- references/async-without-await.md 1 KB
- references/avoid-eslint-disable.md 1 KB
- references/env-access-bracket-notation.md 1 KB
- references/numeric-separator-enforcement.md 1 KB
- references/template-literals-require-string-conversion.md 1 KB
- references/unbound-method-references.md 1 KB
- references/unnecessary-async-keywords.md 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · xonovex/platform | 90 | MIT |
| ar4mirez/samuel | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki b537b495c719 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90conventions-typescript
Podpowiada domyślne zasady TypeScriptu i Node.js: ścisła konfiguracja, walidacja na granicach, obsługa błędów i ESM. - 100node
Prowadzi po środowisku Node.js w projektach TypeScript: async/await i Promises, strumienie, wybór ESM lub CommonJS, exports w package.json, wybór npm, pnpm lub bun, mise i CI/CD. - 100typescript-node-conventions
Ustala konwencje TypeScript dla kodu na Node.js lub Bun: typowanie, granicę ESM i CJS, obsługę błędów i asynchroniczność. - 100typescript-node-stinger
Recenzuje kod TypeScript i Node: typy SvelteKit, tsconfig, ESM, granice Zod, testy i budowanie pakietów npm. - 100typescript
Rozwiązuje problemy z TypeScript: błędy kompilatora, tsconfig, wnioskowanie typów, generyki, ESM i CJS oraz monorepo. - 100typescript-patterns
Podpowiada wzorce systemu typów TypeScript, typy narzędziowe i zasady trybu strict przy pisaniu i przeglądzie kodu.