retext-passive

retext plugin to check for passive voice

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
retext-passive
1304.2.0a year ago7 years agoMinified + gzip package size for retext-passive in KB

Readme

retext-passive
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sizesize-badgesize !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
retextretext plugin to check for passive voice.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.
npm install retext-passive
## Use

Say we have the following file, `example.txt`:

```txt
He was withheld while we were being fed.

…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 retextPassive from 'retext-passive'
import retextStringify from 'retext-stringify'

const file = readSync('example.txt')

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

Now, running node example yields:
example.txt
   1:8-1:16  warning  Don’t use the passive voice  withheld  retext-passive
  1:37-1:40  warning  Don’t use the passive voice  fed       retext-passive

⚠ 2 warnings

API

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

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

Check for passive voice.
options.ignore
Phrases not to warn about (Array.<string>).

Messages

Each message is emitted as a VFileMessagemessage on file, with the following fields:
message.source
Name of this plugin ('retext-passive').
message.ruleId
Any word in list.jslist.
message.actual
Current not ok phrase (string).
message.expected
Empty array to signal that actual should be removed ([]).

Related

— Check possible insensitive, inconsiderate language
— Check for profane and vulgar wording
— Check phrases for simpler alternatives

Contribute

See contributing.mdcontributing in retextjs/.githubhealth for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Titus Wormerauthor