# noUnusedClasses

Rule `biome/noUnusedClasses`. Reports CSS class selectors that are never referenced in any JSX or HTML file.

- Source: biome
- Technologies: CSS
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1950 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noUnusedClasses` | no | no | group nursery, since 2.5.0 | [docs](https://biomejs.dev/linter/rules/no-unused-classes/) |

## Code examples

### Incorrect: the rule reports this

```css
.unused { color: red; }  /* Class "unused" is never referenced */
.used { color: blue; }
```

```jsx
import "./styles.css";
export default () => <div className="used" />;
```

### Correct: the rule accepts this

```css
.button { color: blue; }
.container { padding: 1rem; }
```

```jsx
import "./styles.css";
export default () => (
    <div className="container">
        <button className="button">Click</button>
    </div>
);
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noUnusedClasses": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noUntrustedLicenses](https://lintradar.dev/rules/biome/noUntrustedLicenses.md): Disallow dependencies with untrusted licenses.
- [biome/useAstroClientOnlyDirectiveValue](https://lintradar.dev/rules/biome/useAstroClientOnlyDirectiveValue.md): Require a value for Astro's `client:only` directive.
- [biome/noUnsafeTypeAssertion](https://lintradar.dev/rules/biome/noUnsafeTypeAssertion.md): Disallow TypeScript type assertions other than const assertions.
- [biome/useAwaitThenable](https://lintradar.dev/rules/biome/useAwaitThenable.md): Enforce that `await` is _only_ used on `Promise` values.
- [biome/noUndeclaredCustomProperties](https://lintradar.dev/rules/biome/noUndeclaredCustomProperties.md): Reports custom properties used with `var()` that have no visible declaration.
- [biome/useConsistentBooleanProps](https://lintradar.dev/rules/biome/useConsistentBooleanProps.md): Require a consistent style for JSX props with the value `true`

---

Web page: https://lintradar.dev/rules/biome/noUnusedClasses. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
