FAQ
Should I use this plugin?
Usually not. Read Why & Why not? for the cases where the plugin helps, and for the cases where your editor, the CLI or CI already cover it.
Turn the plugin on when you want errors and warnings while Vite runs. Set lintInWorker so the checks stay off the build thread.
Cache looks broken?
- Delete the cache file.
- Fix the problem by hand.
- Restart Vite.
The plugin is slow?
The plugin lints on the main thread by default. That can block the build.
Set lintInWorker to keep Vite responsive. Results print to the console.
You can also run Stylelint next to Vite instead of inside it. vite-plugin-checker is another choice.
Recommended configuration?
customOverlay only applies under serve. fix rewrites files while you work. Drop either one if it does not suit your setup.
Why is the error output all red?
Vite's native error overlay does not render PluginContext.warn output. It shows Stylelint's ANSI-colored string verbatim, so the color distinctions disappear in the browser.
These limits are tracked upstream in #2076, #6274 and #8327.
Set customOverlay: true to render the results natively. Errors and warnings get separate styling.