Skip to content

Commit

Permalink
Fix TypeScript node16 and ESM
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alecmev committed Aug 21, 2022
1 parent c4fdbdb commit 348f2f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* @typedef {import('unist').Node} Node
* @typedef {import('unist').Parent} Parent
* @typedef {import('unist-util-is').Test} Test
* @typedef {import('./complex-types').Action} Action
* @typedef {import('./complex-types').Index} Index
* @typedef {import('./complex-types').ActionTuple} ActionTuple
* @typedef {import('./complex-types').VisitorResult} VisitorResult
* @typedef {import('./complex-types').Visitor} Visitor
* @typedef {import('./complex-types.js').Action} Action
* @typedef {import('./complex-types.js').Index} Index
* @typedef {import('./complex-types.js').ActionTuple} ActionTuple
* @typedef {import('./complex-types.js').VisitorResult} VisitorResult
* @typedef {import('./complex-types.js').Visitor} Visitor
*/

import {convert} from 'unist-util-is'
Expand Down Expand Up @@ -40,15 +40,15 @@ export const EXIT = false
export const visitParents =
/**
* @type {(
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types').BuildVisitor<Tree>, reverse?: boolean) => void)
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: import('./complex-types.js').BuildVisitor<Tree, Check>, reverse?: boolean) => void) &
* (<Tree extends Node>(tree: Tree, visitor: import('./complex-types.js').BuildVisitor<Tree>, reverse?: boolean) => void)
* )}
*/
(
/**
* @param {Node} tree
* @param {Test} test
* @param {import('./complex-types').Visitor<Node>} visitor
* @param {import('./complex-types.js').Visitor<Node>} visitor
* @param {boolean} [reverse=false]
*/
function (tree, test, visitor, reverse) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"rimraf": "^3.0.0",
"strip-ansi": "^7.0.0",
"tape": "^5.0.0",
"tsd": "^0.20.0",
"tsd": "^0.22.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"typescript": "^4.7.0",
"xo": "^0.49.0"
},
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020"],
"module": "ES2020",
"moduleResolution": "node",
"module": "Node16",
"allowJs": true,
"checkJs": true,
"declaration": true,
Expand Down

0 comments on commit 348f2f6

Please sign in to comment.