A Vite plugin that integrates Stylelint for linting CSS/SCSS/Less files during development and build. Current stable version 6.1.0, actively maintained with support for Vite 2–8 and Stylelint 13–17. Requires Node >=18. Key differentiator: runs linting in a worker thread for non-blocking performance, and automatically handles imported style files without extra file watchers (chokidar removed in v6). Ships TypeScript types and supports both ESM and CJS.
npm install vite-plugin-stylelintVerified import paths — ran on the pinned version, not inferred.
Basic integration of vite-plugin-stylelint in Vite config with optional include/exclude patterns and lint-on-start disabled.
Update your configuration: the 'chokidar' option no longer exists. If you relied on custom chokidar options, remove them.
No action needed unless you pin an older version of the plugin.
Install @types/stylelint@^13 and postcss@^7 || ^8 as devDependencies if using Stylelint v13. Better yet, upgrade Stylelint.
Run `npm install stylelint -D` and create a stylelint configuration file.
Upgrade to v6.0.0 or later.
Run `npm install vite-plugin-stylelint -D` and ensure it is in your devDependencies.
Use `import stylelint from 'vite-plugin-stylelint'` (default import).
Ensure you call the default export as a function in the plugins array: `stylelint()`.
Install a compatible version: `npm install stylelint@^16 -D`.