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

Added @types/unist to package.json dependencies #4

Closed
wants to merge 3 commits into from
Closed

Added @types/unist to package.json dependencies #4

wants to merge 3 commits into from

Conversation

b-zurg
Copy link

@b-zurg b-zurg commented Dec 31, 2019

This is a very minor change and adds the types provided by the @types/unist type declarations as a dependency for the basic unist types. I made this change because the current library was causing issues with tsc doing a lib type check and finding that the import in "unist-util-filter/types/index.d.ts" of Node
i.e.

import {node} from 'unist'

was breaking.

Specifically this is the error I'm resolving:


node_modules/unist-util-filter/types/index.d.ts:3:20 - error TS2307: Cannot find module 'unist'.

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

node_modules/unist-util-is/index.d.ts:3:28 - error TS2307: Cannot find module 'unist'.

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


Found 2 errors.

The only way to fix this was by adding in my project's tsconfig the setting "skipLibCheck": true which is not really an acceptable solution.

@wooorm
Copy link
Member

wooorm commented Dec 31, 2019

You can also install @types/unist yourself as a fix if you are using types, right? That’s what we suggest for https://github.com/unifiedjs/unified

@ChristianMurphy
Copy link
Member

We've avoided adding direct dependencies on @types/ packages due to the issues outlined in unifiedjs/unified#45 .
When using Typescript add the unist typings using npm install @types/unist.

@ChristianMurphy ChristianMurphy added ☂️ area/types This affects typings 🌊 blocked/upstream This cannot progress before something external happens first 📦 area/deps This affects dependencies labels Jan 1, 2020
@wooorm wooorm added 🙅 no/wontfix This is not (enough of) an issue for this project 🌊 blocked/upstream This cannot progress before something external happens first and removed 🌊 blocked/upstream This cannot progress before something external happens first labels Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 area/deps This affects dependencies ☂️ area/types This affects typings 🌊 blocked/upstream This cannot progress before something external happens first 🙅 no/wontfix This is not (enough of) an issue for this project
Development

Successfully merging this pull request may close these issues.

3 participants