conventions-typescript
/conventions-typescript
TypeScript and Node.js default conventions — strict config, runtime validation at boundaries, unions over flags, error handling, ESM, exports, async. Use when writing TS/JS code, configuring tsconfig or package.json, or debugging type errors.
- Author
- bitIO ↗
- Repository
- wheelhouse ↗
- Licence
- MIT
- Last repository change
- 12.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
TypeScript and Node.js default conventions — strict config, runtime validation at boundaries, unions over flags, error handling, ESM, exports, async. Use when writing TS/JS code, configuring tsconfig or package.json, or debugging type errors.
Original author description
TypeScript and Node.js default conventions — strict config, runtime validation at boundaries, unions over flags, error handling, ESM, exports, async. Use when writing TS/JS code, configuring tsconfig or package.json, or debugging type errors.
How it works
- Types
- Errors
- Modules and async
- Tooling
SKILL.md preview
--- name: conventions-typescript description: TypeScript and Node.js default conventions — strict config, runtime validation at boundaries, unions over flags, error handling, ESM, exports, async. Use when writing TS/JS code, configuring tsconfig or package.json, or debugging type errors. --- The repo's own conventions (`AGENTS.md`, `tsconfig`, lint rules) win over these. ## Types - **`strict: true`**, plus `noUncheckedIndexedAccess` on new projects. No `any` without a comment explaining why; use `unknown` and narrow it. - **Types don't validate input.** Parse everything that crosses a boundary (HTTP bodies, env vars, files, third-party responses) with a schema (zod, valibot) and derive the type from the schema. - **Discriminated unions** for states and results, instead of boolean flags. - **`as const` objects or string-literal unions** instead of `enum`. Use `satisfies` to check a value without widening it. - `import type` for type-only imports. ## Errors - **Expected failures are values** (`Result<T, E>` or a discriminated union). `throw` is for programmer errors and truly exceptional cases. - Never swallow errors: no empty `catch`, and no `catch` that only logs and continues as if nothing happened. ## Modules and async - **ESM** unless the project is CommonJS. Prefer `node:` built-ins and existing dependencies over adding packages. - **Named exports**, except where a framework requires a default export (Next.js pages, layouts and route files; config files). - **`async/await`**; don't mix it with `.then()` in the same function. Never leave floating promises. Use `AbortSignal` for cancellable work and timeouts on all I/O. - Top-level `await` only in entry points. ## Tooling - Node version pinned in `.nvmrc` and `engines`. Lockfile committed. pnpm or npm workspaces for monorepos.
Versions
The database has no other skills named conventions-typescript.
Database snapshot: 13.11.2026 · package version 59fa3f7054a6 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90typescript-guide
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'. - 100typescript-node-conventions
Use when writing, reviewing, or setting conventions for TypeScript code that runs on Node.js or Bun — strict typing discipline (strict mode, unknown over any, no implicit any), the ESM/CJS module interop boundary (moduleResolution, verbatimModuleSyntax, package.json exports… - 100typescript-node-stinger
Review TypeScript and Node code. Use for SvelteKit types, tsconfig, ESM, Zod boundaries, testing, or npm package builds. Read README.md for the guide map. - 100typescript
Enforces modern TypeScript best practices for type-safe code, strict configuration, runtime validation, and clear type contracts. Use when writing or reviewing TypeScript/JavaScript code, configuring tsconfig.json, or when the user asks for TypeScript style guidance. - 90fe-typescript
Writes and reviews TypeScript for front-end apps (TypeScript 7, React, Vue, Svelte, Angular, Astro) - strict config, no any, types checked at the boundaries (API, storage, forms), narrowing instead of casts, a tsconfig that builds on 6 and 7. Use when editing .ts or .tsx files… - 100node
Guide for the Node.js runtime in TypeScript projects. Use when working with async/await and Promises, reading or writing streams, choosing between ESM and CommonJS, configuring package.json exports, picking npm/pnpm/bun, managing Node versions with mise, or wiring Node CI/CD.