Skip to content

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 ​

GoalRules
Callbacks and composablescallback-style, max-lines-per-callback, prefer-composable-options, prefer-function-declaration, prefer-watch-effect-alias
Macro layout and typesdefine-macros-newline, define-macros-type-style, require-macro-type-name
Component modelsdefine-model-name-casing, prefer-define-model
Ref and result namingconsistent-template-ref-name, prefer-ref-pattern, prefer-function-result-pattern
Template ref typesprefer-use-template-ref-inference
Component usage contractsrequire-component-props, component-prop-types, component-prop-values, require-component-slots, require-vue-generic
Template readabilityno-complex-v-for-source, padding-line-between-tags, prefer-simple-event-handler, prefer-template-literal-in-interpolation
Setup declaration ordersort-script-setup

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. Other target-based rules may have built-in targets; consult their option documentation before replacing them.

sort-script-setup orders groups by default while preserving name order inside ordinary groups (type: 'unsorted'). Name sorting requires an explicit comparator. Shared auto-import settings control API recognition only.

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.

RuleDescriptionScopeAutomatic fix
callback-styleEnforce callback styles for Vue APIs.ScriptsSupported cases
component-prop-typesEnforce configured component prop value types.Template—
component-prop-valuesEnforce configured component prop value constraints.Template—
consistent-template-ref-nameRequire template ref variable names to match their keys.Scripts—
define-macros-newlineRequire multiline inline Vue macro declarations.SetupSupported cases
define-macros-type-styleEnforce declaration styles for Vue macro types.TS setup—
define-model-name-casingEnforce casing for explicit defineModel names.SetupOpt-in
max-lines-per-callbackLimit the length of inline callbacks for Vue APIs.Scripts—
no-complex-v-for-sourceDisallow complex expressions in Vue v-for sources.Template—
padding-line-between-tagsEnforce blank-line counts between consecutive template tags.TemplateSupported cases
prefer-composable-optionsPrefer a final options object for composable parameters.Scripts—
prefer-define-modelPrefer defineModel over matching prop and update event declarations.Setup—
prefer-function-declarationRequire function declarations in SFCs and composables.Scripts—
prefer-function-result-patternEnforce naming patterns for function result bindings.Scripts—
prefer-ref-patternEnforce naming patterns for template refs.Template + scripts—
prefer-simple-event-handlerRequire simple expressions in named template event handlers.Template—
prefer-template-literal-in-interpolationPrefer a single template literal for mixed text and interpolation.TemplateSupported cases
prefer-use-template-ref-inferencePrefer inferred types for static Vue template refs.TS setup + template—
prefer-watch-effect-aliasPrefer dedicated aliases for post and sync watch effects.ScriptsSupported cases
require-component-propsRequire configured props at component usage sites.Template—
require-component-slotsRequire configured slots at component usage sites.Template—
require-macro-type-nameRequire exact call-site names for Vue macro types.TS setup—
require-vue-genericRequire explicit generic comments on configured components.Template—
sort-script-setupGroup and order top-level statements in <script setup>.SetupSupported cases