typescript

Enforce TypeScript rules on *.ts and *.tsx files during linting and CI workflows.

1.2k|116|Updated Mar 22, 2025
One-click install
npx skills add https://github.com/FranciscoMoretti/sparka --skill typescript-franciscomoretti
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/FranciscoMoretti/sparka/tree/main/.skillz/typescript
Command: npx skills add https://github.com/FranciscoMoretti/sparka --skill typescript-franciscomoretti

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates common TypeScript pitfalls and enforces strict typing guidelines, preventing runtime errors and improving code predictability. It promotes robust, maintainable code by discouraging any and enforcing explicit, direct imports, leading to a more reliable and easier-to-understand codebase.

Core Features & Use Cases

  • Strict Typing Enforcement: Prohibits any and unsafe type assertions (as unknown as), ensuring full type safety and reducing unexpected behavior.
  • Clean Imports/Exports: Mandates direct, named exports and avoids problematic barrel files for better tree-shaking and code clarity.
  • Inline Interfaces: Encourages co-locating type definitions with function parameters for immediate context and improved readability.
  • Use Case: Review a TypeScript file to identify and flag any usage of any, as unknown as, or default exports, suggesting refactors to align with project standards and enhance type safety.

Quick Start

Apply the typescript skill to analyze the attached 'dataProcessor.ts' file and suggest improvements based on the project's TypeScript guidelines.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce strict TypeScript typing to catch errors before runtime?

Strict TypeScript enforcement prohibits unsafe patterns like `any` and `as unknown as` type assertions, ensuring full type safety. This Skill applies validation rules to *.ts and *.tsx files, flagging type violations and suggesting refactors to align with strict typing guidelines, reducing unexpected runtime behavior.

What are the best practices for TypeScript imports and exports to improve code quality?

Clean imports and exports mandate direct, named exports and avoid barrel files for better tree-shaking and clarity. This Skill validates your *.ts and *.tsx files against these standards, catching problematic default exports and import patterns that obscure dependencies.

Can I use this to review my TypeScript codebase for `any` type usage?

Yes. This Skill scans *.ts and *.tsx files to identify and flag all `any` usages, unsafe type assertions, and default exports. It integrates into linting and CI workflows, providing actionable suggestions to refactor code toward explicit, type-safe patterns.

How do I co-locate type definitions with functions in TypeScript?

Inline interfaces place type definitions directly within function parameters for immediate context and readability. This Skill validates your *.ts and *.tsx files and suggests moving scattered type definitions closer to their usage points.

Does this work in CI/CD pipelines for continuous TypeScript validation?

Yes. This Skill integrates into CI workflows using the @.claude/rules/typescript.mdc rule set. It automatically validates *.ts and *.tsx files during linting, catching type safety violations early in your build process.

What TypeScript anti-patterns does this catch?

This Skill detects `any` types, unsafe `as unknown as` assertions, default exports, barrel file usage, and scattered type definitions. It flags these anti-patterns in *.ts and *.tsx files and recommends explicit, type-safe alternatives aligned with project standards.