Skip to main content

no-empty-optimize-deps-exclude

Disallow empty optimizeDeps.exclude arrays in committed Vite config.

Rule catalog ID: R060

Targeted pattern scopeโ€‹

  • vite.config.*
  • optimizeDeps.exclude

What this rule reportsโ€‹

This rule reports explicit optimizeDeps.exclude: [] assignments in supported config files.

Why this rule existsโ€‹

An empty exclude list has no effect and often indicates unfinished or stale configuration. Removing no-op config reduces maintenance noise.

โŒ Incorrectโ€‹

import { defineConfig } from "vite";

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

โœ… Correctโ€‹

import { defineConfig } from "vite";

export default defineConfig({
optimizeDeps: {
exclude: ["some-dep"],
},
});

Behavior and migration notesโ€‹

  • this rule checks static array literals only
  • remove the option entirely when no exclude entries are required

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 explicit empty arrays are an intentional style requirement in your project.

Package documentationโ€‹

Further readingโ€‹