syntax-tree / unist-util-select

utility to select unist nodes with CSS-like selectors

Home Page:https://unifiedjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include `@types/unist` in dependencies

Ayc0 opened this issue · comments

Initial checklist

Affected packages and versions

3.0.1 but I think it's still the case in the v4

Link to runnable example

I don't have any 😕

Steps to reproduce

When using a TS project that depends on unist-util-select, TypeScript throws this error:

unist-util-select/types/index.d.ts:3:20 - error TS2307: Cannot find module 'unist' or its corresponding type declarations.

3 import {Node} from 'unist'
                     ~~~~~~~

To fix that, we could include @types/unist in the dependencies (not devDeps) or in the peerDependencies of unist-util-select, so that it'll be shipped / will notify the package manager that it needs @types/unist

Expected behavior

It shouldn't throw any error

Actual behavior

It throws this error:

unist-util-select/types/index.d.ts:3:20 - error TS2307: Cannot find module 'unist' or its corresponding type declarations.

3 import {Node} from 'unist'
                     ~~~~~~~

Runtime

Node v16

Package manager

yarn v2

OS

macOS

Build and bundle tools

Webpack

commented

Sure! Can you work on a PR?

Hi! This was marked as ready to be worked on! Note that while this is ready to be worked on, nothing is said about priority: it may take a while for this to be solved.

Is this something you can and want to work on?

Team: please use the area/* (to describe the scope of the change), platform/* (if this is related to a specific one), and semver/* and type/* labels to annotate this. If this is first-timers friendly, add good first issue and if this could use help, add help wanted.

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.