Skip to main content
rule

vue3 — Cursor rule: Vue 3 standards and setup

A Cursor rule that pins down how the agent writes Vue 3: Composition API, TypeScript, ESLint and Prettier. Useful when more than one person touches the codebase.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/vue3.mdc
Open on GitHub

What vue3 does

The rule spells out a baseline set of conventions for Vue 3 apps. The agent follows them while generating or editing code, so component naming, file layout and tooling stay the same across the project.

Two sections sit inside. The first covers linting and formatting: ESLint paired with Prettier, wired into the IDE for feedback as you type and format-on-save. The second covers code organisation. Every component gets its own .vue file, and filenames use PascalCase, which matches how components are referenced in templates and helps editor autocompletion.

You drop the rule in as .cursor/rules/vue3.mdc, and it applies to files matching **/*.{js,jsx,ts,tsx,vue}. Without ESLint and Prettier already configured in the project, some of the guidance stays theoretical — the agent will point at tools your build does not run.

What it helps with

  • keep code style consistent across a team
  • split Vue components into separate files
  • rename .vue files to PascalCase
  • hook ESLint and Prettier into the editor
  • write typed components with the Composition API

Example prompts for the agent

  • Create a TodoList.vue component using the Composition API with types
  • Split this component into separate .vue files following the project rules
  • Rename the component files to PascalCase and fix the imports

How to install vue3

Manually: put the files in place

.cursor/rules/vue3.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about vue3

How do I install vue3 in Cursor?

Create .cursor/rules/vue3.mdc in your project root and paste the rule contents into it.

What does the vue3 rule do?

It gives the Cursor agent Vue 3 conventions: ESLint and Prettier, one .vue file per component, PascalCase filenames, Composition API and TypeScript.

Which files does the rule apply to?

Files matching **/*.{js,jsx,ts,tsx,vue} — the scripts and components in your project.

Source text

vue3.mdc · CC0-1.0
---
description: Definitive guidelines for building maintainable, performant, and type-safe Vue 3 applications using modern best practices, Composition API, and TypeScript.
globs: **/*.{js,jsx,ts,tsx,vue}
---
# Vue 3 Best Practices

This guide outlines the essential rules for developing high-quality Vue 3 applications. Adhere to these standards to ensure consistency, readability, and long-term maintainability across our codebase.

## 1. Foundational Setup: Linting & Formatting

**Always use ESLint and Prettier.** This combination enforces consistent code style and catches common errors automatically, streamlining development and code reviews. Integrate them into your IDE for real-time feedback and format-on-save.

## 2. Code Organization & Naming

### 2.1. Single-File Components (SFCs)
Each component **must** reside in its own `.vue` file.

❌ BAD
```js
// app.component('TodoList', { /* ... */ })
// app.component('TodoItem', { /* ... */ })
```

✅ GOOD
```
components/
├── TodoList.vue
└── TodoItem.vue
```

### 2.2. SFC Filename Casing
Use **PascalCase** for all SFC filenames. This aligns with component referencing in templates and JS(X) and improves editor autocompletion.

❌ BAD
```
components/
├── my-component.vue
└── myComponent.vue
```

© sanjeed5 · CC0-1.0 · sanjeed5/awesome-cursor-rules-mdc

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set87

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor