JSPM

  • Created
  • Published
  • Downloads 24418
  • Score
    100M100P100Q156296F
  • License MIT

Warn about possible insensitive, inconsiderate language with Retext

Package Exports

  • retext-equality
  • retext-equality/lib/patterns.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (retext-equality) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

retext-equality Build Status Coverage Status

Warn about possible insensitive, inconsiderate language with retext.

Installation

npm:

npm install retext-equality

retext-equality is also available for duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.

Usage

var retext = require('retext');
var report = require('vfile-reporter');
var equality = require('retext-equality');

retext()
    .use(equality)
    .process([
        'His network was set up with a master and slave.'
    ].join('\n'), function (err, file) {
        console.log(report(file));
    });

Yields:

<stdin>
    1:1-1:4  warning  `His` may be insensitive, use `Their`, `Theirs`, `Them` instead           her-him
  1:31-1:37  warning  `master` / `slave` may be insensitive, use `primary` / `replica` instead  master-slave

⚠ 2 warnings

API

retext.use(equality[, options])

Adds warnings for possible insensitive, inconsiderate language to the processed virtual files.

Parameters

  • equality — This plug-in;

  • options (Object?, optional):

    • ignore (Array.<string>) — List of phrases to not warn about;

    • noBinary (boolean, default: false) — Do not allow binary references. 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.

License

MIT © Titus Wormer