typescript

Enforce strong typing and coding conventions for Vue 2/3 TypeScript projects.

15.9k|914|Updated Aug 16, 2023
One-click install
npx skills add https://github.com/scalar/scalar --skill typescript-scalar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/scalar/scalar/tree/main/.agents/skills/typescript
Command: npx skills add https://github.com/scalar/scalar --skill typescript-scalar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript and Vue development often suffers from weak typings, inconsistent conventions, and hard-to-maintain code. This Skill provides a clear set of guidelines to enforce strong typing, readable code, and predictable Vue composition patterns.

Core Features & Use Cases

  • Enforces explicit props and emits typing in Vue components.
  • Guides on using defineProps, defineEmits, readonly patterns, and safe return types.
  • Improves maintainability and code quality across teams through consistent documentation and typing conventions.
  • Use Case: A team migrating a large Vue project to TypeScript can adopt these guidelines to standardize component APIs and composables.

Quick Start

Add explicit type annotations to your Vue components (props, emits, and setup returns) and start applying strong typing across your composables and utilities.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce explicit type annotations for Vue component props and emits?

Yes, using readonly patterns in Vue composables enforces strong typing by preventing unintended mutations, ensuring that data structures returned from setup functions remain predictable and strictly type-safe across your application.

What is the best way to standardize TypeScript conventions for a large Vue project?

Yes, these TypeScript and Vue typing guidelines are designed for frontend projects using Vue 2 or Vue 3 with TypeScript, making them suitable for maintaining code quality across both legacy and modern component architectures.

Why does my Vue composable lose type safety when returning complex objects?

Vue composables lose type safety without enforced return types and readonly patterns, so applying explicit type annotations to setup returns ensures the consuming components receive strictly typed and immutable data structures.

How do I migrate a Vue project to TypeScript without breaking existing composables?

To migrate a Vue project to TypeScript, apply explicit type annotations to component APIs and composables, adopting defineProps, defineEmits, and safe return types to standardize interfaces and prevent runtime type errors.