---
title: "suspending-macro-argument"
description: "Reports await, yield, or import() inside an argument of style() or another macro."
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.

# suspending-macro-argument

This rule reports `await`, `yield`, or a dynamic `import()` inside an argument of
`style()` or another macro. The compiler can move or skip argument expressions,
so the code would not wait or load where you wrote it.

## Reported

```tsx
async function props() {
  return style({ "--x": await Promise.resolve(1) });
}
```

> suspending-macro-argument: evaluate await, yield, and dynamic imports outside macro arguments, then pass their values
> 
> Example:2:25

## Fixed

```tsx
async function props() {
  const value = await Promise.resolve(1);
  return style({ "--x": value });
}
```

## How to fix

Wait for the value before the call, store it in a variable, and pass the
variable, as in the example.

## 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/suspending-macro-argument/index.mdx
