no-empty-worker-plugins
July 3, 2026 · View on GitHub
Disallow empty worker.plugins arrays in committed Vite config.
Rule catalog ID: R022
Targeted pattern scope
vite.config.*worker.plugins
What this rule reports
This rule reports explicit worker.plugins: [] assignments in supported config files.
Why this rule exists
An empty worker plugins list is usually accidental placeholder config. Removing no-op arrays keeps worker-specific behavior explicit.
❌ Incorrect
import { defineConfig } from "vite";
export default defineConfig({
worker: {
plugins: [],
},
});
✅ Correct
import { defineConfig } from "vite";
export default defineConfig({
worker: {
plugins: [() => ({ name: "worker-plugin" })],
},
});
Behavior and migration notes
- this rule checks static array literals only
- remove
worker.pluginswhen no worker plugins are needed
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 plugin arrays are intentionally required in your configuration style.