-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed as not planned
Labels
👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on🙋 no/questionThis does not need any changesThis does not need any changes
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
unist-util-visit
Steps to reproduce
use typescript, have a simple plugin:
import type { Pluggable } from 'unified'
import { visit } from 'unist-util-visit';
const removePre: Pluggable = (/* options */) => {
return function transformer(tree) {
visit(tree, ['code'], function (node, index, parent) {
// ^ type: any
if (!parent) return;
if (undefined === index) return;
parent.children[index] = {
// ^ type: neverparent should be Parent | undefined as reported by:
- [Types]: type of parent should be Parent #17
- and fixed in https://github.com/syntax-tree/unist-util-visit/pull/18/files
but somewhere alone the line the fix was lost.
Actual behavior
type is incorrect
Expected behavior
type is correct
Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response
Metadata
Metadata
Assignees
Labels
👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on🙋 no/questionThis does not need any changesThis does not need any changes