From 8d10ea14e558a575da417bde38ef8ea15c9cc2c5 Mon Sep 17 00:00:00 2001 From: Katy DeCorah Date: Fri, 14 Feb 2020 05:12:04 -0500 Subject: [PATCH] Add new pattern: replace `in order for` with `for` Closes GH-11. Closes GH-12. Reviewed-by: Christian Murphy Reviewed-by: Titus Wormer --- index.json | 5 +++++ test.js | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/index.json b/index.json index 871c001..770b7dc 100644 --- a/index.json +++ b/index.json @@ -909,6 +909,11 @@ "to" ] }, + "in order for": { + "replace": [ + "for" + ] + }, "in regard to": { "replace": [ "about", diff --git a/test.js b/test.js index 1131c60..4aed4b8 100644 --- a/test.js +++ b/test.js @@ -5,7 +5,7 @@ var retext = require('retext') var simplify = require('.') test('simplify', function(t) { - t.plan(3) + t.plan(4) retext() .use(simplify) @@ -35,6 +35,19 @@ test('simplify', function(t) { ) }) + retext() + .use(simplify) + .process('In order for this to work, clap your hands.', function( + err, + file + ) { + t.deepEqual( + [err].concat(file.messages.map(String)), + [null, '1:1-1:13: Replace `In order for` with `for`'], + 'should warn about wordiness' + ) + }) + retext() .use(simplify) .process(