Skip to content

Commit

Permalink
Update @types/nlcst, unified, utilities, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 8, 2023
1 parent 31d6b3d commit 0e718bd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ export default function retextPassive(options = {}) {
return
}

const start = pointStart(match[0])
const end = pointEnd(match[match.length - 1])

Object.assign(
file.message(
'Don’t use the passive voice',
{start: pointStart(match[0]), end: pointEnd(match[match.length - 1])},
[source, phrase.replace(/\s+/g, '-').toLowerCase()].join(':')
),
file.message('Don’t use the passive voice', {
/* c8 ignore next -- hard to test */
place: start && end ? {start, end} : undefined,
source,
ruleId: phrase.replace(/\s+/g, '-').toLowerCase()
}),
{actual: toString(match), expected: [], url}
)
})
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
"list.js"
],
"dependencies": {
"@types/nlcst": "^1.0.0",
"nlcst-search": "^3.0.0",
"nlcst-to-string": "^3.0.0",
"unified": "^10.0.0",
"unist-util-find-before": "^3.0.0",
"unist-util-position": "^4.0.0"
"@types/nlcst": "^2.0.0",
"nlcst-search": "^4.0.0",
"nlcst-to-string": "^4.0.0",
"unified": "^11.0.0",
"unist-util-find-before": "^4.0.0",
"unist-util-position": "^5.0.0"
},
"devDependencies": {
"@types/tape": "^5.0.0",
"c8": "^8.0.0",
"prettier": "^3.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"retext": "^8.0.0",
"retext": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
Expand Down
14 changes: 7 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ test('retext-passive', (t) => {
t.deepEqual(
JSON.parse(JSON.stringify(file.messages[0])),
{
name: '1:8-1:16',
column: 8,
fatal: false,
message: 'Don’t use the passive voice',
reason: 'Don’t use the passive voice',
line: 1,
column: 8,
source: 'retext-passive',
ruleId: 'withheld',
position: {
name: '1:8-1:16',
place: {
start: {line: 1, column: 8, offset: 7},
end: {line: 1, column: 16, offset: 15}
},
fatal: false,
reason: 'Don’t use the passive voice',
ruleId: 'withheld',
source: 'retext-passive',
actual: 'withheld',
expected: [],
url: 'https://github.com/retextjs/retext-passive#readme'
Expand Down

0 comments on commit 0e718bd

Please sign in to comment.