TypeScript Playground Shows Inconsistent `any` for `unist-util-visit` type
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript, typescript
- 領域
- tooling
調査の方向性
リンクされた TypeScript Playground で JavaScript の例を再現し、リンクされた再現リポジトリおよびローカルの VS Code の結果と比較してください。Playground がインポートされた宣言型と callback の推論をどのように処理するかを調査してください。callback パラメーターが any ではなく mdast.Image として報告されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 to unist-util-visit is any
/**
* @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
})
}
}
Expected
...where it is mdast.Image in a local VS Code:
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
})
}
}
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 1.5k
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 5
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TypeScript-Website のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/TypeScript-Website#3611 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/TypeScript-Website#3607 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
microsoft/TypeScript-Website#3039 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/TypeScript-Website#2998 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
microsoft/TypeScript-Website#3650 ·
microsoft/TypeScript-Website の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
EclipseFdn/open-vsx.org#13385 · コメント 1 件 ·
-
S: triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
fix(errors): EHOSTUNREACH from a happy-eyeballs connect is reported as a resolver error (STAMP-80) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
snapshot-labs/stamp#666 ·
-
vangogh
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
knaw-huc/textannoviz#691 ·