type-system-governance

Enforce TypeScript type definitions in the /types directory during development and code reviews.

2|Updated Apr 9, 2023
One-click install
npx skills add https://github.com/Esdeveniments/esdeveniments-frontend --skill type-system-governance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: type-system-governance
Source: https://github.com/Esdeveniments/esdeveniments-frontend/tree/main/.github/skills/type-system-governance
Command: npx skills add https://github.com/Esdeveniments/esdeveniments-frontend --skill type-system-governance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams maintain a clean, scalable TypeScript codebase by enforcing that all types live in the /types directory, preventing inline type definitions and duplication across components.

Core Features & Use Cases

  • Enforces canonical type placement: ensures new types (interfaces, DTOs, props) are defined under /types.
  • DRY, predictable imports: reduces duplicate types and simplifies import paths.
  • Use Case: When adding a ButtonProps type, place it in types/props.ts and import as types/props in components.

Quick Start

  • Enable ESLint rules around a dedicated types directory, run yarn lint, and adjust any inline types to use /types as canonical sources.

Frequently Asked Questions about type-system-governance

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

FAQPage Schema
How do I enforce a single TypeScript types directory to prevent inline type definitions?

To enforce a single TypeScript types directory, configure ESLint rules around a dedicated /types folder and run yarn lint. This prevents inline type definitions by ensuring new interfaces, DTOs, and props are placed in canonical files and consistently imported across your codebase.

What is the best way to organize TypeScript types to avoid duplicate definitions across components?

The best way to organize TypeScript types is centralizing them in a /types directory. This approach prevents duplicate definitions across components by making /types the canonical source for all interfaces and props, ensuring DRY and predictable import paths throughout your project.

How do I move inline TypeScript types like ButtonProps into a centralized types folder?

To move inline TypeScript types like ButtonProps into a centralized folder, extract the type definition and place it in a file such as types/props.ts. Then, adjust your components to import these types from the /types directory to maintain import consistency.

Can I use ESLint to enforce code organization rules for TypeScript interfaces and DTOs?

Yes, you can use ESLint to enforce code organization rules for TypeScript interfaces and DTOs. By enabling specific ESLint rules around a dedicated /types directory, the linter flags inline type definitions and ensures all new types are placed in canonical files.

Why should I keep all TypeScript types in a /types directory during code reviews?

You should keep all TypeScript types in a /types directory during code reviews to maintain a clean, scalable codebase. This practice prevents inline type definitions and duplication, ensuring new interfaces and props are consistently imported from canonical files.