We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
any
unist-util-visit
First of all, thanks so much for the TypeScript Playground and all other TS tooling, amazing effect on robustness of JS code 🙌
In this issue comment in unist-util-visit, I discovered some inconsistent behavior in the TypeScript Playground:
In the TypeScript Playground, the type of node in the callback passed to unist-util-visit is any
node
Playground
/** * @import {Root} from 'mdast' */ import { visit } from "unist-util-visit"; // TS Playground only: Import `@types/mdast` for JSDoc type imports import 'mdast'; export function myPlugin() { /** * @param {Root} tree * @returns {undefined} */ return function (tree) { visit(tree, 'image', function (node) { // ^? any }) } }
...where it is mdast.Image in a local VS Code:
mdast.Image
Reproduction repo: https://github.com/karlhorky/repro-unist-util-visit-node-any
/** * @import {Root} from 'mdast' */ import { visit } from "unist-util-visit"; export function myPlugin() { /** * @param {Root} tree * @returns {undefined} */ return function (tree) { visit(tree, 'image', function (node) { // ^? mdast.Image }) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
First of all, thanks so much for the TypeScript Playground and all other TS tooling, amazing effect on robustness of JS code 🙌
In this issue comment in
unist-util-visit
, I discovered some inconsistent behavior in the TypeScript Playground:Actual
In the TypeScript Playground, the type of
node
in the callback passed tounist-util-visit
isany
Playground
Expected
...where it is
mdast.Image
in a local VS Code:Reproduction repo: https://github.com/karlhorky/repro-unist-util-visit-node-any
The text was updated successfully, but these errors were encountered: