adamhollett / retext-usage

Warn about incorrect English usage with retext
MIT License
11 stars 3 forks source link

retext-usage

Check phrases for incorrect English usage with retext.

Usage

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

retext()
    .use(usage)
    .process([
        'Repeat ad nauseum.',
        'Get some money from the ATM machine.',
        'This is majorly inappropriate.'
    ].join('\n'), function (err, file) {
        console.log(report(file));
    });

Yields:

<stdin>
   1:8-1:18  warning  Replace “ad nauseum” with “ad nauseam”                      ad nauseum
  2:25-2:36  warning  Replace “ATM machine“ with “ATM”                            ATM machine
   3:9-3:16  warning  Replace “majorly” with “extremely”, or remove it            majorly

⚠ 3 warnings

License

MIT © Adam Hollett