Replies: 1 comment 1 reply
-
interesting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's possible to use triple slash directives for intellisense support on auto-import code
For example:
The node and ws references are because those don't seem to get recognized by default — here's a screenshot of
[email protected]@@@1/index.d.ts
:You can also move the triple-slash directives to a shared type declarations file, eg putting this in
~/bun-global-types/index.d.ts
And then reference that in your code instead:
/// <reference types="/Users/myuser/bun-global-types/index.d.ts" />
You can also omit the
index.d.ts
:/// <reference types="/Users/myuser/bun-global-types" />
The main issue I have with this approach is that it's a bit annoying finding/updating the paths for the type declarations. I wonder if it would be possible for bun to support a version of this that allows intellisense support without requiring me to look up the specific "packagename+version" paths, eg if I could just write:
/// <reference types="/Users/myuser/.bun/cache/bun" />
Or some variant of the above, some other possible examples:
An IDE extension that adds support for auto-install types, fetching them from the bun global cache, could also be a nice solution.
Beta Was this translation helpful? Give feedback.
All reactions