Skip to content

Commit 0e718bd

Browse files
committed
Update @types/nlcst, unified, utilities, etc
1 parent 31d6b3d commit 0e718bd

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

index.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ export default function retextPassive(options = {}) {
3737
return
3838
}
3939

40+
const start = pointStart(match[0])
41+
const end = pointEnd(match[match.length - 1])
42+
4043
Object.assign(
41-
file.message(
42-
'Don’t use the passive voice',
43-
{start: pointStart(match[0]), end: pointEnd(match[match.length - 1])},
44-
[source, phrase.replace(/\s+/g, '-').toLowerCase()].join(':')
45-
),
44+
file.message('Don’t use the passive voice', {
45+
/* c8 ignore next -- hard to test */
46+
place: start && end ? {start, end} : undefined,
47+
source,
48+
ruleId: phrase.replace(/\s+/g, '-').toLowerCase()
49+
}),
4650
{actual: toString(match), expected: [], url}
4751
)
4852
})

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@
3333
"list.js"
3434
],
3535
"dependencies": {
36-
"@types/nlcst": "^1.0.0",
37-
"nlcst-search": "^3.0.0",
38-
"nlcst-to-string": "^3.0.0",
39-
"unified": "^10.0.0",
40-
"unist-util-find-before": "^3.0.0",
41-
"unist-util-position": "^4.0.0"
36+
"@types/nlcst": "^2.0.0",
37+
"nlcst-search": "^4.0.0",
38+
"nlcst-to-string": "^4.0.0",
39+
"unified": "^11.0.0",
40+
"unist-util-find-before": "^4.0.0",
41+
"unist-util-position": "^5.0.0"
4242
},
4343
"devDependencies": {
4444
"@types/tape": "^5.0.0",
4545
"c8": "^8.0.0",
4646
"prettier": "^3.0.0",
4747
"remark-cli": "^11.0.0",
4848
"remark-preset-wooorm": "^9.0.0",
49-
"retext": "^8.0.0",
49+
"retext": "^9.0.0",
5050
"rimraf": "^3.0.0",
5151
"tape": "^5.0.0",
5252
"type-coverage": "^2.0.0",

test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ test('retext-passive', (t) => {
2727
t.deepEqual(
2828
JSON.parse(JSON.stringify(file.messages[0])),
2929
{
30-
name: '1:8-1:16',
30+
column: 8,
31+
fatal: false,
3132
message: 'Don’t use the passive voice',
32-
reason: 'Don’t use the passive voice',
3333
line: 1,
34-
column: 8,
35-
source: 'retext-passive',
36-
ruleId: 'withheld',
37-
position: {
34+
name: '1:8-1:16',
35+
place: {
3836
start: {line: 1, column: 8, offset: 7},
3937
end: {line: 1, column: 16, offset: 15}
4038
},
41-
fatal: false,
39+
reason: 'Don’t use the passive voice',
40+
ruleId: 'withheld',
41+
source: 'retext-passive',
4242
actual: 'withheld',
4343
expected: [],
4444
url: 'https://github.com/retextjs/retext-passive#readme'

0 commit comments

Comments
 (0)