---
title: "ineffective-anchor-scope"
description: "Reports an empty or repeated ref list in an anchor scope."
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.

# ineffective-anchor-scope

This rule reports an anchor scope with an empty ref list, or with a ref listed
twice. An empty list sets no `anchor-scope`, and a repeated ref adds nothing.

## Reported

```tsx
style(style.anchorScope([]));
```

> ineffective-anchor-scope: anchor scope is empty; no scope declaration is emitted
> 
> Example:1:7

## Fixed

```tsx
const trigger = style.ref("trigger");
style(style.anchorScope([trigger]));
```

## How to fix

Write the scope that you mean:

- List the refs whose anchor names this element limits, as in the example.
- Use `"all"` to limit every anchor name.
- Use `"none"` to set `anchor-scope: none`.

See [style.anchorScope()](/docs/macros/anchor-scope#inputs).

## Rule settings

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

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

Source: https://stillwind.dev/docs/lints/ineffective-anchor-scope/index.mdx
