Stylelint "Could not find ... config" / "Unknown rule" - Fix in CI
Stylelint fails when it cannot load the configuration it was pointed at - a shareable config (stylelint-config-standard) or plugin that is referenced but not installed - or when a rule belongs to a plugin that was never declared in plugins.
What this error means
Stylelint exits non-zero with No configuration provided, Could not find "stylelint-config-standard", or Unknown rule <plugin>/<rule>. It is deterministic - a missing dependency or unregistered plugin, not flake.
Error: Could not find "stylelint-config-standard". Do you need a `configBasedir`?
# or:
Unknown rule scss/at-rule-no-unknown.Common causes
Shareable config or plugin not installed
The extends/plugins in .stylelintrc reference a package not in node_modules, so a clean npm ci cannot load it.
Rule from an unregistered plugin
A rule like scss/at-rule-no-unknown requires stylelint-scss listed under plugins. Without it, Stylelint treats the rule as unknown.
How to fix it
Install the config and plugins, and register them
Add every extended config and plugin as a dev dependency and declare plugins.
npm install -D stylelint stylelint-config-standard stylelint-scss
// .stylelintrc.json
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-scss"],
"rules": { "scss/at-rule-no-unknown": true }
}Point Stylelint at a real config
- Confirm a config file exists at the project root (or pass
--config). - Install each
extendspackage and eachpluginspackage. - Run
npx stylelint "**/*.css"to reproduce locally with the same config.
How to prevent it
- Declare every extended config and plugin in
devDependencies. - Register plugins in
pluginsbefore using their rules. - Install with
npm ciso CI matches the lockfile.