All rules

Deprecated name used in an example

deprecated-option-usedon by defaultJapanese / English

An option the document calls deprecated, still used in one of its examples

Example

Flagged
## Options The older `indent` option is deprecated; use `prefix` instead. ```js wrap(text, 40, { indent: 2 }); ```
What chaff prints
6:18 `indent` is used in an example, but the document calls it deprecated
Fixed
## Options The older `indent` option is deprecated; use `prefix` instead. ```js wrap(text, 40, { prefix: " " }); ```
What chaff prints
no finding
chaff.yaml used for this example
genre: technical/readme

How to fix

Rewrite the example with what replaces the deprecated name. If the example shows the old form on purpose, say so in a comment on that line.

Why it matters

When a document says "`indent` is deprecated" and one of its code examples passes `{ indent: 2 }`, the reader copies the example and learns a form that will stop working. It happens when an option is deprecated and the text is updated but the example is not. The code name nearest to "deprecated" in a sentence, and the name in the first cell of a table row that says "deprecated", are read as deprecated. A code-block line that uses one as a key (indent:), an argument (indent=) or a flag (--indent) is pointed out.

What it does not flag

A negated word (not deprecated), a block that declares an API (interface, class, type), a code line that says deprecated itself (an example of the old form), a name used other than as a key, an argument or a flag (inside a string, a member read obj.indent), sentences outside code, and names not written as code are not checked.

Turning it off or relaxing it

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

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).

stricterror
normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

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

Genres

Message

`{name}` is used in an example, but the document calls it deprecated

This page is built from the rule's definition file:packages/chaff/rules/deprecated-option-used.yaml