Skip to content

Commit 8637118

Browse files
committed
Refactor to use @imports
1 parent ddf0530 commit 8637118

File tree

14 files changed

+19
-15
lines changed

14 files changed

+19
-15
lines changed

lib/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Nodes} Nodes
3-
* @typedef {import('mdast').Parents} Parents
2+
* @import {Nodes, Parents} from 'mdast'
43
*/
54

65
/**

readme.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ Foo
8282
…and a module `example.js`:
8383

8484
```js
85+
/**
86+
* @import {Plugin} from 'unified'
87+
* @import {Root} from 'mdast'
88+
*/
89+
8590
import {zone} from 'mdast-zone'
8691
import {remark} from 'remark'
8792
import {read} from 'to-vfile'
@@ -92,7 +97,7 @@ const file = await remark()
9297

9398
console.log(String(file))
9499

95-
/** @type {import('unified').Plugin<[], import('mdast').Root>} */
100+
/** @type {Plugin<[], Root>} */
96101
function myPluginThatReplacesFoo() {
97102
return function (tree) {
98103
zone(tree, 'foo', function (start, nodes, end) {

test/fixtures/mismatched/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/nodes/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import assert from 'node:assert/strict'

test/fixtures/non-marker/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/range-children/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import assert from 'node:assert/strict'

test/fixtures/remove-children/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/remove-subsequent/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/remove/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/replace-children/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/replace-subsequent/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/replace/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import {zone} from 'mdast-zone'

test/fixtures/simple/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import assert from 'node:assert/strict'

test/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
2+
* @import {Root} from 'mdast'
33
*/
44

55
import assert from 'node:assert/strict'

0 commit comments

Comments
 (0)