Title: @wordpress/stylelint-config
Published: March 9, 2021
Last modified: October 9, 2026

---

# @wordpress/stylelint-config

## In this article

 * [Installation](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#installation)
 * [Usage](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#usage)
 * [Presets](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#presets)
    - [SCSS](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#scss)
    - [Stylistic](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#stylistic)
    - [SCSS Stylistic](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#scss-stylistic)
 * [Extending the config](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#extending-the-config)
    - [custom-property-pattern](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#custom-property-pattern)
 * [Contributing to this package](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#contributing-to-this-package)

[ Back to top](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#wp--skip-link--target)

[stylelint](https://stylelint.io/) configuration rules to ensure your CSS is compliant
with the [WordPress CSS Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/).

## 󠀁[Installation](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#installation)󠁿

    ```bash
    $ npm install @wordpress/stylelint-config --save-dev
    ```

**Note**: This package requires Node.js version with long-term support status (check
[Active LTS or Maintenance LTS releases](https://nodejs.org/en/about/previous-releases)).
It is not compatible with older versions.

## 󠀁[Usage](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#usage)󠁿

If you’ve installed `@wordpress/stylelint-config` locally within your project, just
set your `stylelint` config to:

    ```language-json
    {
        "extends": "@wordpress/stylelint-config"
    }
    ```

If you’ve globally installed `@wordpress/stylelint-config` using the `-g` flag, 
then you’ll need to use the absolute path to `@wordpress/stylelint-config` in your
config:

    ```language-json
    {
        "extends": "/absolute/path/to/@wordpress/stylelint-config"
    }
    ```

## 󠀁[Presets](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#presets)󠁿

In addition to the default preset, there is also a SCSS preset and 2 stylistic variant
presets.

### 󠀁[SCSS](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#scss)󠁿

This preset extends both `@wordpress/stylelint-config` and [`stylelint-config-recommended-scss`](https://github.com/kristerkari/stylelint-config-recommended-scss).

    ```language-json
    {
        "extends": [ "@wordpress/stylelint-config/scss" ]
    }
    ```

### 󠀁[Stylistic](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#stylistic)󠁿

This preset extends `@wordpress/stylelint-config` and adds stylistic rules such 
as `indentation`.

    ```language-json
    {
        "extends": [ "@wordpress/stylelint-config/stylistic" ]
    }
    ```

### 󠀁[SCSS Stylistic](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#scss-stylistic)󠁿

This preset extends`@wordpress/stylelint-config`, `@wordpress/stylelint-config/stylistic`
and `@wordpress/stylelint-config/scss`, and adapts some stylistic rules for SCSS.

    ```language-json
    {
        "extends": [ "@wordpress/stylelint-config/scss-stylistic" ]
    }
    ```

## 󠀁[Extending the config](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#extending-the-config)󠁿

Simply add a `"rules"` key to your config and add your overrides there.

For example, to change the `indentation` to four spaces and turn off the `number-
leading-zero` rule:

    ```language-json
    {
        "extends": "@wordpress/stylelint-config/stylistic",
        "rules": {
            "@stylistic/indentation": 4,
            "@stylistic/number-leading-zero": null
        }
    }
    ```

### 󠀁[custom-property-pattern](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#custom-property-pattern)󠁿

The preset disallows `--_gcd-*` and `--_wp-*` custom properties. These are private
and will break at any time.

Stylelint does not merge `custom-property-pattern` values. If your project already
sets this rule, the preset ban is replaced — include `(?!_(?:gcd|wp)-)` in your 
pattern if you want to keep it, for example:

    ```language-json
    {
        "extends": "@wordpress/stylelint-config",
        "rules": {
            "custom-property-pattern": "^(?!_(?:gcd|wp)-)my-prefix-.+"
        }
    }
    ```

## 󠀁[Contributing to this package](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-stylelint-config/?output_format=md#contributing-to-this-package)󠁿

This is an individual package that’s part of the Gutenberg project. The project 
is organized as a monorepo. It’s made up of multiple self-contained software packages,
each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/)
and used by [WordPress](https://make.wordpress.org/core/) as well as other software
projects.

To find out more about contributing to this package or Gutenberg as a whole, please
read the project’s main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).

First published

March 9, 2021

Last updated

October 9, 2026

Edit article

[ Improve it on GitHub: @wordpress/stylelint-config ](https://github.com/WordPress/gutenberg/edit/trunk/packages/stylelint-config/README.md)

[  Previous: @wordpress/style-runtime](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-style-runtime/)

[  Next: @wordpress/sync](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-sync/)