forge-lang-typescript

martimramos's avatarfrom martimramos

TypeScript development standards including type checking, jest/vitest, eslint, and prettier. Use when working with TypeScript files, tsconfig.json, or .ts/.tsx files.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 21, 2025

When & Why to Use This Skill

The forge-lang-typescript skill establishes comprehensive TypeScript development standards by integrating essential tools for type safety, automated testing, and code quality. It provides a standardized environment using tsc for type checking, Jest/Vitest for testing, and ESLint/Prettier for linting and formatting, ensuring high-quality maintainable codebases for .ts and .tsx projects.

Use Cases

  • Project Standardization: Quickly set up new TypeScript projects with industry-standard tsconfig.json templates and optimized npm scripts.
  • Automated Quality Assurance: Implement continuous type checking and linting to catch syntax and logic errors early in the development lifecycle.
  • Test-Driven Development (TDD): Streamline the Red-Green-Refactor cycle using integrated Jest/Vitest commands for unit testing and coverage reporting.
  • Code Consistency: Maintain a uniform coding style across development teams by automating formatting with Prettier and enforcing rules via ESLint.
  • CI/CD Integration: Utilize standardized 'check' scripts to validate code quality and test passes before deployment or merging.
nameforge-lang-typescript
descriptionTypeScript development standards including type checking, jest/vitest, eslint, and prettier. Use when working with TypeScript files, tsconfig.json, or .ts/.tsx files.

TypeScript Development

Type Checking

# Check types without emitting
npx tsc --noEmit

# Watch mode
npx tsc --noEmit --watch

Testing

# Run all tests
npm test

# Run with coverage
npm test -- --coverage

# Run in watch mode
npm test -- --watch

# Run specific test
npm test -- --testPathPattern=module.test

Linting

# Run eslint
npm run lint

# Fix auto-fixable issues
npm run lint -- --fix

# Type-aware linting (if configured)
npx eslint --ext .ts,.tsx src/

Formatting

# Format with prettier
npm run format

# Check without changing
npx prettier --check .

Project Structure

project/
├── src/
│   ├── index.ts
│   ├── types.ts
│   └── module.ts
├── tests/
│   └── module.test.ts
├── package.json
├── tsconfig.json
└── README.md

tsconfig.json Template

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

package.json Scripts

{
  "scripts": {
    "build": "tsc",
    "test": "jest",
    "lint": "eslint src/",
    "format": "prettier --write .",
    "typecheck": "tsc --noEmit",
    "check": "npm run typecheck && npm run lint && npm run test"
  }
}

TDD Cycle Commands

# RED: Write test, run to see it fail
npm test -- --testPathPattern=new_feature

# GREEN: Implement, run to see it pass
npm test -- --testPathPattern=new_feature

# REFACTOR: Clean up, ensure tests still pass
npm run check