๐ ๏ธ Rollout and fix safety
eslint-plugin-vite currently focuses on report-only rules.
That is intentional.
Most Vite and Vitest mistakes involve configuration intent, not just syntax. A blanket autofix can easily replace one broken setup with a different broken setup.
Safe rollout orderโ
- Fix config exports.
- Fix
envPrefixandresolve.aliasissues. - Fix
import.meta.glob()calls. - Fix
import.meta.envaccess patterns. - Split mixed test and benchmark files only after the rest of the suite is stable.
Why these rules are mostly report-onlyโ
defineConfig(...)fixes often require import changes.- env-prefix fixes depend on your deployment and secret-management model.
- alias fixes depend on ESM path helpers,
path.resolve, orfileURLToPath(new URL(...)). - Vitest workspace fixes require naming decisions that only the maintainer can make.
Review guidanceโ
When a rule fires, prefer fixing the underlying setup pattern instead of only silencing the lint warning.
Examples:
- If
resolve.aliasuses"./src", switch to an absolute replacement and keep the pattern consistent across the repo. - If
import.meta.env.SECRET_TOKENappears in client code, move that read to server-only code or expose a deliberate public value. - If a file mixes
bench()andtest(), split correctness assertions and benchmarks into separate files.