retext-equality
retext plugin to warn about possible insensitive, inconsiderate language
Last updated 16 days ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install retext-equality 
SYNC missed versions from official npm registry.

retext-equality

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to check for possible insensitive, inconsiderate language.

Install

npm:

npm install 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:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var english = require('retext-english')
var stringify = require('retext-stringify')
var equality = require('retext-equality')

unified()
  .use(english)
  .use(equality)
  .use(stringify)
  .process(vfile.readSync('example.txt'), function(err, file) {
    console.error(report(err || 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

retext().use(equality[, 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 ('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?).

Related

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

Current Tags

  • 5.1.0                                ...           latest (16 days ago)

44 Versions

  • 5.1.0                                ...           16 days ago
  • 5.0.0                                ...           4 months ago
  • 4.5.0                                ...           6 months ago
  • 4.4.0                                ...           6 months ago
  • 4.3.0                                ...           7 months ago
  • 4.2.0                                ...           9 months ago
  • 4.1.0                                ...           9 months ago
  • 4.0.0                                ...           a year ago
  • 3.10.1                                ...           a year ago
  • 3.10.0                                ...           a year ago
  • 3.9.1                                ...           a year ago
  • 3.9.0                                ...           a year ago
  • 3.8.0                                ...           2 years ago
  • 3.7.0                                ...           2 years ago
  • 3.6.0                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 3.4.1                                ...           2 years ago
  • 3.4.0                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.5.0                                ...           4 years ago
  • 2.4.0                                ...           4 years ago
  • 2.3.3                                ...           4 years ago
  • 2.3.2                                ...           4 years ago
  • 2.3.1                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.1                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.6.4                                ...           5 years ago
  • 1.6.3                                ...           5 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2016 © taobao.org |