vue-typescript_skill

This skill helps you master Vue TypeScript by creating type-safe components, generics, and advanced patterns across a Vue 3 app.
  • Python

1

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill pluginagentmarketplace/custom-plugin-vue --skill vue-typescript

  • SKILL.md7.0 KB

Overview

This skill teaches production-grade TypeScript integration for Vue 3 applications, focusing on type-safe components, generics, type inference, and advanced type patterns. It provides a modular learning path, configuration guidance, reusable patterns for composables and stores, and validation checkpoints to measure progress.

How this skill works

The skill walks through TypeScript setup for Vue (tsconfig, Volar, env.d.ts, vue-tsc), then teaches typed components, generic components, typed composables/stores, and advanced utility types. It includes examples, unit test templates, troubleshooting steps, and retry/observability hooks to validate learning and CI workflows.

When to use it

  • Starting a new Vue 3 project that needs robust static typing
  • Migrating JavaScript Vue components to TypeScript safely
  • Building reusable generic components or typed composables
  • Ensuring Pinia stores and composables are type-safe
  • Reducing runtime errors by catching types at build time

Best practices

  • Enable strict mode in tsconfig and use vue-tsc for build-time checks
  • Use Volar in the editor to get accurate template type feedback
  • Prefer defineProps/defineEmits with explicit interfaces and withDefaults for defaults
  • Create generic components with constrained generics (e.g., T extends { id: string | number })
  • Type composable returns and Pinia stores with explicit interfaces
  • Introduce utility types (ExtractProps, DeepPartial) to keep code DRY and predictable

Example use cases

  • A generic list component that accepts any item type constrained by id and exposes a typed select event
  • A typed useFetch<T> composable that returns Ref<T | null>, error, loading, and an execute function
  • A Pinia user store with strongly typed state, getters, and async actions
  • Augmenting route meta types for typed route-based permissions and layout metadata
  • Unit testing a generic component with mount<GenericComponent<T>> to assert typed emits and slots

FAQ

Yes. Generic component syntax and template-level inference are best supported in Vue 3.3 and newer; upgrade if generics don't behave as expected.

How do I fix missing module errors for Vue types?

Add an env.d.ts with the appropriate declaration files and ensure tsconfig includes src/**/*.vue and src/**/*.ts, then enable Volar and run vue-tsc.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational