-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
add types
to package.json
#253
Conversation
I'm surprised this is needed, but it seems to be. Types are not being inferred with just the `exports.types` field. This seems to be the case on npmjs.com, in VSCode, and via the typescript compiler.
The current config is correct.
Then you should open an issue in those places. Usually, this issue is caused by incorrect tsconfig (not having |
I'll see if there's an existing issue in typescript. In the meantime, I came across this on |
No, I would argue this is a VSCode/TS issue for when using comment annotations. It should respect that |
You're right. Even so, adding a jsconfig there/changing package.json here are much quicker quality-of-life improvements. They can be done today. |
I'm willing to add a jsconfig to |
Will do. Combing through existing issues first - "exports" and "types" don't narrow down typescript's 5k open issues much! Worth noting, I'm fine to do it but I still think this temporary solution is better than jsconfig.json. It's a one line fix that solves for all js projects that use meow. A jsconfig there is a new file that only solves for one repo. |
Yes, but it's unknown whether that could potentially cause problems with other tools. And if everyone simply works around TS bugs, the TS team have no incentive to fix things. |
I'm surprised this is needed, but it seems to be. Types are not being inferred with just the
exports.types
field. This seems to be the case on npmjs.com, in VSCode, and via the typescript compiler.Adding
types
seems to fix.A few ways to see it's not right at the moment:
Demo in typescript playground (note that if you reach into the package via
import meow from 'meow/build/index.js'
, you do get the correct types 🤷.Are The Types Wrong result
DT
icon on npmjs.com: