# Typescript

> Guidelines when working on TypeScript/JS projects

- Skill: `nazozokc/typescript` (Agent Skill)
- Install (CLI): `npx skillmds@latest add nazozokc/typescript`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nazozokc/typescript/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: nazozokc (https://skillmd.com/u/nazozokc)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/nazozokc/typescript

---


# TypeScript Development Guidelines

## Basic Principles

- **Type safety first**: Avoid `any` — define types explicitly
- **Never leave errors**: Address all TypeScript errors immediately
- **Strict mode**: Use strict type checking whenever possible

## Coding Conventions

- Prefer explicit type declarations over relying on inference
- Use `@types/*` packages for third-party type definitions
- Use `typeof` or type guards for `unknown` types
- Express optional properties with `?`

## Error Handling Priority

1. Fix type errors on the spot
2. Resolve warnings whenever possible
3. If a warning must remain, document the reason in a comment

## Lint / Format

- If `biome.json` exists at project root, use `biome check`
- Otherwise use `eslint . --ext .ts`
- If neither exists, ask the user

## What to Verify

- Confirm no errors with `tsc --noEmit`
- Check the project's lint rules before starting

