retext-equality
Version:
Warn about possible insensitive, inconsiderate language with Retext
87 lines (54 loc) • 2.1 kB
Markdown
Warn about possible insensitive, inconsiderate language with
[**retext**][retext].
[][]:
```bash
npm install retext-equality
```
```js
var retext = require('retext');
var report = require('vfile-reporter');
var equality = require('retext-equality');
var file = retext()
.use(equality)
.process('His network was set up with a master and slave.');
console.log(report(file));
```
Yields:
```text
<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
```
Adds warnings for possible insensitive, inconsiderate language to the
processed [virtual file][vfile]s.
* `ignore` (`Array.<string>`) — List of phrases _not_ to 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.
Thanks, contributions are greatly appreciated! :+1: If you add new
patterns, add them in the YAML files in the [`script/`][script]
directory, and run `npm install` and then `npm test` to build
everything.
Please see the current patterns for inspiration.
[][license] © [Titus Wormer][author]
<!-- Definitions -->
[]: https://img.shields.io/travis/wooorm/retext-equality.svg
[]: https://travis-ci.org/wooorm/retext-equality
[]: https://img.shields.io/codecov/c/github/wooorm/retext-equality.svg
[]: https://codecov.io/github/wooorm/retext-equality
[]: https://docs.npmjs.com/cli/install
[]: LICENSE
[]: http://wooorm.com
[]: https://github.com/wooorm/retext
[]: https://github.com/wooorm/vfile
[]: script