Skip to content

Include @types/unist in dependencies #12

Closed
@Ayc0

Description

@Ayc0

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions