Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript definitions #15

Closed
rbusquet opened this issue Apr 6, 2021 · 1 comment
Closed

Typescript definitions #15

rbusquet opened this issue Apr 6, 2021 · 1 comment
Labels
help wanted 🙏 This could use your insight or help

Comments

@rbusquet
Copy link

rbusquet commented Apr 6, 2021

Subject of the feature

I'm using rehype-highlight with frameworks like nextjs and remix.run, and when importing the package, I get missing errors on missing type definitions when using TS.

Problem

TS linters error with Could not find a declaration file for module 'rehype-highlight'.. Not a huge problem--I see other packages in the org have their types defined.

Expected behavior

I should be able to import highlight from "rehype-highlight" without linter errors on TS.

Alternatives

  • @ts-ignore given that I just pass the module to a plugins list
  • use inline require

I'd be happy to help with a PR to add the types, following other examples!

@rbusquet rbusquet added 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Apr 6, 2021
@wooorm
Copy link
Member

wooorm commented Apr 6, 2021

We are currently adding types gradually, and your help is appreciated. You can see some examples of types being added in
syntax-tree/xast-util-sitemap#1, syntax-tree/hast-util-sanitize#21, and syntax-tree/mdast-util-to-string#5
Note that for types as a dts file, using DTSLint and/or type coverage is highly recommended.

More recently there has been a push to get types generated from JSDoc
wooorm/zwitch@88b233d and wooorm/zwitch#6

Either works, and a PR would be welcome!


Closing this issue as we don't want to keep a types tracker issue in each of the 300+ unified repos.

@wooorm wooorm closed this as completed Apr 6, 2021
@wooorm wooorm added help wanted 🙏 This could use your insight or help and removed 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 This could use your insight or help
Development

No branches or pull requests

2 participants