Option to preserve symlinks in `no-unresolved` for monorepos
#1 706 ouverte le 29 mars 2020
Métriques du dépôt
- Stars
- (4 946 stars)
- Métriques de merge PR
- (Merge moyen 138j 22h) (3 PRs mergées en 30 j)
Description
I'm currently converting my codebase to a monorepo, and I've stumbled across an issue with no-unresolved. Even though the sibling package I reference is symlinked into node_modules, it doesn't actually see it.
To skirt this, I've tried:
- The
no-unresolvedignoreoption, but this doesn't actually ensure the sibling is required and symlinked in place. - The
resolver-node, but like above, this doesn't actually ensure the package is actually symlinked innode_modules. - The
resolver-webpack, but even though I specifically preserve symlinks in my config, you override it. Also, using this resolver only helps subprojects using webpack. - The third-party
resolver-lerna, but doing so requires I sacrifice detection of absolute imports (which I currently useresolver-nodefor, but which I could useresolver-webpackfor... in subprojects that use webpack).
As you can see, all of these potential solutions are just patches. If there's something I missed, please point the way. But given the prevalence of monorepo solutions—all of which rely on symlinks—I think it's safe to say the best option is to solve for the symlink problem itself. There's been quite a few issues raised on this topic.
Solutions I see:
- A
no-unresolvedoption that preserves symlinks. - A global option for
import/preserve-symlinksthat preserves symlinks.
Anyway, thanks for your time!