Skip to main content

require-vitepress-clean-urls-explicit

Require explicit cleanUrls in committed VitePress config.

Rule catalog ID: R067

Targeted pattern scopeโ€‹

  • .vitepress/config.*
  • cleanUrls

What this rule reportsโ€‹

This rule reports VitePress config files that do not define cleanUrls.

Why this rule existsโ€‹

Setting cleanUrls explicitly makes routing/deployment behavior intentional across environments. Implicit defaults can lead to surprises when hosting docs on different platforms.

โŒ Incorrectโ€‹

import { defineConfig } from "vitepress";

export default defineConfig({
title: "Project Docs",
});

โœ… Correctโ€‹

import { defineConfig } from "vitepress";

export default defineConfig({
title: "Project Docs",
cleanUrls: true,
});

Behavior and migration notesโ€‹

  • this rule only applies to .vitepress/config.*
  • either true or false satisfies explicitness

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 deployment pipeline controls URL cleanliness independently and you intentionally avoid this key.

Package documentationโ€‹

Further readingโ€‹