All lint rules
Vue rules (170)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
max-lines |
Enforce a maximum number of lines in a file. | — | |
vue/a11y-img-alt |
Require alt attribute on images for accessibility. | — | |
vue/attribute-hyphenation |
Enforce attribute naming style on custom components. | happy-path |
✓ |
vue/attribute-order |
Enforce a consistent order of attributes. | happy-path |
|
vue/block-lang |
Disallow languages other than the configured lang on an SFC block. | — | |
vue/camelcase |
Require camelCase identifiers in template expressions. | — | |
vue/comment-directive |
Support comment directives in <template>. |
essential |
|
vue/component-definition-name-casing |
Enforce PascalCase or kebab-case for component definition names. | happy-path |
|
vue/component-name-in-template-casing |
Enforce specific casing for component names in templates. | nuxt, opinionated |
✓ |
vue/dot-notation |
Prefer dot notation in template expressions. | — | |
vue/enforce-style-attribute |
Enforce allowed style-block attributes. | — | |
vue/eqeqeq |
Require strict equality in template expressions. | — | |
vue/html-button-has-type |
Require an explicit valid type on button elements. | nuxt, opinionated |
|
vue/html-end-tags |
Require end tags on HTML elements that may omit them. | happy-path |
✓ |
vue/html-quotes |
Enforce quotes style of HTML attributes. | happy-path |
✓ |
vue/html-self-closing |
Enforce self-closing style. | nuxt, opinionated |
✓ |
vue/jsx-uses-vars |
Treat variables used in JSX element names as used. | essential |
|
vue/match-component-file-name |
Require a component name to match its file name. | — | |
vue/max-lines-per-block |
Enforce a maximum number of lines in each Vue SFC block. | — | |
vue/max-props |
enforce maximum number of props in Vue component. | — | |
vue/max-template-complexity |
Limit a component's own template complexity (cyclomatic and cognitive). | — | |
vue/max-template-depth |
enforce maximum depth of template. | — | |
vue/multi-word-component-names |
Require component names to be multi-word. | essential |
|
vue/mustache-interpolation-spacing |
Enforce consistent spacing inside mustache interpolations. | happy-path |
✓ |
vue/next-tick-style |
Enforce Promise-style nextTick usage. | — | |
vue/no-array-index-key |
Disallow using the v-for index variable directly as the :key. | nuxt, opinionated |
|
vue/no-bare-strings-in-template |
Disallow raw human-readable text in the template that should be internationalized. | — | |
vue/no-boolean-attr-value |
Disallow explicit values for boolean HTML attributes. | nuxt, opinionated |
✓ |
vue/no-child-content |
Disallow child content when using v-html or v-text. | essential |
|
vue/no-console |
Disallow console access in template expressions. | — | |
vue/no-constant-condition |
Disallow constant conditions in template expressions. | — | |
vue/no-content-outside-block |
Disallow content outside SFC top-level blocks. | — | |
vue/no-custom-modifiers-on-v-model |
Disallow custom modifiers on v-model used on a component. |
— | |
vue/no-define-model-default |
Disallow default values in defineModel. | — | |
vue/no-deprecated-filter |
Disallow deprecated Vue 2 filter syntax using the pipe operator. | essential |
|
vue/no-deprecated-functional-template |
Disallow the functional attribute on the SFC <template>. |
essential |
|
vue/no-deprecated-html-element-is |
Disallow the is attribute on native HTML elements. |
essential |
|
vue/no-deprecated-inline-template |
Disallow the deprecated inline-template attribute. |
essential |
|
vue/no-deprecated-router-link-tag-prop |
Disallow the tag prop on <router-link>. |
essential |
|
vue/no-deprecated-scope-attribute |
Disallow the deprecated scope attribute on <template>. |
essential |
|
vue/no-deprecated-slot-attribute |
Disallow the deprecated slot attribute. |
essential |
|
vue/no-deprecated-slot-scope-attribute |
Disallow the deprecated slot-scope attribute. |
essential |
|
vue/no-deprecated-v-bind-sync |
Disallow the deprecated .sync modifier on v-bind. |
essential |
|
vue/no-deprecated-v-is |
Disallow the deprecated v-is directive. |
essential |
|
vue/no-deprecated-v-on-native-modifier |
Disallow the deprecated .native modifier on v-on. |
essential |
|
vue/no-deprecated-v-on-number-modifiers |
Disallow deprecated numeric keyCode modifiers on v-on. |
essential |
✓ |
vue/no-dupe-v-else-if |
Disallow duplicate conditions in v-if / v-else-if chains. |
essential |
|
vue/no-duplicate-attributes |
Disallow duplicate attributes on the same element. | essential |
|
vue/no-empty-component-block |
Disallow empty SFC blocks. | nuxt, opinionated |
|
vue/no-empty-pattern |
Disallow empty destructuring patterns in template expressions. | — | |
vue/no-implicit-coercion |
Disallow implicit coercion in template expressions. | — | |
vue/no-inline-style |
Discourage use of inline style attributes. | nuxt, opinionated |
|
vue/no-invalid-html-attribute |
Disallow invalid static values for HTML attributes. | happy-path |
|
vue/no-irregular-whitespace |
Disallow irregular whitespace in script blocks and templates. | — | |
vue/no-literals-in-template |
Disallow object, array and function literals in v-bind. | — | |
vue/no-lone-template |
Disallow unnecessary <template> elements. |
happy-path |
|
vue/no-loss-of-precision |
Disallow numeric literals that lose precision. | — | |
vue/no-multi-spaces |
Disallow multiple consecutive spaces. | happy-path |
✓ |
vue/no-multiple-objects-in-class |
Disallow multiple object literals inside a :class array binding. | nuxt, opinionated |
|
vue/no-multiple-template-root |
Disallow multiple root nodes in a template. | — | |
vue/no-mutating-props |
Disallow mutating component props. | essential |
|
vue/no-negated-condition |
Disallow negated ternary conditions in template expressions. | — | |
vue/no-negated-v-if-condition |
Disallow a negated v-if condition when the chain has a v-else. | nuxt, opinionated |
|
vue/no-non-component-keep-alive-child |
Disallow plain element wrappers directly below <KeepAlive>. |
essential |
|
vue/no-preprocessor-lang |
Discourage CSS preprocessor usage in favor of modern CSS. | nuxt, opinionated |
|
vue/no-props-shadow |
Disallow setup declarations that shadow props. | — | |
vue/no-ref-object-reactivity-loss |
Disallow copying a ref value in the same scope. | — | |
vue/no-reserved-component-names |
Disallow the use of reserved names as component names. | essential |
|
vue/no-restricted-block |
disallow specific block. | — | |
vue/no-restricted-call-after-await |
disallow asynchronously called restricted methods. | — | |
vue/no-restricted-class |
disallow specific classes in Vue components. | — | |
vue/no-restricted-component-names |
disallow specific component names. | — | |
vue/no-restricted-component-options |
disallow specific component option. | — | |
vue/no-restricted-custom-event |
disallow specific custom event. | — | |
vue/no-restricted-html-elements |
disallow specific elements. | — | |
vue/no-restricted-props |
disallow specific props. | — | |
vue/no-restricted-static-attribute |
disallow specific attribute. | — | |
vue/no-restricted-syntax |
Disallow configured syntax in the template. | — | |
vue/no-restricted-v-bind |
Disallow restricted v-bind arguments. | — | |
vue/no-restricted-v-on |
disallow specific argument in v-on. |
— | |
vue/no-root-v-if |
Disallow v-if on the single root element of a template. | nuxt, opinionated |
|
vue/no-script-non-standard-lang |
Discourage non-standard script lang values. | nuxt, opinionated |
|
vue/no-setup-props-reactivity-loss |
Disallow setup prop reads that lose reactivity. | — | |
vue/no-shadow-native-events |
Disallow component events that shadow native events. | — | |
vue/no-sparse-arrays |
Disallow sparse arrays in template expressions. | — | |
vue/no-src-attribute |
Discourage src attribute on SFC blocks. | nuxt, opinionated |
|
vue/no-static-inline-styles |
Disallow static inline style attributes. | — | |
vue/no-template-key |
Disallow key attribute on <template>. |
essential |
|
vue/no-template-lang |
Discourage lang attribute on template block. | nuxt, opinionated |
|
vue/no-template-shadow |
Disallow variable names that shadow variables in outer scope. | happy-path |
|
vue/no-template-target-blank |
Disallow target="_blank" without rel="noopener noreferrer". | happy-path |
|
vue/no-textarea-mustache |
Disallow mustache interpolation in <textarea>. |
essential |
|
vue/no-this-in-before-route-enter |
Disallow this in beforeRouteEnter. |
happy-path |
|
vue/no-undefined-refs |
Disallow undefined variable references in templates. | happy-path |
|
vue/no-unsafe-url |
Warn about potentially unsafe URL bindings. | essential |
|
vue/no-unsandboxed-iframe |
Require a sandbox attribute on iframe elements. | happy-path |
|
vue/no-unsupported-features |
disallow unsupported Vue.js syntax on the specified version. | — | |
vue/no-unused-components |
Disallow registering components that are not used inside templates. | essential |
|
vue/no-unused-properties |
Disallow unused properties defined in defineProps. | happy-path |
|
vue/no-unused-refs |
Report template refs (ref="x") never referenced in <script>. | nuxt, opinionated |
|
vue/no-unused-script-vars |
Disallow unused script variables, imports, and parameters. | nuxt, opinionated |
|
vue/no-unused-setup-bindings |
Disallow unread script setup bindings. | happy-path |
|
vue/no-unused-vars |
Disallow unused variable definitions in v-for and v-slot directives. | essential |
|
vue/no-use-v-else-with-v-for |
Disallow using v-else-if or v-else on the same element as v-for. |
happy-path |
|
vue/no-use-v-if-with-v-for |
Disallow using v-if on the same element as v-for. |
essential |
|
vue/no-useless-concat |
Disallow useless string concatenation in template expressions. | — | |
vue/no-useless-mustaches |
Disallow a mustache interpolation whose expression is a constant string literal. | nuxt, opinionated |
|
vue/no-useless-template-attributes |
Disallow useless attributes on <template> elements. |
essential |
|
vue/no-useless-v-bind |
Disallow a v-bind whose value is a plain string literal. | nuxt, opinionated |
|
vue/no-v-for-template-key |
Disallow key on <template v-for>. |
— | |
vue/no-v-for-template-key-on-child |
Disallow key on the child of a <template v-for>. |
essential |
|
vue/no-v-html |
Warn against v-html to prevent XSS vulnerabilities. | essential |
|
vue/no-v-text |
Disallow the v-text directive; prefer mustache interpolation. | nuxt, opinionated |
|
vue/no-v-text-v-html-on-component |
Disallow v-text / v-html on component elements. | essential |
|
vue/object-shorthand |
Require object shorthand in template expressions. | — | |
vue/permitted-contents |
Enforce HTML content model rules. | happy-path |
|
vue/prefer-const |
Require const for bindings the script and template never reassign. | nuxt, opinionated |
|
vue/prefer-prop-type-boolean-first |
Enforce Boolean comes first in component prop types. |
— | |
vue/prefer-props-shorthand |
Recommend shorthand syntax for props (Vue 3.4+). | nuxt, opinionated |
✓ |
vue/prefer-pug-lang |
Prefer lang="pug" over the legacy jade 1.x template language. | happy-path |
✓ |
vue/prefer-single-event-payload |
Enforce passing a single argument to custom event emissions. | — | |
vue/prefer-template |
Prefer template literals in template expressions. | — | |
vue/prefer-true-attribute-shorthand |
Prefer the shorthand for a boolean attribute bound to true. |
nuxt, opinionated |
|
vue/prefer-v-model |
Prefer v-model over matching bind and update listeners. | — | |
vue/prop-name-casing |
Enforce a casing for declared prop names. | happy-path |
|
vue/quote-props |
Disallow unnecessary quoted object properties in template expressions. | — | |
vue/require-component-is |
Require v-bind:is on <component> elements. |
essential |
|
vue/require-component-registration |
Require explicit import or registration for components. | opinionated |
|
vue/require-default-export |
Require a component's script to be the default export. | — | |
vue/require-expose |
Require declare public properties using expose. |
— | |
vue/require-macro-variable-name |
Require conventional macro variable names. | — | |
vue/require-prop-comment |
Require a JSDoc comment on each declared prop. | — | |
vue/require-scoped-style |
Require scoped attribute on style tags. | happy-path |
|
vue/require-toggle-inside-transition |
Require a toggle on the element wrapped by <transition>. |
essential |
|
vue/require-v-for-key |
Require v-bind:key with v-for directives. |
essential |
|
vue/scoped-event-names |
Recommend scoped event names using context:event format. | nuxt, opinionated |
|
vue/sfc-element-order |
Enforce consistent order of SFC top-level elements. | happy-path |
|
vue/single-style-block |
Recommend having a single style block. | happy-path |
|
vue/slot-name-casing |
Enforce configured casing for rendered slot names. | nuxt, opinionated |
|
vue/sort-keys |
Require sorted object keys, compatible with component option order. | — | |
vue/this-in-template |
Disallow this. in template expressions. |
happy-path |
|
vue/use-unique-element-ids |
Enforce unique element IDs using useId() instead of static literals. | nuxt, opinionated |
|
vue/use-v-on-exact |
Enforce .exact modifier on v-on when there are modifier-based handlers. |
essential |
|
vue/v-bind-style |
Enforce v-bind directive style. |
happy-path |
✓ |
vue/v-if-else-key |
Require keys on repeated conditional components. | — | |
vue/v-on-event-hyphenation |
Enforce hyphenation of custom event names in v-on on components. | happy-path |
✓ |
vue/v-on-handler-style |
Enforce writing v-on handlers as method references. | nuxt, opinionated |
|
vue/v-on-style |
Enforce v-on directive style. |
happy-path |
✓ |
vue/v-slot-style |
Enforce v-slot directive style. |
happy-path |
✓ |
vue/valid-attribute-name |
Require valid attribute names. | essential |
|
vue/valid-model-definition |
Require valid keys in the model option. | — | |
vue/valid-template-root |
Enforce valid root content in an SFC <template> block. |
essential |
|
vue/valid-v-bind |
Enforce valid v-bind directives. |
essential |
|
vue/valid-v-cloak |
Enforce valid v-cloak directives. |
essential |
|
vue/valid-v-else |
Enforce valid v-else directives. |
essential |
✓ |
vue/valid-v-else-if |
Enforce valid v-else-if directives. |
essential |
|
vue/valid-v-for |
Enforce valid v-for directives. |
essential |
|
vue/valid-v-html |
Enforce valid v-html directives. |
essential |
|
vue/valid-v-if |
Enforce valid v-if directives. |
essential |
|
vue/valid-v-is |
Enforce valid v-is directives. |
essential |
|
vue/valid-v-memo |
Enforce valid v-memo directives. |
essential |
|
vue/valid-v-model |
Enforce valid v-model directives. |
essential |
|
vue/valid-v-on |
Enforce valid v-on directives. |
essential |
|
vue/valid-v-once |
Enforce valid v-once directives. |
essential |
|
vue/valid-v-pre |
Enforce valid v-pre directives. |
essential |
|
vue/valid-v-show |
Enforce valid v-show directives. |
essential |
|
vue/valid-v-slot |
Enforce valid v-slot directives. |
essential |
|
vue/valid-v-text |
Enforce valid v-text directives. |
essential |
|
vue/warn-custom-block |
Warn about custom blocks in SFC files. | nuxt, opinionated |
|
vue/warn-custom-directive |
Warn about custom directives that need registration. | nuxt, opinionated |
Type and script rules (125)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
script/component-options-name-casing |
Enforce PascalCase for registered component names. | opinionated, nuxt |
|
script/consistent-props-emits-key-quotes |
Require consistent quoted keys in props and emits declarations. | — | |
script/consistent-type-imports |
Enforce consistent usage of type imports, counting template uses as value uses. | — | ✓ |
script/custom-event-name-casing |
Enforce configured casing for emitted custom event names. | opinionated, nuxt |
|
script/define-emits-declaration |
Enforce the type-based defineEmits<{}>() form over the runtime/array form. | opinionated, nuxt |
|
script/define-macros-order |
Enforce a consistent order of the Vue compiler macros in <script setup>. | opinionated, nuxt |
|
script/define-props-declaration |
Enforce type-based defineProps<{ ... }>() over the runtime/object form. | opinionated, nuxt |
|
script/define-props-destructuring |
Enforce consistent style for defineProps destructuring in <script setup>. | happy-path |
|
script/no-arrow-functions-in-watch |
Disallow arrow functions as Options API watch handlers. | essential |
|
script/no-async-in-computed |
Disallow async functions in computed properties. | essential |
|
script/no-boolean-default |
Disallow a default on a Boolean prop. | opinionated, nuxt |
|
script/no-computed-properties-in-data |
Disallow using computed properties inside the component data function. | essential |
|
script/no-deep-destructure-in-props |
Disallow deeply nested destructuring in defineProps. | opinionated, nuxt |
|
script/no-deprecated-data-object-declaration |
Disallow an object literal as the component data option (Vue 3 requires a function). | essential |
|
script/no-deprecated-delete-set |
Disallow Vue 2 $set and $delete, which were removed in Vue 3. | essential |
|
script/no-deprecated-destroyed-lifecycle |
Disallow deprecated destroyed and beforeDestroy lifecycle hooks. | essential |
✓ |
script/no-deprecated-dollar-listeners-api |
Disallow the $listeners instance property removed in Vue 3 (merged into $attrs). | essential |
|
script/no-deprecated-dollar-scopedslots-api |
Disallow the $scopedSlots instance property removed in Vue 3 (use $slots). | essential |
|
script/no-deprecated-events-api |
Disallow the removed Vue 2 events API ($on / $off / $once). | essential |
|
script/no-deprecated-model-definition |
Disallow the Vue 2 model option, which was removed in Vue 3. | essential |
|
script/no-deprecated-props-default-this |
Disallow this inside a prop default/validator function (removed in Vue 3). |
essential |
|
script/no-deprecated-vue-config-keycodes |
Disallow Vue.config.keyCodes, which was removed in Vue 3. | essential |
|
script/no-dupe-keys |
Disallow duplicate keys across Options API props/data/computed/methods/setup/inject. | essential |
|
script/no-duplicate-attr-inheritance |
Flag a component that applies its fallthrough attributes twice. | essential |
|
script/no-export-in-script-setup |
Disallow export statements inside <script setup>. | essential |
|
script/no-expose-after-await |
Disallow expose() and defineExpose() after an await. | essential |
|
script/no-get-current-instance |
Disallow getCurrentInstance() in Vapor mode (returns null). | opinionated |
|
script/no-import-compiler-macros |
Disallow importing Vue compiler macros that are auto-imported. | essential |
|
script/no-internal-imports |
Disallow importing from Vue internal modules. | essential |
|
script/no-lifecycle-after-await |
Disallow lifecycle hooks registered after an await in setup(). | essential |
|
script/no-multiple-slot-args |
Disallow passing more than one argument to a scoped-slot function call. | happy-path |
|
script/no-next-tick |
Disallow nextTick() usage in Vapor-oriented components. | — | |
script/no-options-api |
Disallow Options API patterns in Vapor mode. | opinionated |
|
script/no-potential-component-option-typo |
Flag likely typos in Options API component option names. | essential |
|
script/no-reactive-destructure |
Disallow destructuring reactive objects which loses reactivity. | — | |
script/no-ref-as-operand |
Require ref-bound variables to be accessed via .value when used as an operand. |
essential |
|
script/no-required-prop-with-default |
Disallow a prop that is both required: true and has a default. | essential |
|
script/no-reserved-identifiers |
Disallow using Vue compiler reserved identifiers. | essential |
|
script/no-reserved-keys |
Disallow Vue-reserved names as Options API props/data/computed/methods/setup keys. | essential |
|
script/no-reserved-props |
Disallow reserved names in a component's props declaration. | essential |
|
script/no-restricted-globals |
Disallow references to runtime-environment globals that must go through a typed wrapper. | — | |
script/no-restricted-members |
Disallow project-configured object.property member accesses. | — | |
script/no-side-effects-in-computed-properties |
Disallow side effects in Options API computed getters. | essential |
|
script/no-top-level-ref-in-script |
Disallow top-level ref/reactive to prevent Cross-Request State Pollution. | — | |
script/no-unstable-nested-components |
Disallow component definitions inside setup or render functions. | happy-path |
|
script/no-unused-emit-declarations |
Flag declared events that are never emitted. | opinionated, nuxt |
|
script/no-use-computed-property-like-method |
Disallow calling an Options API computed property like a method. | essential |
|
script/no-watch-after-await |
Disallow watchers registered after an await in setup() without keeping their stop handle. | essential |
|
script/no-with-defaults |
Discourage withDefaults in favor of destructuring defaults (Vue 3.5+). | opinionated |
|
script/one-component-per-file |
Disallow more than one component definition in a file. | opinionated, nuxt |
|
script/order-in-components |
Enforce the default order of properties in component options. | opinionated, nuxt |
|
script/prefer-computed |
Prefer computed() for derived reactive state. | — | |
script/prefer-define-emits-binding |
Prefer the captured defineEmits function over template $emit. | — | ✓ |
script/prefer-define-options |
Prefer defineOptions() over a default export paired with <script setup>. | opinionated, nuxt |
|
script/prefer-import-from-vue |
Prefer importing from 'vue' instead of internal packages. | essential |
✓ |
script/prefer-ref-over-reactive |
Recommend using ref() over reactive() for state management. | — | |
script/prefer-use-attrs |
Recommend using useAttrs() over context.attrs. | — | |
script/prefer-use-id |
Recommend using useId() for generating unique IDs (Vue 3.5+). | — | |
script/prefer-use-slots |
Recommend using useSlots() over context.slots. | — | |
script/prefer-use-template-ref |
Recommend useTemplateRef over ref for template references (Vue 3.5+). | opinionated, nuxt |
|
script/require-default-prop |
Require a default value for every optional, non-Boolean prop. | opinionated, nuxt |
|
script/require-define-component |
Require defineComponent() for TypeScript SFC default exports. | happy-path |
|
script/require-explicit-emits |
Require emitted events to be declared in defineEmits or the emits option. | happy-path |
|
script/require-explicit-slots |
Require slots consumed via useSlots() to be explicitly typed with defineSlots<...>(). | opinionated, nuxt |
|
script/require-function-return-type |
Require return type annotations on functions. | — | |
script/require-prop-type-constructor |
Require prop type values to be constructors rather than string literals. |
essential |
|
script/require-prop-types |
Require every prop to declare a type. | opinionated |
|
script/require-render-return |
Require the component render function to return a value. | essential |
|
script/require-slots-as-functions |
Require $slots properties to be called as functions. | essential |
|
script/require-symbol-provide |
Recommend using Symbol as injection key for provide/inject. | — | |
script/require-typed-object-prop |
Require an explicit type on a prop whose runtime type is Object or Array. |
opinionated, nuxt |
|
script/require-typed-ref |
Require an explicit type argument on a ref() initialized with no value, null, or undefined. | — | |
script/require-valid-default-prop |
Require a prop's default value to be valid for its declared type. | essential |
|
script/return-in-computed-property |
Require a return value in every computed getter. | essential |
|
script/return-in-emits-validator |
Require a return value in every Vue emits validator. | essential |
|
script/valid-define-emits |
Enforce valid defineEmits() usage (no type+runtime args, no local references, single call). | essential |
|
script/valid-define-options |
Enforce valid defineOptions() usage (single object arg, no props/emits/expose/slots). | essential |
|
script/valid-define-props |
Enforce valid defineProps() usage (single call, not both type and runtime args, no local references). | essential |
|
script/valid-next-tick |
Require the result of a nextTick() call to be awaited, chained, or given a callback. | essential |
|
type/await-thenable |
Disallow awaiting non-thenable values. | nuxt, opinionated |
|
type/no-array-delete |
Disallow deleting elements from array-like values. | nuxt, opinionated |
|
type/no-base-to-string |
Disallow stringifying values that fall back to Object.prototype.toString(). | nuxt, opinionated |
|
type/no-confusing-void-expression |
Disallow void-typed expressions in confusing value positions. | nuxt, opinionated |
|
type/no-deprecated |
Disallow use of deprecated declarations. | nuxt, opinionated |
|
type/no-duplicate-type-constituents |
Disallow duplicate union or intersection constituents. | nuxt, opinionated |
|
type/no-floating-promises |
Disallow floating (unhandled) Promises. | nuxt, opinionated |
|
type/no-for-in-array |
Disallow for-in iteration over array-like values. | nuxt, opinionated |
|
type/no-generated-empty-object-type |
Disallow empty object types generated by type operations. | nuxt, opinionated |
|
type/no-implied-eval |
Disallow string-based dynamic code execution APIs. | nuxt, opinionated |
|
type/no-meaningless-void-operator |
Disallow void operators on expressions that are already void-like. | nuxt, opinionated |
|
type/no-misused-promises |
Disallow Promises in places not designed to handle them. | nuxt, opinionated |
|
type/no-misused-spread |
Disallow spreading values into incompatible positions. | nuxt, opinionated |
|
type/no-mixed-enums |
Disallow mixing string and numeric enum members. | nuxt, opinionated |
|
type/no-reactivity-loss |
Disallow plain snapshots of reactive values across assignments and calls. | nuxt, opinionated |
|
type/no-redundant-type-constituents |
Disallow members of unions and intersections that do nothing or override type information. | nuxt, opinionated |
|
type/no-unnecessary-boolean-literal-compare |
Disallow unnecessary comparisons against boolean literals. | nuxt, opinionated |
|
type/no-unnecessary-condition |
Disallow conditions that are always truthy, always falsy, never, or always nullish. | nuxt, opinionated |
|
type/no-unnecessary-template-expression |
Disallow template literals that wrap a single expression unnecessarily. | nuxt, opinionated |
|
type/no-unnecessary-type-arguments |
Disallow type arguments that are equal to the default. | nuxt, opinionated |
|
type/no-unnecessary-type-assertion |
Disallow type assertions that do not change the expression type. | nuxt, opinionated |
|
type/no-unnecessary-type-conversion |
Disallow conversions that do not change the type or value of the expression. | nuxt, opinionated |
|
type/no-unnecessary-type-parameters |
Disallow type parameters that are not used more than once. | nuxt, opinionated |
|
type/no-unsafe-argument |
Disallow calling a function with a value of type any. |
nuxt, opinionated |
|
type/no-unsafe-assignment |
Disallow assigning any-typed values to more specific targets. | nuxt, opinionated |
|
type/no-unsafe-call |
Disallow calling values typed as any. | nuxt, opinionated |
|
type/no-unsafe-enum-assignment |
Disallow assigning a non-enum value to an enum. | nuxt, opinionated |
|
type/no-unsafe-enum-comparison |
Disallow comparing an enum value with a value from a different enum domain. | nuxt, opinionated |
|
type/no-unsafe-member-access |
Disallow member access on values typed as any. | nuxt, opinionated |
|
type/no-unsafe-return |
Disallow returning any-typed values from functions. | nuxt, opinionated |
|
type/no-unsafe-template-binding |
Disallow template bindings that resolve to unsafe types. | nuxt, opinionated |
|
type/no-unsafe-unary-minus |
Disallow unary negation on non-number and non-bigint values. | nuxt, opinionated |
|
type/only-throw-error |
Require thrown values to be Error-like. | nuxt, opinionated |
|
type/prefer-promise-reject-errors |
Require Promise rejection reasons to be Error-like values. | nuxt, opinionated |
|
type/prefer-reduce-type-parameter |
Prefer Array#reduce type parameters over default-value assertions. | nuxt, opinionated |
|
type/prefer-return-this-type |
Enforce that this is used when only this type is returned. |
nuxt, opinionated |
|
type/related-getter-setter-pairs |
Require paired getters and setters to use compatible types. | nuxt, opinionated |
|
type/require-await |
Disallow async functions that contain no await expression. | nuxt, opinionated |
|
type/require-typed-emits |
Require type definition for defineEmits. | happy-path |
|
type/require-typed-props |
Require type definition for defineProps. | happy-path |
|
type/restrict-plus-operands |
Require plus operands to be explicitly compatible. | nuxt, opinionated |
|
type/restrict-template-expressions |
Require template literal expressions to be string-compatible. | nuxt, opinionated |
|
type/return-await |
Enforce consistent use of return await based on context and configuration. |
nuxt, opinionated |
|
type/strict-boolean-expressions |
Require safe boolean expressions in script and template conditions. | — | |
type/unbound-method |
Disallow referencing methods without their receiver (this). |
nuxt, opinionated |
|
type/use-unknown-in-catch-callback-variable |
Require Promise catch callback variables to use an explicit unknown annotation. | nuxt, opinionated |
HTML rules (9)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
html/deprecated-attr |
Disallow deprecated HTML attributes. | happy-path |
|
html/deprecated-element |
Disallow deprecated HTML elements. | happy-path |
|
html/id-duplication |
Disallow duplicate element IDs. | essential |
|
html/no-consecutive-br |
Disallow consecutive <br> elements. | happy-path |
|
html/no-dupe-style-properties |
Disallow duplicate properties in inline style attributes. | nuxt, opinionated |
|
html/no-duplicate-class |
Disallow duplicate class names in a static class attribute. | happy-path |
|
html/no-duplicate-dt |
Disallow duplicate <dt> names in <dl>. | happy-path |
|
html/no-empty-palpable-content |
Disallow empty elements that expect visible content. | happy-path |
|
html/require-datetime |
Require datetime attribute on <time> element. | happy-path |
Accessibility rules (31)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
a11y/alt-text |
Require alternative text for media elements. | happy-path |
|
a11y/anchor-has-content |
Require anchor elements to have accessible content. | happy-path |
|
a11y/anchor-is-valid |
Enforce valid href on anchor elements. | happy-path |
|
a11y/aria-props |
Disallow invalid ARIA attributes. | happy-path |
|
a11y/aria-role |
Elements with ARIA roles must use a valid, non-abstract ARIA role. | happy-path |
|
a11y/aria-unsupported-elements |
Disallow ARIA attributes on elements that do not support them. | happy-path |
|
a11y/click-events-have-key-events |
Require keyboard event handlers with click events. | happy-path |
|
a11y/form-control-has-label |
Require form controls to have associated labels. | happy-path |
|
a11y/heading-has-content |
Require heading elements to have accessible content. | happy-path |
|
a11y/heading-levels |
Disallow skipping heading levels. | nuxt, opinionated |
|
a11y/iframe-has-title |
Require iframe elements to have a title attribute. | happy-path |
|
a11y/img-alt |
Require alt attribute on images for accessibility. | — | |
a11y/interactive-supports-focus |
Require interactive role elements to be focusable. | happy-path |
|
a11y/label-has-for |
Require labels to have associated form controls. | happy-path |
|
a11y/landmark-roles |
Validate landmark role placement and uniqueness. | nuxt, opinionated |
|
a11y/media-has-caption |
Require media elements to have captions. | happy-path |
|
a11y/mouse-events-have-key-events |
Require focus/blur events with mouse events. | happy-path |
|
a11y/no-access-key |
Disallow the use of the accesskey attribute. | happy-path |
|
a11y/no-aria-hidden-on-focusable |
Disallow aria-hidden="true" on focusable elements. | happy-path |
|
a11y/no-autofocus |
Disallow the use of the autofocus attribute. | happy-path |
|
a11y/no-distracting-elements |
Disallow distracting elements like <marquee> and <blink>. | happy-path |
|
a11y/no-i-for-icon |
Disallow using <i> element for icons. | happy-path |
|
a11y/no-redundant-roles |
Disallow redundant ARIA roles. | happy-path |
✓ |
a11y/no-refer-to-non-existent-id |
Disallow references to non-existent IDs. | happy-path |
|
a11y/no-role-presentation-on-focusable |
Disallow role="presentation" or role="none" on focusable elements. | happy-path |
|
a11y/no-static-element-interactions |
Disallow event handlers on static elements. | happy-path |
|
a11y/placeholder-label-option |
Require a placeholder label option in a required select. | nuxt, opinionated |
|
a11y/role-has-required-aria-props |
Require ARIA roles to have required properties. | happy-path |
|
a11y/role-img-has-name |
Require an accessible name on elements with role="img". | — | |
a11y/tabindex-no-positive |
Disallow positive tabindex values. | happy-path |
|
a11y/use-list |
Suggest using list elements for bullet-like text. | nuxt, opinionated |
SSR rules (2)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
ssr/no-browser-globals-in-ssr |
Disallow browser-only globals in SSR context. | happy-path |
|
ssr/no-hydration-mismatch |
Disallow non-deterministic values that cause hydration mismatch. | happy-path |
Vapor rules (4)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
vapor/no-inline-template |
Disallow deprecated inline-template attribute. | nuxt, opinionated |
|
vapor/no-vue-lifecycle-events |
Disallow @vue:xxx per-element lifecycle events (not supported in Vapor). | happy-path |
|
vapor/prefer-static-class |
Prefer static class over dynamic class binding for string literals. | nuxt, opinionated |
✓ |
vapor/require-vapor-attribute |
Suggest adding vapor attribute to script setup. | nuxt, opinionated |
Ecosystem and Nuxt rules (13)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
ecosystem/nuxt-prefer-nuxt-link |
Prefer NuxtLink for internal application links. | nuxt |
|
ecosystem/pinia-prefer-store-to-refs |
Prefer storeToRefs() when destructuring Pinia stores. | ecosystem |
|
ecosystem/router-link-require-to |
Require a to target on RouterLink and NuxtLink components. |
ecosystem |
|
ecosystem/void-link-require-href |
Require href on Void Vue Link components. |
ecosystem |
|
ecosystem/void-link-valid-method |
Validate static Void Vue Link method props. | ecosystem |
|
ecosystem/vue-i18n-no-missing-key |
Report static vue-i18n keys that are absent from local SFC messages. | ecosystem |
|
ecosystem/vue-router-prefer-named-link |
Prefer named route objects over static path strings in RouterLink. | ecosystem |
|
ecosystem/vue-router-prefer-named-push |
Prefer named route objects for Vue Router programmatic navigation. | ecosystem |
|
ecosystem/vue-test-utils-no-html-snapshot |
Avoid snapshotting wrapper.html() in Vue Test Utils tests. | ecosystem |
|
nuxt/no-nuxt-config-test-key |
Disallow setting test key in Nuxt config. |
nuxt |
|
nuxt/no-page-meta-runtime-values |
Disallow runtime context values inside definePageMeta at the eager level, which is extracted into a separate chunk at build time and runs before component setup. |
nuxt |
|
nuxt/nuxt-config-keys-order |
Prefer recommended order of Nuxt config properties. | nuxt |
✓ |
nuxt/prefer-import-meta |
Prefer using import.meta.* over process.*. |
nuxt |
✓ |
CSS rules (10)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
css/no-display-none |
Suggest using v-show instead of display: none. | opinionated, nuxt |
|
css/no-hardcoded-values |
Suggest using CSS variables instead of hardcoded values. | opinionated, nuxt |
|
css/no-id-selectors |
Discourage use of ID selectors in CSS. | opinionated, nuxt |
|
css/no-important |
Discourage use of !important in CSS. | opinionated, nuxt |
|
css/no-utility-classes |
Warn against implementing utility classes in component styles. | opinionated, nuxt |
|
css/no-v-bind-performance |
Warn about performance cost of CSS v-bind(). | opinionated, nuxt |
|
css/prefer-logical-properties |
Recommend CSS logical properties for better i18n support. | opinionated, nuxt |
|
css/prefer-nested-selectors |
Recommend using CSS nesting for descendant selectors. | opinionated, nuxt |
|
css/prefer-slotted |
Recommend ::v-slotted() for styling slot content. | opinionated, nuxt |
|
css/require-font-display |
Require font-display in @font-face rules. | opinionated, nuxt |
Musea rules (6)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
musea/no-empty-variant |
Disallow empty <variant> blocks. | — | |
musea/prefer-design-tokens |
Prefer design token CSS variables over hardcoded primitive values. | — | |
musea/require-component |
Require a resolvable target component for an <art> block. | — | |
musea/require-title |
Require a resolvable display title for an <art> block. | — | |
musea/unique-variant-names |
Require unique variant names. | — | |
musea/valid-variant |
Require name attribute in <variant> blocks. | — |
petite-vue rules (3)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
petite-vue/no-unsupported-directive |
Disallow directives that petite-vue does not support. | — | |
petite-vue/valid-v-effect |
Require v-effect to have a non-empty expression. | — | |
petite-vue/valid-v-scope |
Require v-scope to bind an object literal. | — |
Cross-file rules (66)
| Rule | What it checks | Status |
|---|---|---|
ecosystem/vue-router-extra-param |
Reports navigation params that the target route does not declare. | Reported by vp run lint |
ecosystem/vue-router-missing-param |
Reports a named navigation that omits a required route param. | Reported by vp run lint |
ecosystem/vue-router-param-type |
Reports a route param value the declared segment does not accept. | Reported by vp run lint |
ecosystem/vue-router-unknown-route |
Reports a navigation name that the installed router does not declare. | Reported by vp run lint |
html/cross-component-nesting |
Check actual HTML nesting after imported components are composed. | Reported by vp run lint |
vize:croquis/cf/array-mutation |
Use observable mutations for array index updates in Vue 2.7. | Planned; not reported yet |
vize:croquis/cf/async-boundary |
Reactive state crosses an async boundary and can be observed stale. | Reported by vp run lint |
vize:croquis/cf/async-no-suspense |
An async component is rendered without a Suspense boundary. | Experimental; not reported by the CLI yet |
vize:croquis/cf/browser-api-ssr |
A browser-only API is used where the component can render on the server. | Reported by vp run lint |
vize:croquis/cf/circular-dep |
Components import each other in a cycle. | Planned; not reported yet |
vize:croquis/cf/circular-reactive-dependency |
Reactive computations depend on each other in a cycle. | Reported by vp run lint |
vize:croquis/cf/closure-captures-reactive |
A closure captures a reactive value and will not see later updates. | Planned; not reported yet |
vize:croquis/cf/composable-outside-setup |
A composable is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/computed-side-effects |
A computed getter writes state or performs another side effect. | Planned; not reported yet |
vize:croquis/cf/deep-import |
An import chain is deeper than the project allows. | Planned; not reported yet |
vize:croquis/cf/destructuring-breaks-reactivity |
Destructuring a reactive object copies the fields and drops tracking. | Reported by vp run lint |
vize:croquis/cf/di-outside-setup |
provide or inject is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/dom-access-without-next-tick |
The DOM is read before Vue has flushed the update. | Planned; not reported yet |
vize:croquis/cf/duplicate-id |
The same element id is used in more than one component. | Reported by vp run lint |
vize:croquis/cf/event-listener-leak |
An event listener is registered and never removed. | Planned; not reported yet |
vize:croquis/cf/event-modifier |
An event listener uses a modifier the emit does not support. | Experimental; not reported by the CLI yet |
vize:croquis/cf/hydration-risk |
The render can disagree between the server and the client. | Reported by vp run lint |
vize:croquis/cf/inherit-attrs-unused |
inheritAttrs: false is set and the component never reads the attributes. |
Experimental; not reported by the CLI yet |
vize:croquis/cf/inject-without-symbol |
inject uses a plain key instead of an InjectionKey symbol. |
Reported by vp run lint |
vize:croquis/cf/injected-async-mutation-race |
An injected value is mutated from an async task that can race. | Reported by vp run lint |
vize:croquis/cf/lifecycle-outside-setup |
A lifecycle hook is registered outside setup. |
Planned; not reported yet |
vize:croquis/cf/lifecycle-without-cleanup |
A lifecycle hook starts work and never cleans it up. | Experimental; not reported by the CLI yet |
vize:croquis/cf/missing-required-prop |
A required prop is not passed. | Experimental; not reported by the CLI yet |
vize:croquis/cf/missing-suspense |
An async dependency is used outside a Suspense boundary. | Planned; not reported yet |
vize:croquis/cf/module-scope-reactive |
Reactive state is created at module scope and shared by every caller. | Planned; not reported yet |
vize:croquis/cf/multi-root-attrs |
A multi-root component receives attributes and has nowhere to put them. | Experimental; not reported by the CLI yet |
vize:croquis/cf/mutated-after-escape |
A reactive object is mutated after it has escaped its owner. | Planned; not reported yet |
vize:croquis/cf/non-reactive-provide |
A provided value is not reactive, so descendants will not see updates. | Reported by vp run lint |
vize:croquis/cf/non-unique-id |
An element id inside a loop is not unique per item. | Reported by vp run lint |
vize:croquis/cf/object-identity-comparison |
Compare stable record IDs across raw objects and reactive proxies. | Planned; not reported yet |
vize:croquis/cf/pinia-getter |
Avoid setup-time snapshots of Pinia getter values. | Planned; not reported yet |
vize:croquis/cf/prop-type-mismatch |
A passed prop value does not match the declared type. | Experimental; not reported by the CLI yet |
vize:croquis/cf/provide-inject-type |
A provided value and its inject do not have the same type. | Reported by vp run lint |
vize:croquis/cf/provide-without-symbol |
provide uses a plain key instead of an InjectionKey symbol. |
Reported by vp run lint |
vize:croquis/cf/reactive-export |
Reactive state is exported from the module. | Planned; not reported yet |
vize:croquis/cf/reactivity-outside-setup |
A reactive API is called outside setup. |
Planned; not reported yet |
vize:croquis/cf/reassignment-breaks-reactivity |
Reassigning a reactive binding replaces it with a plain value. | Reported by vp run lint |
vize:croquis/cf/reference-escapes-scope |
A reactive reference escapes the scope that owns its lifetime. | Planned; not reported yet |
vize:croquis/cf/setup-context-violation |
Keep component-owned reactive state inside per-instance setup. | Experimental; not reported by the CLI yet |
vize:croquis/cf/shallow-deep-access |
A deep property of a shallowReactive or shallowRef value is read as if it were tracked. |
Planned; not reported yet |
vize:croquis/cf/spread-breaks-reactivity |
Spreading a reactive object copies its values and drops the tracking. | Reported by vp run lint |
vize:croquis/cf/suspense-no-fallback |
<Suspense> has no fallback content. |
Planned; not reported yet |
vize:croquis/cf/template-ref-timing |
A template ref is read before the component is mounted. | Planned; not reported yet |
vize:croquis/cf/toraw-mutation |
toRaw is used and the raw object is then mutated. |
Planned; not reported yet |
vize:croquis/cf/uncaught-error |
A component can throw and no error boundary catches it. | Reported by vp run lint |
vize:croquis/cf/undeclared-emit |
The component emits an event that is not declared. | Experimental; not reported by the CLI yet |
vize:croquis/cf/undeclared-prop |
A parent passes a prop the child does not declare. | Experimental; not reported by the CLI yet |
vize:croquis/cf/undefined-slot |
A parent fills a slot the child does not expose. | Planned; not reported yet |
vize:croquis/cf/unhandled-event |
A child emits an event that no parent handles. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unmatched-inject |
inject names a key that no ancestor provides. |
Reported by vp run lint |
vize:croquis/cf/unmatched-listener |
A parent listens for an event the child does not emit. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unregistered-component |
A template uses a component that is not registered or imported. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unresolved-import |
An import does not resolve to a module. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-attrs |
Fallthrough attributes are passed to a multi-root component that does not use them. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-emit |
A declared emit is never used. | Experimental; not reported by the CLI yet |
vize:croquis/cf/unused-provide |
A provided key is never injected. | Reported by vp run lint |
vize:croquis/cf/value-extraction-breaks-reactivity |
Reading a reactive value out into a local drops later updates. | Reported by vp run lint |
vize:croquis/cf/watch-can-be-computed |
A watcher only copies a value into state and can be a computed. | Planned; not reported yet |
vize:croquis/cf/watcheffect-async |
Guard async watchEffect work against invalidation and stale responses. | Reported by vp run lint |
vize:croquis/cf/watcher-outside-setup |
watch or watchEffect is called outside setup. |
Planned; not reported yet |
vue/cross-file-attrs-fallthrough |
A parent passes attributes to a resolved child whose root cannot inherit them and does not explicitly use $attrs. | Reported by vp run lint |