Content Lexicon.

Linting

In one line

Checking text automatically against a set of written rules and flagging every place that breaks one.

Linting is a long-established habit in software development. A linter reads code without running it and flags anything that breaks a set of rules, from a variable that’s never used to a construction the compiler accepts but that’s likely to cause trouble. Stephen Johnson wrote the first, Lint, at Bell Labs in 1978 and named it after the fluff a dryer filter collects. Linters now run routinely in programmers’ editors and again before code is merged, so a team’s conventions get checked every time without anyone having to remember them.

The idea transfers neatly to writing, and documentation teams, who often keep their work alongside code already, have been quickest to adopt it. Prose linters such as Vale and proselint compare a draft with a set of rules and report what they find: a banned word, an em dash where house style wants an en dash, a heading in title case, a sentence over forty words. Rules range from simple patterns (this spelling, never that one) to counts and measures such as sentence length or reading level. A linter flags rather than fixes. Some propose a correction, but the decision stays with whoever is writing.

Spellcheckers and grammar checkers have done something similar for decades, but they apply the general rules of a language. Linting comes into its own with the rules particular to an organisation: its house terms, its punctuation choices, the phrases its style guide has ruled out. It also differs from automated testing, which checks whether things work (links resolve, required fields are filled, pages build), and from a copy edit, where a person reads for meaning as well as consistency. A linter checks text against rules, and only the rules someone has written down.

Why it matters for content

Writing a rule down tightly enough for a machine to apply shows what a style guide means. “Avoid jargon” can’t be linted; a list of forty terms with their plain alternatives can. The exercise sorts guidance into three kinds: rules a pattern can check reliably, such as spellings, punctuation and house terms; rules where a pattern can only nominate candidates, such as whether a year belongs in a citation or whether “they” is ambiguous; and rules that stay with judgement, such as whether a paragraph earns its place. Sorting them often exposes guidance that different people had been reading in different ways.

Linting also moves a rule to the moment of writing. A flag in the editor costs a few seconds while the draft is open; the same point raised in review costs a round of comments, and an editor correcting “e-mail” for the hundredth time is attention spent on nothing. Severity needs as much thought as coverage, because a linter that blocks publishing on every warning trains people to switch it off. GitLab’s documentation team fails a build only on errors and leaves warnings and suggestions as information for the writer. And a linter enforces a bad rule as faithfully as a good one. If the guide is wrong, the linter carries the mistake into every page it checks.

How AI changes the picture

Language models can apply rules that patterns can’t. Asked whether “they” is ambiguous in a sentence, whether a year in a citation changes how a reader would treat the source, or whether a paragraph has slipped into a sales register, a model can give a usable answer across thousands of pages. That brings judgement-shaped guidance within reach of automated checking, provided the rule comes with a test the model can apply and examples of passing and failing cases. Without them, a model applies its own reading of the rule, which may not be the editor’s.

Generated text tends to fail in patterned ways (favourite words, stock sentence shapes, a reflexive rhythm of contrasts), which makes linting a natural first check on AI-assisted drafts. Open rule sets for spotting those patterns already exist, and a draft can be run against one before a person reads it. A clean pass is a minimum, though. A draft can avoid every listed pattern and still say nothing.

Model-based checks bring a failure mode that patterns don’t have. A pattern rule does what it says and nothing more; a model interprets the rule, and can misread it, deleting a whole sentence when asked to trim one detail or reporting a check it didn’t run. Model checks are safest when they produce visible flags and proposed changes instead of silent edits, with someone sampling what they pass as well as what they flag.

Questions people ask

Is a linter the same as a style guide?

A linter holds the part of a style guide that can be written as automated checks. The guide still carries the reasoning, examples and judgement calls a linter can’t, and people need it to understand why a rule exists. Keeping the two in step is ongoing work: when the guide changes, the rules have to change with it, or the linter goes on enforcing last year’s decisions.

Should linting block publishing?

For rules where a breach is unambiguous and costly, yes: a trademark, a legally required phrase, markup that breaks the page. Most style rules work better as warnings a writer can see and overrule with a reason. If people override a rule regularly, it probably needs rewriting or downgrading.

What makes a good first rule?

A correction editors make again and again. If the same fix turns up in review after review, it’s a candidate. A dozen reliable rules that people trust do more than two hundred that bury every draft in flags.

Can a linter check voice?

Partly. Patterns can catch the words and constructions a voice avoids, and a model can judge whether a passage drifts from examples of the voice done well. Neither can tell whether the writing sounds like someone with something to say, which is still a job for a reader.

Learn more

  • Vale – an open-source prose linter in which each team writes its own rules, from banned terms to sentence-length limits, and runs them in an editor or a publishing pipeline.
  • Vale documentation tests – GitLab’s working setup, with three levels of result of which only errors fail a build, and its own guidance on when a rule is too subjective or too noisy to enforce.
  • proselint – a contrasting approach: in place of house rules, a ready-made set of checks drawn from usage guides and editors including Bryan Garner, George Orwell and Mary Norris.

Type a term, or a word from its definition.⌘K opens this from any page.