I don’t think any of the options in the documentation can help me.
My problem is very specific to enonic-types, and being able to add types to the different library packages (like /lib/xp/content
). Unfortunately my problems are passed on to anyone using enonic-types.
I think the only way to get the IDEs working correctly with library imports, is chainging the import path to have the same “shape” as node imports.
That doesn’t mean moving everything to npm, maybe some aliasing when resolving paths would do the trick.
But the shape of the path should be something like one of these:
import { query } from "lib/xp/content"; // unlikely to work from anywhere?
// or
import { query } from "lib-xp-content"; // like a package in npm
// or
import { query } from "@enonic/lib-content"; // like a namespaced package
I have found another issue regearding this.
And that is if I copy code from one file to another, the import
of functions will be copied too, but it will be changed to be */lib/xp/content
, and then the developer will need to remember to manually change it, or it will fail at runtime.
Parting thoughts:
Creating TypeScript-types for paths that start with a "/
" has been challenging. It took me over a year to hack it.
So since XP8 is in the planning, I was hoping you would consider changing the way we reference libraries so that developers can get better IDE support.
Thanks 
– Tom