syntax-tree / hast-util-raw

utility to reparse a hast tree
https://unifiedjs.com
MIT License
11 stars 4 forks source link

Type error when using strict package manager #20

Closed Methuselah96 closed 1 year ago

Methuselah96 commented 1 year ago

Initial checklist

Affected packages and versions

hast-util-raw@8.0.0 and hast-util-raw@9.0.0

Looks like the reference to @types/unist was introduced in https://github.com/syntax-tree/hast-util-raw/pull/17.

Link to runnable example

No response

Steps to reproduce

  1. Create project using hast-util-raw with a strict package manager like Yarn PnP and skipLibCheck set to false.
  2. Type-check using TypeScript.

Expected behavior

No type errors.

Actual behavior

Type error:

ERROR in node_modules/hast-util-raw/lib/index.d.ts:28:28
TS2307: Cannot find module 'unist' or its corresponding type declarations.
    26 | export type Location = import('parse5').Token.Location;
    27 | export type TagToken = import('parse5').Token.TagToken;
  > 28 | export type Point = import('unist').Point;
       |                            ^^^^^^^
    29 | export type VFile = import('vfile').VFile;
    30 | /**
    31 |  * Configuration.

Affected runtime and version

N/A

Affected package manager and version

No response

Affected OS and version

No response

Build and bundle tools

No response

remcohaszing commented 1 year ago

You’re right, this should be an explicit dependency. Would you like to add a PR for this?

github-actions[bot] commented 1 year ago

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.

github-actions[bot] commented 1 year ago

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.

wooorm commented 1 year ago

https://github.com/syntax-tree/hast-util-raw/releases/tag/9.0.1