# noUnmatchableAnbSelector

Rule `biome/noUnmatchableAnbSelector`. Disallow `An+B` formulas that cannot select an element.

- 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: #572 by reach, #207 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```css
a:nth-child(0) {}
```

```css
a:nth-last-child(0n) {}
```

```css
a:nth-of-type(0n+0) {}
```

### Correct: the rule accepts this

```css
a:nth-child(1) {}
```

```css
a:nth-last-child(1n) {}
```

```css
a:nth-of-type(1n+0) {}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noUnmatchableAnbSelector": "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/noUnknownUnit](https://lintradar.dev/rules/biome/noUnknownUnit.md): Disallow unrecognized CSS units.
- [biome/noUnsafeIframeSandbox](https://lintradar.dev/rules/biome/noUnsafeIframeSandbox.md): Disallow an unsafe combination of the `sandbox` attribute.
- [biome/noUnknownTypeSelector](https://lintradar.dev/rules/biome/noUnknownTypeSelector.md): Disallow unrecognized element names in type selectors.
- [biome/noUnusedFunctionParameters](https://lintradar.dev/rules/biome/noUnusedFunctionParameters.md): Disallow unused function parameters.
- [biome/noUnknownPseudoElement](https://lintradar.dev/rules/biome/noUnknownPseudoElement.md): Disallow unrecognized pseudo-element selectors.
- [biome/noUnusedImports](https://lintradar.dev/rules/biome/noUnusedImports.md): Disallow unused imports.

---

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