c/frontend › command
0votes

Cursor rules for Vue 3 + TypeScript

TemplateLow risk
submitted by u/client to c/frontend · 0 copies

A .cursor/rules/vue.mdc file for Composition API, typed props and Pinia stores.

Template · 2 variables
---
description: Vue 3 + TypeScript conventions
globs: ["src/**/*.vue","src/**/*.ts"]
alwaysApply: false
---

# Vue 3

- `<script setup lang="ts">` in every component; no Options API in new code.
- Type props with `defineProps<{ ... }>()` and emits with `defineEmits<{ ... }>()`.
- Shared state in Pinia stores under `src/stores`; components don't talk to the API directly.
- Composables (`useSomething`) in `src/composables` for reusable logic.
- Use `computed` for derived values, not watchers.
- Keep templates simple: move logic over two conditions into computed properties.
- Styling: {{styling_approach}}; scoped styles by default.

## When you change code
- Follow the patterns in the nearest existing file before inventing new ones.
- Add or update a test for behavior changes; run `{{test_command}}`.
- Keep diffs small; explain anything surprising in your reply.
0 commentsreport

How to use this command

  1. Fill in the blanks. Type your details into the boxes above. This command has 2 blanks:
    • {{styling_approach}} Styling approach
    • {{test_command}} Test command
  2. Copy itwith the Copy button. Your answers are filled in automatically. Use “copy raw” to keep the blanks for later.
  3. Paste it into Cursor, Claude, ChatGPT or Codex and send it.
  4. Tip: This produces a file or document. Save the filled-in result in your project (for example as CLAUDE.md or AGENTS.md) so you can reuse it.

More from c/frontend

See all of c/frontend →
0 comments

Log in to join the discussion.