Skip to content
Latchkey

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.

stylelint output
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.

.stylelintrc.json
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

  1. Confirm a config file exists at the project root (or pass --config).
  2. Install each extends package and each plugins package.
  3. 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 plugins before using their rules.
  • Install with npm ci so CI matches the lockfile.

Frequently asked questions

What causes ""No configuration provided""?
The extends/plugins in .stylelintrc reference a package not in node_modules, so a clean npm ci cannot load it.
How do I fix "No configuration provided"?
Add every extended config and plugin as a dev dependency and declare plugins.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card