---
title: "invalid-cva-config"
description: "Reports an unknown or malformed field in a style.cva() configuration."
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.

# invalid-cva-config

This rule reports a `style.cva()` configuration that the compiler cannot read,
such as an unknown field, a default for an option that does not exist, or a
configuration that is not written in the call. The factory ignores the invalid
part.

## Reported

```tsx
style.cva("p-4", { variant: { size: { small: "p-2" } } });
```

> invalid-cva-config: invalid style.cva() configuration: unknown configuration property
> 
> Example:1:29

## Fixed

```tsx
style.cva("p-4", { variants: { size: { small: "p-2" } } });
```

## How to fix

- Use the fields `variants`, `defaultVariants`, and `compoundVariants`.
- Write the configuration as an object literal in the call.
- In `defaultVariants` and `compoundVariants`, use only options and values that
  `variants` declares.

See [style.cva()](/docs/macros/cva#configuration).

## Rule settings

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

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

Source: https://stillwind.dev/docs/lints/invalid-cva-config/index.mdx
