Skip to content

Commit 48a6c9e

Browse files
committed
Refactor code-style
1 parent 3913540 commit 48a6c9e

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {convert} from 'unist-util-is'
1212
export const findBefore =
1313
/**
1414
* @type {(
15-
* (<T extends Node>(node: Parent, index: Node|number, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>) => T|null) &
15+
* (<T extends Node>(node: Parent, index: Node|number, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>) => T|null) &
1616
* ((node: Parent, index: Node|number, test?: null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>) => Node|null)
1717
* )}
1818
*/

test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* @typedef {import('unist').Node} Node
3-
* @typedef {import('mdast').Root} Root
43
*/
54

65
import assert from 'node:assert'
@@ -9,8 +8,6 @@ import {remark} from 'remark'
98
import {findBefore} from './index.js'
109

1110
test('unist-util-find-before', (t) => {
12-
/** @type {Root} */
13-
// @ts-expect-error: fine.
1411
const tree = remark().parse('Some *emphasis*, **importance**, and `code`.')
1512

1613
assert(tree.type === 'root')
@@ -23,7 +20,7 @@ test('unist-util-find-before', (t) => {
2320

2421
t.throws(
2522
() => {
26-
// @ts-ignore runtime
23+
// @ts-expect-error runtime
2724
findBefore()
2825
},
2926
/Expected parent node/,
@@ -32,7 +29,7 @@ test('unist-util-find-before', (t) => {
3229

3330
t.throws(
3431
() => {
35-
// @ts-ignore runtime
32+
// @ts-expect-error runtime
3633
findBefore({type: 'foo'})
3734
},
3835
/Expected parent node/,
@@ -41,7 +38,7 @@ test('unist-util-find-before', (t) => {
4138

4239
t.throws(
4340
() => {
44-
// @ts-ignore runtime
41+
// @ts-expect-error runtime
4542
findBefore({type: 'foo', children: []})
4643
},
4744
/Expected child node or index/,
@@ -66,7 +63,7 @@ test('unist-util-find-before', (t) => {
6663

6764
t.throws(
6865
() => {
69-
// @ts-ignore runtime
66+
// @ts-expect-error runtime
7067
findBefore({type: 'foo', children: [{type: 'bar'}]}, 1, false)
7168
},
7269
/Expected function, string, or object as test/,
@@ -75,7 +72,7 @@ test('unist-util-find-before', (t) => {
7572

7673
t.throws(
7774
() => {
78-
// @ts-ignore runtime
75+
// @ts-expect-error runtime
7976
findBefore({type: 'foo', children: [{type: 'bar'}]}, 1, true)
8077
},
8178
/Expected function, string, or object as test/,

0 commit comments

Comments
 (0)