---
title: "no-restricted-declarations"
description: "Reports utilities that produce CSS declarations that your project forbids."
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-declarations

This rule reports a utility that produces a CSS declaration that your project
forbids. It checks the generated declarations, so it also catches other
utilities and arbitrary values that produce the same declaration. The rule is off
until you list declarations.

## Configuration

```json
{
  "lint": {
    "rules": {
      "no-restricted-declarations": {
        "severity": "warn",
        "rules": [
          {
            "properties": ["transition-property"],
            "values": ["all"]
          }
        ]
      }
    }
  }
}
```

## Reported

```tsx
style("transition-all");
```

> no-restricted-declarations: declaration `transition-property: all` is forbidden
> 
> Example:1:8

## Fixed

```tsx
style("transition-colors");
```

## How to fix

Name the properties that the component actually animates. The example assumes
that only colors change, so `transition-colors` keeps those transitions. If
opacity or transforms also change, include them, for example with
`transition-[color,opacity,transform]`. Do not replace `all` with a list that
leaves out an intended transition.

## Options

`rules` lists the restrictions. Each entry has `properties` and `values`
patterns, and an optional `message` that explains what to use instead. Patterns
accept `*` and `?` and ignore case. Every matching entry applies.

## Rule settings

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

| Option | Default |
| --- | --- |
| `checkImplementation` | `true` |
| `rules` | `[]` |

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

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