# noUndeclaredClasses

Rule `biome/noUndeclaredClasses`. Reports CSS class names in JSX `className` or `class` attributes that are not defined in any imported CSS file.

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

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

### Correct: the rule accepts this

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

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

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

## Related rules

- [biome/noTailwindRestyledComponents](https://lintradar.dev/rules/biome/noTailwindRestyledComponents.md): Disallow Tailwind utilities that override the appearance of components.
- [biome/noUndeclaredCustomProperties](https://lintradar.dev/rules/biome/noUndeclaredCustomProperties.md): Reports custom properties used with `var()` that have no visible declaration.
- [biome/noTailwindRestrictedClasses](https://lintradar.dev/rules/biome/noTailwindRestrictedClasses.md): Disallow Tailwind CSS classes and variants that your project doesn't allow.
- [biome/noUnsafeTypeAssertion](https://lintradar.dev/rules/biome/noUnsafeTypeAssertion.md): Disallow TypeScript type assertions other than const assertions.
- [biome/noTailwindRawColors](https://lintradar.dev/rules/biome/noTailwindRawColors.md): Disallow Tailwind CSS utility classes that use raw palette colors.
- [biome/noUntrustedLicenses](https://lintradar.dev/rules/biome/noUntrustedLicenses.md): Disallow dependencies with untrusted licenses.

---

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