Vize

css/no-v-bind-performance

Warn about performance cost of CSS v-bind()

Bad · Good

Default severity: warning
Presets: opinionated, nuxt
Automatic fix: None; review the suggested change
Applies to: CSS inside SFC style blocks
Options: No rule-specific options. Severity and preset selection are configurable.

Configuration (Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({
  lint: {
    vize: {
      "preset": "incremental",
      "rules": {
        "css/no-v-bind-performance": "warn"
      }
    },
  },
});
vp run lint

Bad

The stylesheet reads the changing offset through the SFC CSS v-bind() mechanism.

<style scoped>
.card {
  transform: translateX(v-bind(offset));
}
</style>

Good

The element receives the changing transform directly through its style binding.

<template>
  <article :style="{ transform: `translateX(${offset}px)` }" class="card" />
</template>

Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.

Implementation · All rules