home/coding/typescript-standards-instructions

Typescript Standards.instructions

GPTClaudeDeepSeek··1,320 copies·updated 2026-07-14
typescript-standards-instructions.prompt
# TypeScript Best Practices

Apply strict TypeScript standards for type-safe, maintainable code.

You should always follow these TypeScript guidelines:

## Type Safety

- Enable `strict: true` in tsconfig.json
- Avoid `any` type - use `unknown` if truly dynamic
- Define explicit return types for functions
- Use union types instead of enums when appropriate
- Leverage type guards and narrowing

## Interfaces vs Types

- Use `interface` for object shapes
- Use `type` for unions, intersections, primitives
- Prefer composition over complex inheritance

## Best Practices

when to use it

Community prompt sourced from the open-source GitHub repo AmadeusITGroup/ai-primitives-hub (Apache-2.0). A "Typescript Standards.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

AmadeusITGroup/ai-primitives-hub · Apache-2.0