---
title: "no-restricted-utilities"
description: "Reports utilities that your project forbids, by name."
image: "https://stillwind.dev/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://stillwind.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# no-restricted-utilities

This rule reports a utility whose name matches a pattern that your project
forbids. It checks the name as written, not the generated CSS. The rule is off
until you list utilities.

## Configuration

```json
{
  "lint": {
    "rules": {
      "no-restricted-utilities": {
        "severity": "warn",
        "utilities": [
          {
            "pattern": "space-*",
            "message": "Use gap on the container."
          }
        ]
      }
    }
  }
}
```

## Reported

```tsx
style("flex flex-col space-y-4");
```

> no-restricted-utilities: utility `space-y-4` is forbidden: Use gap on the container.
> 
> Example:1:22

## Fixed

```tsx
style("flex flex-col gap-4");
```

## How to fix

Follow the message of the matching entry. In the example, the project prefers
`gap` to `space-*`, so the fix keeps the same spacing with `gap-4`.

## Options

`utilities` lists entries with a name `pattern` and an optional `message`.
Patterns accept `*` and `?`, and they are case-sensitive.

To also catch other utilities that produce the same CSS, use
[no-restricted-declarations](/docs/lints/no-restricted-declarations).

## Rule settings

| Preset | Severity |
| --- | --- |
| `recommended` | off |
| `strict` | off |
| `stylistic` | off |

| Option | Default |
| --- | --- |
| `utilities` | `[]` |

[Configure lint](/docs/configuration#lint) to change the severity or options.

Source: https://stillwind.dev/docs/lints/no-restricted-utilities/index.mdx
