Skip to content

Commit

Permalink
Add new pattern: replace in order for with for
Browse files Browse the repository at this point in the history
Closes GH-11.
Closes GH-12.

Reviewed-by: Christian Murphy <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
katydecorah authored Feb 14, 2020
1 parent c9d53e9 commit 8d10ea1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,11 @@
"to"
]
},
"in order for": {
"replace": [
"for"
]
},
"in regard to": {
"replace": [
"about",
Expand Down
15 changes: 14 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var retext = require('retext')
var simplify = require('.')

test('simplify', function(t) {
t.plan(3)
t.plan(4)

retext()
.use(simplify)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 8d10ea1

Please sign in to comment.