Skip to main content

no-deprecated-config-options

Disallow deprecated Vite config options and deprecated config values that now have clearer replacements.

Rule catalog ID: R010

Targeted pattern scopeโ€‹

  • vite.config.*
  • vitest.config.* when it also carries top-level Vite options
  • nested config paths such as build.*, optimizeDeps.*, and worker.*

What this rule reportsโ€‹

This rule reports deprecated Vite config paths and values that still parse today but are documented as migration targets:

  • esbuild
  • build.polyfillModulePreload
  • build.rollupOptions
  • build.minify: "esbuild"
  • optimizeDeps.disabled
  • optimizeDeps.esbuildOptions
  • worker.rollupOptions

Why this rule existsโ€‹

Deprecated config keys keep old behavior alive in the short term, but they also make upgrades noisier and reviews harder.

When Vite introduces a replacement such as rolldownOptions or oxc, that newer shape becomes the path that receives future fixes, docs updates, and ecosystem examples.

โŒ Incorrectโ€‹

import { defineConfig } from "vite";

export default defineConfig({
build: {
rollupOptions: {
input: "index.html",
},
minify: "esbuild",
polyfillModulePreload: false,
},
optimizeDeps: {
disabled: true,
},
});

โœ… Correctโ€‹

import { defineConfig } from "vite";

export default defineConfig({
build: {
modulePreload: {
polyfill: false,
},
minify: "oxc",
rolldownOptions: {
input: "index.html",
},
},
optimizeDeps: {
include: ["legacy-cjs-dep"],
noDiscovery: true,
},
oxc: {
jsx: {
runtime: "classic",
},
},
worker: {
rolldownOptions: {
output: {
sourcemap: true,
},
},
},
});

Behavior and migration notesโ€‹

  • some replacements are direct key renames, such as build.rollupOptions โ†’ build.rolldownOptions
  • others require a real migration, such as optimizeDeps.disabled, which should usually become optimizeDeps.noDiscovery plus explicit include entries
  • this rule only reports deprecated config surfaces that Vite already documents as deprecated today

ESLint flat config exampleโ€‹

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

export default [vite.configs.configs, vite.configs.strict];

When not to use itโ€‹

Disable this rule temporarily if you are intentionally carrying deprecated config syntax during a staged migration and want to defer the cleanup to a later change.

Package documentationโ€‹

Further readingโ€‹