typescript

Enforce TypeScript coding standards for .ts and .tsx files.

2|Updated Aug 8, 2024
One-click install
npx skills add https://github.com/walid-mos/mac-config --skill typescript-walid-mos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/walid-mos/mac-config/tree/main/claude/.claude/skills/typescript
Command: npx skills add https://github.com/walid-mos/mac-config --skill typescript-walid-mos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that TypeScript code adheres to modern best practices, improving code quality, maintainability, and reducing common errors.

Core Features & Use Cases

  • Import Standards: Enforces consistent and efficient import statements.
  • Function Syntax: Promotes the use of arrow functions for better predictability.
  • Type Safety: Guides against the misuse of any and as casting, promoting robust typing.
  • Pattern Enforcement: Encourages patterns like discriminated unions and result types for clearer error handling and state management.
  • Use Case: When writing new TypeScript components or reviewing pull requests, use this Skill to ensure all code follows established standards for imports, functions, and type definitions.

Quick Start

Apply the typescript skill to review the provided TypeScript code for adherence to best practices.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce TypeScript best practices for imports and type safety?

Enforce TypeScript best practices by applying code standards to .ts and .tsx files, focusing on import syntax, function declarations, and type definitions. This ensures adherence to rules regarding import statements, arrow functions, and type safety.

What TypeScript code standards should I follow for type definitions and casting?

TypeScript code standards require avoiding the misuse of `any` and `as` casting to promote robust typing. Adhering to these specific rules during development and review ensures improved maintainability and reduces common errors.

How do I review TypeScript code for discriminated unions and result types?

Review TypeScript code by checking for established patterns like discriminated unions and result types, which provide clearer error handling and state management. This Skill evaluates .ts and .tsx files to ensure these coding patterns are used.

Can I use this TypeScript skill to review pull requests for code standards?

Yes, you can use this Skill to review pull requests and ensure all code follows established standards for imports, functions, and type definitions. It applies to the development and review of .ts and .tsx files.

Does this TypeScript skill work with .tsx files?

Yes, this TypeScript skill works with both .ts and .tsx files. It applies to the development and review process, enforcing specific rules regarding import syntax, function declarations, and type definitions across both file extensions.

Why should I use arrow functions in TypeScript code?

Use arrow functions in TypeScript code to achieve better predictability in function declarations. This Skill promotes arrow functions as part of its core features to enforce consistent and efficient coding standards.