Skip to documentation

package

@stackline/retext-equality 1.0.3 — installation and API

retext plugin to warn about possible insensitive, inconsiderate language

Install @stackline/retext-equality

npm install @stackline/[email protected]

Package version: 1.0.3. Metadata verified: 2026-11-12. This is separate from the framework version and demonstration runtime.

Node.js requirement
{}
Accepted peer dependencies (declared ranges)
{}

Tested environments are described in the versioned README and linked source checks. A declared peer range is not evidence that every version in it was tested.

Versioned reference

This reference comes from the published @stackline/[email protected] README. Its upstream attribution and license remain with the source. Benchmark and security statements describe the cited tests and advisories, not a guarantee for every application.

@stackline/retext-equality

retext plugin to warn about possible insensitive, inconsiderate language.

Documentation | npm | Issues | Repository

Current package version: 1.0.3


Why this package?

@stackline/retext-equality is the Stackline-maintained distribution of [email protected]. It is an independent continuation of retext-equality; original authors and licenses remain credited below.

Compatibility

Item Value
Package @stackline/[email protected]
API target [email protected]
Supported Node.js See supported framework requirements
License MIT
Module type module
Main entry index.js
Types index.d.ts
Runtime dependencies vfile, unified, quotation, @types/nlcst, @types/unist, nlcst-search, unist-util-is, nlcst-normalize, nlcst-to-string, unist-util-visit

Installation

npm install @stackline/retext-equality

Preserve existing imports and plugin resolution with an npm alias:

npm install retext-equality@npm:@stackline/retext-equality

Usage and API reference

retext-equality

retext plugin to check for possible insensitive, inconsiderate language.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install @stackline/retext-equality

Use

Say we have the following file, example.txt:

He’s pretty set on beating your butt for sheriff.

…and our script, example.js, looks like this:

import {readSync} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {unified} from 'unified'
import retextEnglish from 'retext-english'
import retextEquality from '@stackline/retext-equality'
import retextStringify from 'retext-stringify'

const file = readSync('example.txt')

unified()
  .use(retextEnglish)
  .use(retextEquality)
  .use(retextStringify)
  .process(file)
  .then((file) => {
    console.error(reporter(file))
  })

Now, running node example yields:

example.txt
  1:1-1:5  warning  `He’s` may be insensitive, use `They`, `It` instead  he-she  retext-equality

⚠ 1 warning

API

This package exports no identifiers. The default export is retextEquality.

unified().use(retextEquality[, options])

Check for possible insensitive, inconsiderate language.

options.ignore

List of phrases not to warn about (Array.<string>).

options.noBinary

Do not allow binary references (boolean, default: false). By default he is warned about unless it’s followed by something like or she or and she. When noBinary is true, both cases would be warned about.

Messages

See rules.md for a list of rules and how rules work.

Each message is emitted as a VFileMessage on file, with the following fields:

message.source

Name of this plugin ('@stackline/retext-equality').

message.ruleId

See id in rules.md.

message.actual

Current not ok phrase (string).

message.expected

Suggest ok phrase (Array.<string>).

message.note

Extra information, when available (string?).

Contributing

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

To create new patterns, add them in the YAML files in the data/ directory, and run npm install and then npm test to build everything. Please see the current patterns for inspiration. New English rules will be automatically added to rules.md.

Once you are happy with the new rule, add a test for it in test.js and open a pull request.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Credits and original authors

  • Original project: retext-equality.
  • Titus Wormer.
  • Shinnosuke Watanabe.
  • Elliott Hauser.
  • Ryan Tucker.
  • David Simons.
  • rugk.
  • Eli Feasley.
  • Eli Sadoff.
  • Flip Stewart.
  • Catherine Etter.
  • Conlin Durbin.
  • Jen Weber.
  • Matsuko.
  • Saksham Gupta.
  • Aaron Miller.
  • Alicia Gansley.
  • Anna K.
  • Bryce Kahle.
  • Ben Hall.
  • Copyright (c) 2015 Titus Wormer [email protected].
  • Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.