English
Rules
Enable the rules you need explicitly in your ESLint configuration. The plugin has no built-in configurations; see Getting Started for registration and parser setup.
Choose by Goal
- Callbacks and Composables
- Macros and Component Models
- Refs and Result Names
- Component Usage Contracts
- Template Conventions
- Statement Ordering
See Rule Composition for complementary checks, configuration examples, and interactions with other plugins.
Scope and Defaults
- Template means Vue SFC templates, parsed with
vue-eslint-parser. - Setup means the SFC's
<script setup>block; TS setup additionally requires TypeScript syntax and its script parser. - Scripts includes Vue script blocks and standalone JavaScript/TypeScript files. Individual rules still restrict which definitions or API calls they check.
Component prop, slot, and generic-comment rules need explicit targets and do nothing with their default empty target lists. no-restricted-html-elements also needs an explicit elements list. Other target-based rules may have built-in targets; consult their option documentation before replacing them.
For auto-imported Vue APIs, see auto-import configuration. Individual rule pages document their options and defaults.
All Rules
Automatic fixes apply only to documented supported cases. A fixable rule can also report problems that require manual changes. See Automatic Fixes for the boundaries.
Callbacks and Composables
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| callback-style | Enforce callback styles for Vue APIs. | Scripts | Supported cases |
| max-lines-per-callback | Limit the length of inline callbacks for Vue APIs. | Scripts | — |
| no-reactive-composable-return | Disallow returning Vue reactive proxies directly from composables. | Scripts | — |
| no-watcher-cleanup-after-await | Disallow calling onWatcherCleanup after await in inline Vue watcher callbacks. | Scripts | — |
| prefer-composable-options | Prefer a final options object for composable parameters. | Scripts | — |
| prefer-function-declaration | Require function declarations in SFCs and composables. | Scripts | — |
| prefer-on-scope-dispose | Prefer scope-based cleanup in named Vue composables. | Scripts | — |
| prefer-watch-effect-alias | Prefer dedicated aliases for post and sync watch effects. | Scripts | Supported cases |
| require-composable-return-bindings | Require composable return fields to expose local bindings. | Scripts | — |
| require-injection-key | Disallow string keys in Vue provide and inject calls. | Scripts | — |
Macros and Component Models
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| define-macros-newline | Require multiline inline Vue macro declarations. | Setup | Supported cases |
| define-macros-type-style | Enforce declaration styles for Vue macro types. | TS setup | — |
| define-model-name-casing | Enforce casing for explicit defineModel names. | Setup | Opt-in |
| prefer-define-model | Prefer defineModel over matching prop and update event declarations. | Setup | — |
| require-macro-type-name | Require exact call-site names for Vue macro types. | TS setup | — |
Refs and Result Names
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| consistent-template-ref-name | Require template ref variable names to match their keys. | Scripts | — |
| prefer-function-result-pattern | Enforce naming patterns for function result bindings. | Scripts | — |
| prefer-ref-pattern | Enforce naming patterns for template refs. | Template + scripts | — |
| prefer-use-template-ref-inference | Prefer inferred types for static Vue template refs. | TS setup + template | — |
Component Usage Contracts
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| component-prop-types | Enforce configured component prop value types. | Template | — |
| component-prop-values | Enforce configured component prop value constraints. | Template | — |
| require-component-props | Require configured props at component usage sites. | Template | — |
| require-component-slots | Require configured slots at component usage sites. | Template | — |
| require-vue-generic | Require explicit generic comments on configured components. | Template | — |
Template Conventions
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| consistent-template-element-layout | Enforce consistent template element layouts. | Template | Opt-in |
| no-complex-template-expression | Limit logical operators and conditional nesting in Vue templates. | Template | — |
| no-complex-v-for-source | Disallow complex expressions in Vue v-for sources. | Template | — |
| no-restricted-html-elements | Disallow specified native HTML elements in Vue templates. | Template | — |
| no-template-type-assertion | Disallow as type assertions in Vue templates. | Template | — |
| padding-line-between-tags | Enforce blank-line counts between consecutive template tags. | Template | Supported cases |
| prefer-simple-event-handler | Require simple expressions in named template event handlers. | Template | — |
| prefer-template-literal-in-interpolation | Prefer a single template literal for mixed text and interpolation. | Template | Supported cases |
| require-props-prefix | Require explicit props object prefixes in Vue templates. | Template | Opt-in |
Statement Ordering
| Rule | Description | Scope | Automatic fix |
|---|---|---|---|
| sort-composable-body | Group and order direct statements in named composable functions. | Scripts | Supported cases |
| sort-composable-destructure | Group destructured composable members by state and method. | Scripts | Whitespace only |
| sort-composable-return | Group composable return members by state and method. | Scripts | Whitespace only |
| sort-script-setup | Group and order top-level statements in <script setup>. | Setup | Supported cases |