Vale CMS Need more than a rule playground? Explore

← Blog

Spell checking is a parsing problem

Vale reads the format before it checks the spelling, so in fifteen markup formats, six programming languages, and three data formats, its output is the misspellings in your prose and nothing else. What that gets you, how fast it is, and how to bring a technical vocabulary along.

Joseph Kato

·7 min read

On this page ›
  1. What Vale reads
  2. Why it matters
  3. What teams do today
  4. Twenty-four formats, at full speed
  5. A technical vocabulary
  6. One tool for spelling and style
  7. How it was measured

A spell checker sees a document as words, and most of a technical document’s words aren’t prose: an identifier in a code block, a path in a URL, an option under a directive. Vale reads the format first. It knows where a Markdown code block starts and ends, that a reStructuredText literal block isn’t prose, and that a link’s text is prose while its target isn’t. So it checks the prose and leaves the rest alone, and what it reports is the misspellings in your writing.

The same goes for the prose outside documents: the comments in source code, which have markup of their own, and the descriptions in a data file. This post shows what that looks like across twenty-four formats, what it costs, and how to give Vale a technical vocabulary.

What Vale reads

Pick a format to see what Vale reported in its excerpt.

Vale found 8 of 8 misspellings and left 7 words of code alone.

1 ---
2 title: Reference for the recieve subsystem
  • recieve typo, reported
3 description: How the seperate cache behaves on restart
  • seperate typo, reported
4 slug: readctx-reference
  • readctx front matter: left alone
5 ---
6
7 A occurence guide to the storage layer
  • occurence typo, reported
8 ======================================
9
10 The pages below describe how the definately cache behaves when a node
  • definately typo, reported
11 rejoins the cluster after a restart.
12
13
14 ## Section 0: the accomodate protocol
  • accomodate typo, reported
15
16 Each request carries a refrence token that the gateway validates before
  • refrence typo, reported
17 forwarding it. A token that has expired is refused, and the caller
18 receives a storag response describing what to retry.
  • storag typo, reported
19
20 Call `loadcfg(ctx)` before reading, or the sesion field stays empty.
  • loadcfg inline code span: left alone
  • sesion typo, reported
21 The `retrycn` and ``itmcache`` helpers do the same thing.
  • retrycn inline code span: left alone
  • itmcache inline code span: left alone
22
23 ```go
24 // storagref configures the client.
  • storagref fenced code block: left alone
25 func pipev2(ctx context.Context) error {
  • pipev2 fenced code block: left alone
26 return nodecfg.Do(ctx)
  • nodecfg fenced code block: left alone
27 }
28 ```
29
misspelling in prose, reported word in code, left alone
The opening of each test document. Misspellings are planted in its prose, and words no dictionary knows in its code, URLs, and other markup; the marks show what Vale did with each.

Pick a format. The planted misspellings sit in headings, paragraphs, list items, link text, and table cells, and the code blocks, URLs, front matter, and directives around them hold words no dictionary knows either. Vale marks the misspellings and leaves the markup alone, because it never sends the markup to the spell checker.

Why it matters

A spell check is useful when every alert is worth acting on. Then it can run in CI and fail the build, and in an editor a red line always means something. When the code around the prose is checked too, the misspellings arrive with a list of identifiers, and the usual answers are to add them to a word list or to write patterns that skip the markup. Both work, and both are configuration someone has to keep up.

Reading the format is the version of that work the format has already done. The grammar knows what’s prose, so there’s nothing to write and nothing to maintain.

What teams do today

We looked at 992 public repositories with a .vale.ini. 132 of them, 13%, also run a second spell checker, and their configuration shows how much care goes into keeping a text-based check quiet on documentation:

  • Patterns for the format. One documentation team maintains fifteen named patterns, among them its own rules for Markdown code blocks and links, so the checker skips them.
  • Word lists that grow with the code. Teams keep a few hundred to over a thousand accepted words. One splits its list into commands, aliases, file extensions, and product terms; another shares 1,600 words across five lists that several repositories pull in.
  • Directories set aside. Generated reference pages and code samples are excluded by path, sometimes into a folder made for the purpose.

