Vize

ecosystem/tailwind-no-unnecessary-whitespace

Disallow unnecessary whitespace in Tailwind CSS class lists.

Default severity Presets Automatic fix Options
warning None Yes None

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

Bad

The class value starts and ends with a space and separates two classes with two spaces.

<template>
  <div class=" flex  items-center ">Tailwind</div>
</template>

Good

One space separates the classes, with no space at the start or end of the value.

<template>
  <div class="flex items-center">Tailwind</div>
</template>

Configuration (Vite+)

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

export default defineConfig({}).withVue({
  linter: {
    "preset": "incremental",
    "rules": {
      "ecosystem/tailwind-no-unnecessary-whitespace": "warn"
    }
  },
});

Then run vp run lint.