Vize

ecosystem/tailwind-enforce-consistent-line-wrapping

Enforce consistent line wrapping of long Tailwind CSS class lists.

Default severity Presets Automatic fix Options
warning None Yes Rule options

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

Bad

The class list makes its line longer than 80 characters.

<template>
  <div class="flex items-center justify-between gap-4 rounded-lg border border-slate-200 bg-white p-4 shadow-sm">Card</div>
</template>

Good

The classes wrap onto indented lines within 80 characters.

<template>
  <div class="
    flex items-center justify-between gap-4 rounded-lg border border-slate-200
    bg-white p-4 shadow-sm
  ">Card</div>
</template>

Configuration (Vite+)

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

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "ecosystem/tailwind-enforce-consistent-line-wrapping": "warn"
    }
  },
});

Then run vp run lint.