All lint rules
Every rule Vize's linter ships, grouped by category. Open a rule to see what it reports, a failing and a passing example, and how to turn it on.
The Preset column names the smallest preset that turns a rule on. Rule pages list every preset. See presets for what each one contains.
Vue rules (120)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
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/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/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-template-complexity |
Limit a component's own template complexity (cyclomatic and cognitive). | — | |
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/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-custom-modifiers-on-v-model |
Disallow custom modifiers on v-model used on a component. |
— | |
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-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-lone-template |
Disallow unnecessary <template> elements. |
happy-path |
|
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-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-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-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-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. |
— | |
vue/no-undefined-refs |
Disallow undefined variable references in templates. | — | |
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-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-setup-bindings |
Disallow unread script setup bindings. | — | |
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-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/permitted-contents |
Enforce HTML content model rules. | happy-path |
|
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-true-attribute-shorthand |
Prefer the shorthand for a boolean attribute bound to true. |
nuxt, opinionated |
|
vue/prop-name-casing |
Enforce a casing for declared prop names. | happy-path |
|
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-expose |
Require declare public properties using expose. |
— | |
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 kebab-case for named slots used via v-slot. | nuxt, opinionated |
|
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-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 a method reference or an inline function. | 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 a valid <template> root for Vue 3 fragment semantics. |
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 (82)
| Rule | What it checks | Preset | Auto-fix |
|---|---|---|---|
script/component-options-name-casing |
Enforce PascalCase for the component name option. |
opinionated, nuxt |
|
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>. | — | |
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 plain <script> that only sets name/inheritAttrs. | 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-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/no-floating-promises |
Disallow floating (unhandled) Promises. | nuxt, opinionated |
|
type/no-reactivity-loss |
Disallow plain snapshots of reactive values across assignments and calls. | nuxt, opinionated |
|
type/no-unsafe-template-binding |
Disallow template bindings that resolve to unsafe types. | 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/strict-boolean-expressions |
Require safe boolean expressions in script and template conditions. | — |
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 (30)
| 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/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 |
✓ |
Musea and CSS rules (16)
| 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/no-empty-variant |
Disallow empty <variant> blocks. | — | |
musea/prefer-design-tokens |
Prefer design token CSS variables over hardcoded primitive values. | — | |
musea/require-component |
Require component attribute in <art> block. | — | |
musea/require-title |
Require title attribute in <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)
Turn these checks on with crossFile: true in the linter passed to withVue, or run vize lint --cross-file. Diagnostics are shown as vize:croquis/cf/<name>; configure them in linter.rules as croquis/cf/<name>, without vize:.
| 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 |