Skip to main content

no-vitepress-empty-theme-config

Disallow empty themeConfig objects in committed VitePress config.

Rule catalog ID: R064

Targeted pattern scopeโ€‹

  • .vitepress/config.*
  • themeConfig

What this rule reportsโ€‹

This rule reports static empty-object assignments like themeConfig: {} in VitePress config files.

Why this rule existsโ€‹

An empty themeConfig object is usually leftover scaffolding and adds configuration noise. Removing it keeps intent clear and avoids misleading placeholders.

โŒ Incorrectโ€‹

import { defineConfig } from "vitepress";

export default defineConfig({
themeConfig: {},
});

โœ… Correctโ€‹

import { defineConfig } from "vitepress";

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

Behavior and migration notesโ€‹

  • this rule only applies to .vitepress/config.*
  • it checks static object 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 your team intentionally uses empty themeConfig placeholders in committed templates.

Package documentationโ€‹

Further readingโ€‹