---
title: "SW01003: Invalid lint configuration"
description: "A lint rule has an option value that the compiler cannot use."
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.

# SW01003: Invalid lint configuration

This error occurs when a lint rule has an option value that the compiler cannot
use, such as an unknown unit or an empty list that the rule requires. The message
names the rule and the value.

## Reported

**stillwind.config.ts**

```ts
import { defineConfig } from "stillwind/config";

export default defineConfig({
  projects: [
    {
      css: "./src/stillwind.css",
      files: ["src/**/*.tsx"],
      lint: {
        rules: {
          "no-restricted-length-units": {
            severity: "warn",
            rules: [{ properties: ["width"], disallow: ["pixels"] }],
          },
        },
      },
    },
  ],
});
```

> SW01003: invalid `no-restricted-length-units` lint configuration: rules require property patterns and valid CSS length units

## Fixed

```ts title="stillwind.config.ts"
import { defineConfig } from "stillwind/config";

export default defineConfig({
  projects: [
    {
      css: "./src/stillwind.css",
      files: ["src/**/*.tsx"],
      lint: {
        rules: {
          "no-restricted-length-units": {
            severity: "warn",
            rules: [{ properties: ["width"], disallow: ["px"] }],
          },
        },
      },
    },
  ],
});
```

## How to fix

- Correct the value named in the message. In the example, the unit is `px`, not
  `pixels`.
- Give the rules that need a list, such as `no-restricted-theme-tokens`, at least
  one entry.

Each [lint rule page](/docs/lints) describes its options.

Source: https://stillwind.dev/docs/errors/SW01003/index.mdx
