# noUnknownUnit

Rule `biome/noUnknownUnit`. Disallow unrecognized CSS units.

- Source: biome
- Technologies: CSS
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #571 by reach, #206 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/noUnknownUnit` | yes | no | group correctness, since 1.8.0 | [docs](https://biomejs.dev/linter/rules/no-unknown-unit/) |

## Code examples

### Incorrect: the rule reports this

```css
a {
  width: 10pixels;
}
```

```css
a {
  width: calc(10px + 10pixels);
}
```

### Correct: the rule accepts this

```css
a {
  width: 10px;
}
```

```css
a {
  width: 10Px;
}
```

```css
a {
  width: 10pX;
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noUnknownUnit": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noUnknownTypeSelector](https://lintradar.dev/rules/biome/noUnknownTypeSelector.md): Disallow unrecognized element names in type selectors.
- [biome/noUnmatchableAnbSelector](https://lintradar.dev/rules/biome/noUnmatchableAnbSelector.md): Disallow `An+B` formulas that cannot select an element.
- [biome/noUnknownPseudoElement](https://lintradar.dev/rules/biome/noUnknownPseudoElement.md): Disallow unrecognized pseudo-element selectors.
- [biome/noUnsafeIframeSandbox](https://lintradar.dev/rules/biome/noUnsafeIframeSandbox.md): Disallow an unsafe combination of the `sandbox` attribute.
- [biome/noUnknownPseudoClass](https://lintradar.dev/rules/biome/noUnknownPseudoClass.md): Disallow unrecognized pseudo-class selectors.
- [biome/noUnusedFunctionParameters](https://lintradar.dev/rules/biome/noUnusedFunctionParameters.md): Disallow unused function parameters.

---

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