Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
188 lines (160 sloc) 12.5 KB

Available rules

::: tip Legend 🔧 Indicates that the rule is fixable, and using --fix option on the command line can automatically fix some of the reported problems. :::

Base Rules (Enabling Correct ESLint Parsing)

Enforce all the rules in this category, as well as all higher priority rules, with:

  "extends": "plugin:vue/base"
Rule ID Description
vue/comment-directive support comment-directives in <template>
vue/jsx-uses-vars prevent variables used in JSX to be marked as unused

Priority A: Essential (Error Prevention)

Enforce all the rules in this category, as well as all higher priority rules, with:

  "extends": "plugin:vue/essential"
Rule ID Description
vue/no-async-in-computed-properties disallow asynchronous actions in computed properties
vue/no-dupe-keys disallow duplication of field names
vue/no-duplicate-attributes disallow duplication of attributes
vue/no-parsing-error disallow parsing errors in <template>
vue/no-reserved-keys disallow overwriting reserved keys
vue/no-shared-component-data enforce component's data property to be a function 🔧
vue/no-side-effects-in-computed-properties disallow side effects in computed properties
vue/no-template-key disallow key attribute on <template>
vue/no-textarea-mustache disallow mustaches in <textarea>
vue/no-unused-components disallow registering components that are not used inside templates
vue/no-unused-vars disallow unused variable definitions of v-for directives or scope attributes
vue/no-use-v-if-with-v-for disallow use v-if on the same element as v-for
vue/require-component-is require v-bind:is of <component> elements
vue/require-prop-type-constructor require prop type to be a constructor 🔧
vue/require-render-return enforce render function to always return value
vue/require-v-for-key require v-bind:key with v-for directives
vue/require-valid-default-prop enforce props default values to be valid
vue/return-in-computed-property enforce that a return statement is present in computed property
vue/use-v-on-exact enforce usage of exact modifier on v-on
vue/valid-template-root enforce valid template root
vue/valid-v-bind enforce valid v-bind directives
vue/valid-v-cloak enforce valid v-cloak directives
vue/valid-v-else-if enforce valid v-else-if directives
vue/valid-v-else enforce valid v-else directives
vue/valid-v-for enforce valid v-for directives
vue/valid-v-html enforce valid v-html directives
vue/valid-v-if enforce valid v-if directives
vue/valid-v-model enforce valid v-model directives
vue/valid-v-on enforce valid v-on directives
vue/valid-v-once enforce valid v-once directives
vue/valid-v-pre enforce valid v-pre directives
vue/valid-v-show enforce valid v-show directives
vue/valid-v-text enforce valid v-text directives

Priority B: Strongly Recommended (Improving Readability)

Enforce all the rules in this category, as well as all higher priority rules, with:

  "extends": "plugin:vue/strongly-recommended"
Rule ID Description
vue/attribute-hyphenation enforce attribute naming style on custom components in template 🔧
vue/html-closing-bracket-newline require or disallow a line break before tag's closing brackets 🔧
vue/html-closing-bracket-spacing require or disallow a space before tag's closing brackets 🔧
vue/html-end-tags enforce end tag style 🔧
vue/html-indent enforce consistent indentation in <template> 🔧
vue/html-quotes enforce quotes style of HTML attributes 🔧
vue/html-self-closing enforce self-closing style 🔧
vue/max-attributes-per-line enforce the maximum number of attributes per line 🔧
vue/multiline-html-element-content-newline require a line break before and after the contents of a multiline element 🔧
vue/mustache-interpolation-spacing enforce unified spacing in mustache interpolations 🔧
vue/name-property-casing enforce specific casing for the name property in Vue components 🔧
vue/no-multi-spaces disallow multiple spaces 🔧
vue/no-spaces-around-equal-signs-in-attribute disallow spaces around equal signs in attribute 🔧
vue/no-template-shadow disallow variable declarations from shadowing variables declared in the outer scope
vue/prop-name-casing enforce specific casing for the Prop name in Vue components
vue/require-default-prop require default value for props
vue/require-prop-types require type definitions in props
vue/singleline-html-element-content-newline require a line break before and after the contents of a singleline element 🔧
vue/v-bind-style enforce v-bind directive style 🔧
vue/v-on-style enforce v-on directive style 🔧

Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)

