# noMisplacedListElements

Rule `biome/noMisplacedListElements`. Require `<li>` elements with an HTML element parent to be children of `<ul>`, `<ol>`, or `<menu>`.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noMisplacedListElements` | yes | no | group nursery, since 2.5.15 | [docs](https://biomejs.dev/linter/rules/no-misplaced-list-elements/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div><li>Item</li></div>
```

```jsx
<ul><div><li /></div></ul>
```

```jsx
<div>{items.map((item) => <li key={item}>{item}</li>)}</div>
```

### Correct: the rule accepts this

```jsx
<>
    <ul><li>Item</li></ul>
    <ol><li>Item</li></ol>
    <menu><li /></menu>
</>
```

```jsx
<ul>{items.map((item) => <li key={item}>{item}</li>)}</ul>
```

```jsx
<li>Item rendered in a list elsewhere</li>
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noMisplacedListElements": "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/noJsxNamespace](https://lintradar.dev/rules/biome/noJsxNamespace.md): Disallow JSX namespace syntax.
- [biome/noMisrefactoredShorthandAssign](https://lintradar.dev/rules/biome/noMisrefactoredShorthandAssign.md): Disallow shorthand assign when variable appears on both sides.
- [biome/noJsonUnsafeValues](https://lintradar.dev/rules/biome/noJsonUnsafeValues.md): Disallow unsafe JSON values that may cause interoperability issues.
- [biome/noMissingVarFunction](https://lintradar.dev/rules/biome/noMissingVarFunction.md): Require `var()` when using a declared CSS custom property.
- [biome/noInvalidPropertyInitValue](https://lintradar.dev/rules/biome/noInvalidPropertyInitValue.md): Checks that the `initial-value` of an `@property` rule follows the value format declared by its `syntax`.
- [biome/noObsoleteAttributes](https://lintradar.dev/rules/biome/noObsoleteAttributes.md): Disallow obsolete attributes on HTML elements.

---

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