All rules

Units spaced two ways

unit-spacing-consistencyon by default (info)Japanese / English

A number and its unit spaced in some places and not others (5 GB, 5GB)

Example

Flagged
Storage is 5 GB, transfer is 10 GB and the cap is 20GB.
What chaff prints
1:51 "20GB" here, where the document usually writes this unit like "5 GB" (1 of 3)
Fixed
Storage is 5 GB, transfer is 10 GB and the cap is 20 GB.
What chaff prints
no finding

How to fix

Match the way the rest of the document writes units.

Why it matters

A document writing "5 GB" in one place and "5GB" in another makes the reader wonder whether the difference means something, looks pasted together, and splits a search. chaff does not pick a side; unit by unit, it points at the way the document uses less.

What it does not flag

Only the unit symbols on chaff's list are read. One-letter symbols (m, s, g), the percent sign and temperatures (°C) are left out, since many styles write them unspaced on purpose. Units written as words (5 hours), code, and numbers inside versions or addresses (1.2.3GB) are not read. Each unit is compared with itself, so "5 GB" next to "500ms" is not a mix. A no-break space counts as a space. When the less common way is over a third, or the two are equally common, the document is read as using both on purpose.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: unit-spacing-consistency — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax unit-spacing-consistency --why "reason"
Turn it off for the team (chaff.yaml)
rules: unit-spacing-consistency: off
Technical details
Layer
L2
Status
stable
Severity
info
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

strictreported while the less common way is at most 49% of the units
normalreported while the less common way is at most 34% of the units
relaxedreported while the less common way is at most 20% of the units

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

"{written}" here, where the document usually writes this unit like "{usual}" ({count} of {of})

Rewrite depth (chaff fix-plan --depth): light — words and sentences; the structure and the voice stay

Sources

This page is built from the rule's definition file:packages/chaff/rules/unit-spacing-consistency.yaml