Vize

vue/single-style-block

Recommend having a single style block.

Default severity Presets Automatic fix Options
warning happy-path, nuxt, ecosystem, opinionated No None

Applies to: Vue SFC templates and blocks, with script context where the rule requires it.

Bad

The component splits its scoped panel and title styles across two style blocks.

<style scoped>
.panel {
  color: red;
}
</style>

<style scoped>
.title {
  color: blue;
}
</style>

Good

Both selectors stay scoped in one style block, satisfying the single-block convention without dropping either style.

<style scoped>
.panel {
  color: red;
}
.title {
  color: blue;
}
</style>

Configuration (Vite+)

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

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "vue/single-style-block": "warn"
    }
  },
});

Then run vp run lint.