Enforce all the rules in this category, as well as all higher priority rules, with:

  "extends": "plugin:vue/recommended"
Rule ID Description
vue/attributes-order enforce order of attributes 🔧
vue/no-v-html disallow use of v-html to prevent XSS attack
vue/order-in-components enforce order of properties in components 🔧
vue/this-in-template disallow usage of this in template


No preset enables the rules in this category. Please enable each rule if you want.

For example:

  "rules": {
    "vue/array-bracket-spacing": "error"
Rule ID Description
vue/array-bracket-spacing enforce consistent spacing inside array brackets 🔧
vue/arrow-spacing enforce consistent spacing before and after the arrow in arrow functions 🔧
vue/block-spacing disallow or enforce spaces inside of blocks after opening block and before closing block 🔧
vue/brace-style enforce consistent brace style for blocks 🔧
vue/camelcase enforce camelcase naming convention
vue/comma-dangle require or disallow trailing commas 🔧
vue/component-definition-name-casing enforce specific casing for component definition name 🔧
vue/component-name-in-template-casing enforce specific casing for the component naming style in template 🔧
vue/component-tags-order enforce order of component top-level elements
vue/dot-location enforce consistent newlines before and after dots 🔧
vue/eqeqeq require the use of === and !== 🔧
vue/key-spacing enforce consistent spacing between keys and values in object literal properties 🔧
vue/keyword-spacing enforce consistent spacing before and after keywords 🔧
vue/match-component-file-name require component name property to match its file name
vue/max-len enforce a maximum line length
vue/no-boolean-default disallow boolean defaults 🔧
vue/no-deprecated-scope-attribute disallow deprecated scope attribute (in Vue.js 2.5.0+) 🔧
vue/no-deprecated-slot-attribute disallow deprecated slot attribute (in Vue.js 2.6.0+) 🔧
vue/no-deprecated-slot-scope-attribute disallow deprecated slot-scope attribute (in Vue.js 2.6.0+) 🔧
vue/no-empty-pattern disallow empty destructuring patterns
vue/no-irregular-whitespace disallow irregular whitespace
vue/no-reserved-component-names disallow the use of reserved names in component definitions
vue/no-restricted-syntax disallow specified syntax
vue/no-static-inline-styles disallow static inline style attributes
vue/no-unsupported-features disallow unsupported Vue.js syntax on the specified version 🔧
vue/object-curly-spacing enforce consistent spacing inside braces 🔧
vue/padding-line-between-blocks require or disallow padding lines between blocks 🔧
vue/require-direct-export require the component to be directly exported
vue/require-name-property require a name property in Vue components
vue/script-indent enforce consistent indentation in <script> 🔧
vue/sort-keys enforce sort-keys in a manner that is compatible with order-in-components
vue/space-infix-ops require spacing around infix operators 🔧
vue/space-unary-ops enforce consistent spacing before or after unary operators 🔧
vue/static-class-names-order enforce static class names order 🔧
vue/v-on-function-call enforce or forbid parentheses after method calls without arguments in v-on directives 🔧
vue/v-slot-style enforce v-slot directive style 🔧
vue/valid-v-bind-sync enforce valid .sync modifier on v-bind directives
vue/valid-v-slot enforce valid v-slot directives


  • ⚠️ We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
  • 😇 We don't fix bugs which are in deprecated rules since we don't have enough resources.
Rule ID Replaced by
vue/no-confusing-v-for-v-if vue/no-use-v-if-with-v-for
You can’t perform that action at this time.