# Use an em dash instead of an en dash (EK00032)

import { Aside, Badge } from '@astrojs/starlight/components';

An em dash (—) sets off a break or aside within a sentence, so use it there in place of the shorter en dash (–). EkLine flags an en dash used where an em dash belongs (rule EK00032).

## When do you use an em dash instead of an en dash?

The en dash (–) and em dash (—) have distinct jobs: the en dash joins ranges and numbers, while the em dash marks a break or an aside within a sentence. Using the wrong one for a parenthetical break reads as an editing slip and mixes two conventions on the same page. Choosing the em dash for these breaks keeps your punctuation consistent and correct.

## What EkLine flags

EK00032 matches an en dash (–) used where an em dash (—) belongs.

- ❌ **Incorrect:** The CLI – the fastest option – runs locally.
- ✅ **Correct:** The CLI—the fastest option—runs locally.
- ❌ **Incorrect:** EkLine reviews your docs – automatically – on every commit.
- ✅ **Correct:** EkLine reviews your docs—automatically—on every commit.

## How to fix

Replace the en dash with an em dash (—) wherever it marks a break or an aside within the sentence.

<Aside type="note">
An en dash is correct for number ranges and negative numbers. Keep it in those cases and ignore the rule for that line.
</Aside>

## FAQ

### What is the difference between an em dash and an en dash?

The em dash (—) marks a break or aside within a sentence, while the en dash (–) joins ranges and numbers. Using each for its own job keeps your punctuation consistent.

### When should you use an en dash?

Use the en dash for number ranges, such as "5–10 minutes", and for negative numbers. Use the em dash for a break within a sentence.

## Rule details

| Property | Value |
|----------|-------|
| Rule ID | `EK00032` |
| Category | Consistency |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | No |

## Ignore this rule

To keep an en dash on one line, add an inline comment:

```markdown
<!-- ekline-ignore-next-line EK00032 -- en dash marks a number range -->
The process takes 5–10 minutes.
```

To disable the rule across your project, add it to the `ignore` list in your [configuration file](/reviewer/configuration/ignoring-rules/#ignore).

## Related rules

- [EK00034](/reviewer/rules/ek00034/) — Use an en dash for negative numbers
- [EK00028](/reviewer/rules/ek00028/) — Avoid spaces before or after a dash