Skip to main content

no-empty-ssr-external

Disallow empty ssr.external arrays in committed Vite config.

Rule catalog ID: R062

Targeted pattern scopeโ€‹

  • vite.config.*
  • ssr.external

What this rule reportsโ€‹

This rule reports explicit ssr.external: [] assignments in supported config files.

Why this rule existsโ€‹

An empty ssr.external array does not change Vite behavior and usually reflects stale config scaffolding. Removing no-op settings keeps SSR config easier to audit.

โŒ Incorrectโ€‹

import { defineConfig } from "vite";

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

โœ… Correctโ€‹

import { defineConfig } from "vite";

export default defineConfig({
ssr: {
external: ["react"],
},
});

Behavior and migration notesโ€‹

  • this rule checks static array literals only
  • remove ssr.external entirely when unused

ESLint flat config exampleโ€‹

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

export default [vite.configs.configs];

When not to use itโ€‹

Disable this rule only if your team intentionally keeps explicit empty placeholders in SSR config.

Package documentationโ€‹

Further readingโ€‹