Skip to content

Commit 8d411a6

Browse files
committed
Update for changes in @types/unist
1 parent d2b4196 commit 8d411a6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"tape": "^5.0.0",
4646
"type-coverage": "^2.0.0",
4747
"typescript": "^4.0.0",
48-
"xo": "^0.38.0"
48+
"xo": "^0.42.0"
4949
},
5050
"scripts": {
5151
"prepack": "npm run build && npm run format",

test.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
/**
22
* @typedef {import('unist').Node} Node
3+
* @typedef {import('unist').Parent} Parent
34
*/
45

56
import test from 'tape'
67
import remark from 'remark'
78
import {findAfter} from './index.js'
89

910
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.')
11+
/** @type {Parent} */
12+
// @ts-expect-error fine.
1013
var paragraph = tree.children[0]
1114
var children = paragraph.children
1215

1316
test('unist-util-find-after', function (t) {
1417
t.throws(
1518
function () {
16-
// @ts-ignore runtime.
19+
// @ts-expect-error runtime.
1720
findAfter()
1821
},
1922
/Expected parent node/,
@@ -22,7 +25,7 @@ test('unist-util-find-after', function (t) {
2225

2326
t.throws(
2427
function () {
25-
// @ts-ignore runtime.
28+
// @ts-expect-error runtime.
2629
findAfter({type: 'foo'})
2730
},
2831
/Expected parent node/,
@@ -31,7 +34,7 @@ test('unist-util-find-after', function (t) {
3134

3235
t.throws(
3336
function () {
34-
// @ts-ignore runtime.
37+
// @ts-expect-error runtime.
3538
findAfter({type: 'foo', children: []})
3639
},
3740
/Expected child node or index/,
@@ -40,7 +43,6 @@ test('unist-util-find-after', function (t) {
4043

4144
t.throws(
4245
function () {
43-
// @ts-ignore runtime.
4446
findAfter({type: 'foo', children: []}, -1)
4547
},
4648
/Expected positive finite number as index/,
@@ -49,7 +51,6 @@ test('unist-util-find-after', function (t) {
4951

5052
t.throws(
5153
function () {
52-
// @ts-ignore runtime.
5354
findAfter({type: 'foo', children: []}, {type: 'bar'})
5455
},
5556
/Expected child node or index/,
@@ -61,7 +62,7 @@ test('unist-util-find-after', function (t) {
6162
findAfter(
6263
{type: 'foo', children: [{type: 'bar'}, {type: 'baz'}]},
6364
0,
64-
// @ts-ignore runtime.
65+
// @ts-expect-error runtime.
6566
false
6667
)
6768
},
@@ -74,7 +75,7 @@ test('unist-util-find-after', function (t) {
7475
findAfter(
7576
{type: 'foo', children: [{type: 'bar'}, {type: 'baz'}]},
7677
0,
77-
// @ts-ignore runtime.
78+
// @ts-expect-error runtime.
7879
true
7980
)
8081
},

0 commit comments

Comments
 (0)