#9525·stylelint

Fix `Config` type to accept configuration objects in `extends`

Author: firefoxicCreated Sep 23, 2026Updated Sep 23, 2026

What minimal example or steps are needed to reproduce the bug?

Type-check a JavaScript (or TypeScript) configuration file that extends a configuration object:

javascript
// stylelint.config.js
/** @type {import("stylelint").Config} */
export default {
  extends: [{ rules: { "block-no-empty": true } }],
};

What minimal configuration is needed to reproduce the bug?

The one above.

How did you run Stylelint?

tsc --checkJs --noEmit stylelint.config.js. Stylelint itself runs the configuration fine: stylelint "**/*.css" applies the extended object.

Which Stylelint-related dependencies are you using?

json
{
  "stylelint": "17.15.0"
}

What did you expect to happen?

No type error. Stylelint has accepted a configuration object as an item of extends since #6998 (15.9.0), and augmentConfig.mjs merges it like a loaded config.

What actually happened?

error TS2322: Type '{ rules: { "block-no-empty": true; }; }' is not assignable to type 'string'.

ConfigExtends is still string | string[], and the extends section of the docs lists only "locaters".

Do you have a proposal to fix the bug?

Widen ConfigExtends to string | Config | (string | Config)[], add a case to the type test, and mention the object form in the extends section of docs/user-guide/configure.md. No runtime change.