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.
.cursor/rules/vue3.mdcWhat 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
.vuefiles to PascalCase - hook ESLint and Prettier into the editor
- write typed components with the Composition API
Example prompts for the agent
- Create a
TodoList.vuecomponent using the Composition API with types - Split this component into separate
.vuefiles 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.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/vue3.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/vue3.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/vue3.mdManually: put the files in place
.clinerules/vue3.mdStep 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