---
title: "prefer-sorted-utilities"
description: "Reports utilities that are not in sorted order."
image: "https://stillwind.dev/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://stillwind.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# prefer-sorted-utilities

This rule reports utilities that are not in the order that `stillwind fmt` uses.
The order does not change the CSS. A consistent order makes utilities easier to
read and diffs smaller. The `stylistic` preset enables this rule.

## Reported

```tsx
style("px-4 flex");
```

> prefer-sorted-utilities: utilities are not in compiler order
> 
> Example:1:8

## Fixed

```tsx
style("flex px-4");
```

## How to fix

Run `stillwind fmt`, or `stillwind lint --fix` with this rule enabled. The editor
also sorts on save with `source.sort.stillwind`.

`stillwind fmt` sorts even when this rule is off. To stop all sorting, set
`sort: false`. See [Sorting](/docs/configuration#sorting).

## Rule settings

| Preset | Severity |
| --- | --- |
| `recommended` | off |
| `strict` | off |
| `stylistic` | warn |

[Configure lint](/docs/configuration#lint) to change the severity or options.

The CLI and the editor report this rule only when they analyze the whole project.

Source: https://stillwind.dev/docs/lints/prefer-sorted-utilities/index.mdx
