![]() But when each package has own version you need to hoist per package, which seems is not possible right now. You don't feel the pain because you don't have custom plugins defined locally, but it's not pretty, you then have to add the plugin at the root, then all the peer dependencies, when having it all hidden in the eslint-config package is much nicer.Įverything works fine when all the packages have the same eslint plugin versions. When runnign pnpm install at teh root level, I get all dependencies added to the root nodemodules but not to the workspace nodemodule. With external plugins, everything works automagically (thanks to the default public hoisting of eslint packages), but for local ones, it's more annoying as I also have to add the import(s) at the PNPM itself is using this nice behavior, putting the eslint plugin dependencies in their eslint config package rather than at the root, and having it work just thanks to the automated public hoisting of those plugins. In my mono repo I have 2 projects/workspaces, each of them with its own package.json. My problem is, as probably with many of you, with locally defined eslint plugins. I was having this issue and created this simple repo to reproduce it I'll update the reproduction in a bit, when I have soem time.īut here's an issue already, that discusses this problem: eslint/eslint#3458 So if you host your own eslint-plugin in the monorepo, it cannot be used, unless it's forcefully hoisted by adding it to the root package.json deps. Plugins only accept package names withou a path prefix and eslint resolves them relative to the CWD IIRC. While you can use require.resolve(someConfigDependency) with extends to force eslint to lookup the right dependency, it's not possible for plugins. What I actually wanted to demonstrate is the resolution of plugins, not configs. The issue is eslint's notorious resolution algorithm. ![]() ![]() "Technically" I'm already doing everything right (in my "real" project). Hoisting is a feature that was added to fix external dependencies that you don't have control over. Sorry, I just noticed, that my demo isn't actually demonstrating the issue I'm having.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |