typescript-best-practices

Enforce TypeScript coding standards across CodeMie project sources.

267|70|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/codemie-ai/codemie-code --skill typescript-best-practices-codemie-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-best-practices
Source: https://github.com/codemie-ai/codemie-code/tree/main/.codemie/skills/examples/typescript-best-practices
Command: npx skills add https://github.com/codemie-ai/codemie-code --skill typescript-best-practices-codemie-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript codebases often drift away from consistent patterns, leading to maintenance challenges and onboarding friction. This Skill codifies a set of TypeScript best practices to standardize code across a CodeMie Code project.

Core Features & Use Cases

  • Enforces explicit return types for exported functions to improve readability and refactoring safety.
  • Standardizes import conventions (ES module extensions and import grouping) to prevent path-related issues.
  • Promotes type safety by discouraging any usage and encouraging precise typings.
  • Provides project-specific patterns for logging, error handling, and path resolution to improve reliability.
  • Use Case: Teams migrating a TS codebase can apply these rules to ensure consistent style and behavior across modules.

Quick Start

Apply the TypeScript Best Practices guidance to audit your TS sources and surface recommended changes.

Frequently Asked Questions about typescript-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce explicit return types for exported TypeScript functions?

To enforce explicit return types in TypeScript, apply coding standards that require annotations on all exported functions. This improves readability, prevents type drift, and ensures safer refactoring across module sources.

What are the best practices for TypeScript import conventions to prevent path issues?

TypeScript import conventions best practices involve standardizing ES module extensions and grouping imports logically. Applying these rules prevents path-related issues during module resolution and maintains consistent code structure across the project.

How do I standardize error handling and logging in a TypeScript codebase?

Standardizing error handling and logging in TypeScript requires applying project-specific patterns for consistent log generation and error catching. This improves application reliability and ensures maintainable module structure across the entire codebase.

Does this TypeScript standardization approach work for large code migrations?

Yes, this TypeScript standardization approach works for large code migrations. Teams migrating a TS codebase can apply these rules to ensure consistent style, safe imports, and uniform behavior across all newly integrated modules.

How do I discourage the use of 'any' and improve type safety in TypeScript?

To discourage 'any' usage and improve type safety in TypeScript, apply coding standards that promote precise typings over generic structures. This enforces strict type checking and reduces runtime errors across the project.

Why should I audit my TypeScript sources for coding standards?

You should audit TypeScript sources for coding standards because codebases often drift away from consistent patterns, leading to maintenance challenges. Auditing surfaces recommended changes to standardize module structure and behavior.