Skip to main content

no-vitepress-empty-head

Disallow empty head arrays in committed VitePress config.

Rule catalog ID: R065

Targeted pattern scopeโ€‹

  • .vitepress/config.*
  • head

What this rule reportsโ€‹

This rule reports static empty-array assignments like head: [] in VitePress config files.

Why this rule existsโ€‹

An explicit empty head array is usually placeholder noise and can hide intended metadata setup. Keeping head either populated or omitted improves config clarity.

โŒ Incorrectโ€‹

import { defineConfig } from "vitepress";

export default defineConfig({
head: [],
});

โœ… Correctโ€‹

import { defineConfig } from "vitepress";

export default defineConfig({
head: [["meta", { name: "description", content: "Docs" }]],
});

Behavior and migration notesโ€‹

  • this rule only applies to .vitepress/config.*
  • it checks static array literals only

ESLint flat config exampleโ€‹

import vite from "@typpi/eslint-plugin-vite";

export default [vite.configs.vitepress];

When not to use itโ€‹

Disable this rule only if explicit empty head arrays are intentional in your project templates.

Package documentationโ€‹

Further readingโ€‹