import-js / import-js/eslint-plugin-import
Option to preserve symlinks in `no-unresolved` for monorepos
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the no-unresolved rule and the resolver-webpack and import/preserve-symlinks behavior described in the issue. Reproduce the monorepo case with a symlinked sibling package and compare the proposed rule-level and global options. Done means symlink preservation works without losing absolute-import detection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100