Several of these repositories turn Vale’s spelling off and leave spelling to the other tool, and the setups we read lean on that tool’s technical dictionaries, which know the names and terms a general dictionary doesn’t. That’s the gap the next sections close. Vale reads the format, so the patterns and the directories aren’t needed, and a technical dictionary takes care of most of the word list.

Twenty-four formats, at full speed

FormatRead byMisspellings foundFrom markupTimeMemory
Markup
MarkdownVale4,154 of 4,1540
114 ms
62 MB
AsciiDocVale4,653 of 4,6530
143 ms
63 MB
reStructuredTextVale3,615 of 3,6150
130 ms
70 MB
HTMLVale2,758 of 2,7580
80 ms
55 MB
OrgVale3,305 of 3,3050
136 ms
63 MB
Plain textVale3,938 of 3,9380
48 ms
49 MB
MDXVale3,854 of 3,8540
105 ms
63 MB
MySTVale3,642 of 3,6420
150 ms
62 MB
QuartoVale4,021 of 4,0210
104 ms
62 MB
Typsttypst2vast, built in4,382 of 4,3820
124 ms
69 MB
LaTeXVale3,473 of 3,4730
86 ms
53 MB
XMLxsltproc2,391 of 2,3910
85 ms
50 MB
DITADITA Open Toolkit2,441 of 2,4410
2.9 s
314 MB
QDocVale3,332 of 3,3320
99 ms
57 MB
JupyterVale2,062 of 2,0620
82 ms
59 MB
Comments in source code
JavaScriptVale + grammar2,620 of 2,6200
217 ms
147 MB
GoVale + grammar2,953 of 2,9530
170 ms
149 MB
PythonVale + grammar2,576 of 2,5760
262 ms
151 MB
RustVale + grammar3,152 of 3,1520
221 ms
153 MB
JavaVale + grammar2,872 of 2,8720
147 ms
122 MB
KotlinVale + grammar2,756 of 2,7560
235 ms
174 MB
Data files
YAMLVale + View, grammar2,230 of 2,2300
214 ms
148 MB
JSONVale + View1,655 of 1,6550
96 ms
63 MB
TOMLVale + View, grammar2,225 of 2,2250
349 ms
146 MB

Each format's 300 KB test document; a source file's prose is its comments, and a data file's is its named fields and comments. Misspellings found are the planted words in prose Vale reported; from markup counts the planted words in code, URLs, and other markup it reported. Time and memory are for the same document with nothing misspelled, five hyperfine runs after a warm-up; the time bars are on a log scale.

Vale on each format's 300 KB test document: what reads it, the planted misspellings it found, the planted words from code and markup it reported, and what the run cost.

On every format, Vale finds every planted misspelling and reports nothing from the code or markup around it.

Markup. Vale reads thirteen of the fifteen formats itself, in 50 ms to 150 ms and 70 MB or less per document. XML goes through xsltproc and still takes under 150 ms; DITA goes through the DITA Open Toolkit, which takes about 3 s. A 3 MB Markdown document takes about a second, and 1.5 s as reStructuredText; a repository of twenty documents, checked in parallel, takes under a second on every format Vale reads itself.

Comments in source code. Vale finds comments with a tree-sitter grammar, so a // inside a string isn’t a comment, and reads each comment in the markup it’s written in, so a code block inside a doc comment is code. It also knows each language’s documentation conventions: a Go doc link, a Rust intra-doc link, a Python field name, and a # noqa directive are left alone. Each of the six languages here takes 0.15 s to 0.26 s.

Data files. A View names the fields that hold prose, such as a title or a description, and a data file’s comments are read whatever the View selects.

Code and data need a few lines of configuration: the grammars, which vale sync installs, what each language’s comments are written in, and a View for the data files.

ini
StylesPath = styles Grammars = go, python, rust, java, kotlin, javascript, yaml, toml [formats] go = md rs = md kt = md js = md py = rst java = html [*] BasedOnStyles = Vale [*.{yml,json,toml}] View = Data

A technical vocabulary

