Skip to content

Commit 348f2f6

Browse files
authored
Fix TypeScript node16 and ESM
Closes GH-12. Related-to: syntax-tree/mdast-util-mdxjs-esm#3. Related-to: syntax-tree/unist-util-visit#35. Reviewed-by: JounQin <admin@1stg.me> Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent c4fdbdb commit 348f2f6

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* @typedef {import('unist').Node} Node
33
* @typedef {import('unist').Parent} Parent
44
* @typedef {import('unist-util-is').Test} Test
5-
* @typedef {import('./complex-types').Action} Action
6-
* @typedef {import('./complex-types').Index} Index
7-
* @typedef {import('./complex-types').ActionTuple} ActionTuple
8-
* @typedef {import('./complex-types').VisitorResult} VisitorResult
9-
* @typedef {import('./complex-types').Visitor} Visitor
5+
* @typedef {import('./complex-types.js').Action} Action
6+
* @typedef {import('./complex-types.js').Index} Index
7+
* @typedef {import('./complex-types.js').ActionTuple} ActionTuple
8+
* @typedef {import('./complex-types.js').VisitorResult} VisitorResult
9+
* @typedef {import('./complex-types.js').Visitor} Visitor
1010
*/
1111

1212
import {convert} from 'unist-util-is'
@@ -40,15 +40,15 @@ export const EXIT = false
4040
export const visitParents =
4141
/**
4242
* @type {(
43-
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
44-
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types').BuildVisitor<Tree>, reverse?: boolean) => void)
43+
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types.js').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
44+
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types.js').BuildVisitor<Tree>, reverse?: boolean) => void)
4545
* )}
4646
*/
4747
(
4848
/**
4949
* @param {Node} tree
5050
* @param {Test} test
51-
* @param {import('./complex-types').Visitor<Node>} visitor
51+
* @param {import('./complex-types.js').Visitor<Node>} visitor
5252
* @param {boolean} [reverse=false]
5353
*/
5454
function (tree, test, visitor, reverse) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
"rimraf": "^3.0.0",
6565
"strip-ansi": "^7.0.0",
6666
"tape": "^5.0.0",
67-
"tsd": "^0.20.0",
67+
"tsd": "^0.22.0",
6868
"type-coverage": "^2.0.0",
69-
"typescript": "^4.0.0",
69+
"typescript": "^4.7.0",
7070
"xo": "^0.49.0"
7171
},
7272
"scripts": {

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"compilerOptions": {
44
"target": "ES2020",
55
"lib": ["ES2020"],
6-
"module": "ES2020",
7-
"moduleResolution": "node",
6+
"module": "Node16",
87
"allowJs": true,
98
"checkJs": true,
109
"declaration": true,

0 commit comments

Comments
 (0)