Skip to content

Commit 76559f9

Browse files
committedJan 20, 2025
Refactor to use @imports
1 parent da38235 commit 76559f9

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed
 

‎lib/index.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
/// <reference types="remark-parse" />
2-
/// <reference types="remark-stringify" />
3-
41
/**
5-
* @typedef {import('mdast').Root} Root
6-
* @typedef {import('mdast-util-gfm').Options} MdastOptions
7-
* @typedef {import('micromark-extension-gfm').Options} MicromarkOptions
8-
* @typedef {import('unified').Processor<Root>} Processor
2+
* @import {Options as MdastOptions} from 'mdast-util-gfm'
3+
* @import {Root} from 'mdast'
4+
* @import {Options as MicromarkOptions} from 'micromark-extension-gfm'
5+
* @import {} from 'remark-parse'
6+
* @import {} from 'remark-stringify'
7+
* @import {Processor} from 'unified'
98
*/
109

1110
/**
@@ -31,7 +30,7 @@ const emptyOptions = {}
3130
export default function remarkGfm(options) {
3231
// @ts-expect-error: TS is wrong about `this`.
3332
// eslint-disable-next-line unicorn/no-this-assignment
34-
const self = /** @type {Processor} */ (this)
33+
const self = /** @type {Processor<Root>} */ (this)
3534
const settings = options || emptyOptions
3635
const data = self.data()
3736

‎test/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
3-
* @typedef {import('remark-gfm').Options} Options
2+
* @import {Root} from 'mdast'
3+
* @import {Options} from 'remark-gfm'
44
*/
55

66
import assert from 'node:assert/strict'

0 commit comments

Comments
 (0)
Please sign in to comment.