A dictionary of English doesn’t know kubeadm, Buildx, or vSphere, and technical writing is full of words like them. cspell’s maintainers have spent years collecting them, in MIT-licensed word lists for software terms, companies, file types, and dozens of languages and frameworks.

TechTerms packages those lists as a Vale dictionary: 115,000 terms from 53 of cspell’s lists, each with its license and credit. Add it and Vale.Spelling uses it beside its own dictionary, with no style to configure:

ini
StylesPath = styles Packages = TechTerms [*.md] BasedOnStyles = Vale

Here is what it does on four real documentation sets, each checked whole in one run:

DocumentationFilesWordsWords flagged in proseWith TechTermsTime
Kubernetes1,7341.86 M9695521.4 s
Docker8710.91 M8364700.8 s
Grafana8001.00 M5593220.9 s
CPython (reStructuredText)3400.92 M1,5936971.0 s

It accepts 42% to 56% of the distinct words Vale flagged, and costs about 60 ms at startup. What’s left is mostly each project’s own vocabulary, such as its product names, its API objects, and the people it credits, which is what a project’s word list is for.

One tool for spelling and style

Clean output is one reason to use Vale for spelling. Here are the others:

  • Every format you write in. Markdown, MDX, AsciiDoc, reStructuredText, MyST, Quarto, Org, HTML, XML, DITA, Typst, LaTeX, QDoc, notebooks, and plain text, each read the way its own tools read it, plus the comments in more than twenty programming languages and the prose fields of data files.
  • Exceptions where they belong. A comment in the file turns a rule off for a passage, or for one word: <!-- vale Vale.Spelling["Pulumi"] = NO --> in Markdown, .. vale off in reStructuredText, # vale off in Org. The exception sits next to the text it excuses.
  • One configuration. The same .vale.ini runs spelling, your terminology, and your style guide, so there’s one check to install, one place to tune, and one list of alerts.
  • A vocabulary you review. Accepted and rejected terms are plain text files in your repository, changed in pull requests like everything else, and every rule shares them.
  • Exact positions. Each alert has its line and column, so an editor can underline it and a pull request can comment on the line.
  • Everywhere you write. The same configuration runs on the command line, in CI, in your editor through the language server, in the browser extension, and in your coding assistant.
  • Offline. Vale is a single binary. No text leaves your machine, and thirteen of the fifteen formats need nothing else installed.

How it was measured

Each format gets a generated 300 KB document with two kinds of made-up word planted in it: one kind in prose, where a spell checker should report it, and one in code, URLs, file paths, comments, and other markup, where it shouldn’t. Every planted word is distinct, so each report traces back to one place in the source. Time and memory are measured on a copy of each document with nothing misspelled, using hyperfine, five runs after a warm-up, on an Apple Silicon Mac.

Every run uses Vale.Spelling alone. Typst, LaTeX, and the source and data formats use Vale 3.29.0; the other markup formats use 3.28.1. Source files are read with their grammars installed and the [formats] associations above; the data files’ View names their title, description, notes, and summary fields. XML is read through a twenty-line XSLT naming its prose elements, and DITA through the DITA Open Toolkit.

The survey searched GitHub’s code index for .vale.ini files and added the repositories on our adopters page, 992 in all, then looked in each one for the configuration files of cspell, typos, codespell, textlint, and PySpelling, and in its workflows for their GitHub Actions. The descriptions of individual setups come from reading sixteen of them.

The documentation sets are Kubernetes’ content/en/docs, Docker’s content/manuals, Grafana’s docs/sources, and CPython’s Doc/library, as of November 21, 2026. “Words flagged in prose” counts distinct words, with Vale.Spelling alone and the default configuration; each set was timed over three runs after a warm-up.

The planted words are nonsense to every dictionary, so the format test says nothing about dictionaries or suggestions; the TechTerms figures come from the documentation sets.

Linted by Vale master in 43 ms — no alerts Checked 2026-11-19
Words
1,379
Sentences
78
Paragraphs
23
FK grade
8.8
Flesch ease
63.3
SMOG
10.8
Complex
9%
Read
7 min

One vale run on this file, wall clock. Counts from vale ls-metrics; reading time at 200 words a minute.