I have a need for a rule I might call something like no-root-folder-ancestor (see context below), that I sense is possible with the forbidden.from/to apis, but my weakness with regex is preventing me from achieving it. I've created a repo below with a minimal reproduction case - would really appreciate any thoughts or suggestions that might get at what I'm after. Thank you, this project is really cool!
Context
I'd like this rule to help me with a project involving migrating files from a large frontend repository with a monolith architecture (everything in one src folder) to a monorepo style (many individual packages). In order to move a chunk of code and the tree of files underneath it from the src folder into a package, I need to understand/mitigate any imports that are reaching out beyond the boundaries of that chunk of code , because packages should be self contained / cannot import things from the old monolith (only other packages).
Summary
I have a need for a rule I might call something like
no-root-folder-ancestor
(see context below), that I sense is possible with theforbidden.from/to
apis, but my weakness with regex is preventing me from achieving it. I've created a repo below with a minimal reproduction case - would really appreciate any thoughts or suggestions that might get at what I'm after. Thank you, this project is really cool!Context
I'd like this rule to help me with a project involving migrating files from a large frontend repository with a monolith architecture (everything in one
src
folder) to a monorepo style (many individualpackages
). In order to move a chunk of code and the tree of files underneath it from thesrc
folder into a package, I need to understand/mitigate any imports that are reaching out beyond the boundaries of that chunk of code , because packages should be self contained / cannot import things from the old monolith (only other packages).Environment