typescript

Enforce Esposter TypeScript conventions banning unsafe patterns and enforcing explicit typings.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill typescript-esposter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/typescript
Command: npx skills add https://github.com/Esposter/Esposter --skill typescript-esposter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces risky TypeScript patterns and enforces project-wide conventions to improve safety and consistency.

Core Features & Use Cases

  • Bans unsafe patterns such as any, Omit, and forEach; prohibits parameter properties and use of private members; enforces guard clauses and explicit enum defaults.
  • Encourages strong typing by preferring interfaces over type aliases and enforcing non-null assertion limitations, with integration of InvalidOperationError for error signaling.
  • Use Case: When writing new TypeScript in Esposter, follow these conventions to produce safer, more maintainable code.

Quick Start

Apply these TypeScript conventions whenever you author code in Esposter to ensure compliance and safety.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce TypeScript conventions to ban unsafe patterns like any and Omit?

To enforce TypeScript conventions and ban unsafe patterns like any and Omit, you apply automated checks that restrict parameter properties, private members, and forEach usage, ensuring safer code.

Why use InvalidOperationError for exception handling in TypeScript projects?

InvalidOperationError signals invalid states during exception handling in TypeScript projects. It enforces explicit error messaging, replacing generic exceptions with strongly typed, robust failure mechanisms.

What is the best way to enforce coding standards for type safety in TypeScript?

The best way to enforce coding standards for type safety is integrating strict linting configurations. This bans unsafe type aliases, enforces interface preferences, and limits non-null assertions.

Does this TypeScript linting approach support static analysis for enum defaults?

Yes, this TypeScript linting approach supports static analysis by enforcing explicit enum defaults. It codifies rules via Markdown frontmatter, enabling automated checks for missing default cases.

When should I avoid parameter properties and private members in TypeScript?

You should avoid parameter properties and private members in TypeScript when writing maintainable code. Enforcing explicit declarations prevents encapsulation leaks and ensures robust, type-safe interfaces.