Skip to content

Commit

Permalink
Update retext-equality
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 1, 2019
1 parent 98798bd commit de8b339
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"remark-parse": "^7.0.0",
"remark-retext": "^3.0.0",
"retext-english": "^3.0.0",
"retext-equality": "~4.2.0",
"retext-equality": "~4.3.0",
"retext-profanities": "~5.0.0",
"unified": "^8.0.0",
"unified-diff": "^3.0.0",
Expand Down
23 changes: 14 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Using [yarn][]:
$ yarn global add alex
```

Or you can follow this step-by-step tutorial:
Or you can follow this step-by-step tutorial:
[Setting up alex in your project][setup-tutorial]

<!--alex disable wacko stupid-->
Expand Down Expand Up @@ -285,11 +285,11 @@ Yields:

```txt
example.md
1:5-1:14 warning `boogeyman` may be insensitive, use `boogey` instead boogeyman-boogeywoman retext-equality
1:5-1:14 warning `boogeyman` may be insensitive, use `boogeymonster` instead boogeyman-boogeywoman retext-equality
1:42-1:48 warning `master` / `slaves` may be insensitive, use `primary` / `replica` instead master-slave retext-equality
1:70-1:76 warning Don’t use `slaves`, it’s profane slaves retext-profanities
2:53-2:55 warning `he` may be insensitive, use `they`, `it` instead he-she retext-equality
2:62-2:69 warning `cripple` may be insensitive, use `person with a limp` instead gimp retext-equality
1:69-1:75 warning Don’t use `slaves`, it’s profane slaves retext-profanities
2:52-2:54 warning `he` may be insensitive, use `they`, `it` instead he-she retext-equality
2:61-2:68 warning `cripple` may be insensitive, use `person with a limp` instead gimp retext-equality

⚠ 5 warnings
```
Expand Down Expand Up @@ -423,16 +423,21 @@ alex.text('The `boogeyman`.').messages
Yields:

```js
[ { [1:6-1:15: `boogeyman` may be insensitive, use `boogey` instead]
message: '`boogeyman` may be insensitive, use `boogey` instead',
[
[1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster` instead] {
message: '`boogeyman` may be insensitive, use `boogeymonster` instead',
name: '1:6-1:15',
reason: '`boogeyman` may be insensitive, use `boogey` instead',
reason: '`boogeyman` may be insensitive, use `boogeymonster` instead',
line: 1,
column: 6,
location: Position { start: [Object], end: [Object] },
source: 'retext-equality',
ruleId: 'boogeyman-boogeywoman',
fatal: false } ]
fatal: false,
actual: 'boogeyman',
expected: [ 'boogeymonster' ]
}
]
```

## Workflow
Expand Down
12 changes: 4 additions & 8 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('alex()', function(t) {
].join('\n')
).messages.map(String),
[
'1:5-1:14: `boogeyman` may be insensitive, use `boogeymonster`, `boogey` instead',
'1:5-1:14: `boogeyman` may be insensitive, use `boogeymonster` instead',
'1:42-1:48: `master` / `slaves` may be insensitive, use ' +
'`primary` / `replica` instead',
'2:5-2:11: Don’t use `slaves`, it’s profane',
Expand Down Expand Up @@ -68,7 +68,7 @@ test('alex.text()', function(t) {
)
.messages.map(String),
[
'1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster`, `boogey` instead',
'1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster` instead',
'2:36-2:40: Be careful with `butt`, it’s profane in some cases'
]
)
Expand All @@ -85,9 +85,7 @@ test('alex.text() with allow config', function(t) {
{allow: ['butt']}
)
.messages.map(String),
[
'1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster`, `boogey` instead'
]
['1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster` instead']
)
})

Expand All @@ -102,9 +100,7 @@ test('alex.text() with allow array', function(t) {
['butt']
)
.messages.map(String),
[
'1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster`, `boogey` instead'
]
['1:6-1:15: `boogeyman` may be insensitive, use `boogeymonster` instead']
)
})

Expand Down

0 comments on commit de8b339

Please sign in to comment.