-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make no-restricted-paths more generic #834
Comments
I think you could do tbh I think this is probably better as a separate rule, that ensures exactly what you're trying to achieve. It'd be a good rule to enable by default in every dir with a package.json, for example - or better, the rule could have a mode that prevents any relative imports that come from outside a package.json hierarchy? |
Yes you're right I want to allow backtracking inside of it. I agree this could be a separate rule. I'd rather have flexibility over just relying on package.json. For example in case of Create React App the sources are confined to |
Sure, I agree there's a case where you want to define a more restrictive jail than "package.json", and that absolutely should be doable - but I think the default/base case is "jailing to package.json", which limiting to "src" would trump within that directory. |
no-restricted-paths
seems like a great rule.For example, it lets you ensure nothing in
./a
could reach into./b
.My use case is a bit different. I want to ensure that nothing in
./a
could import anything outside of./a
except fornode_modules
. So if I’m in./a
, I want it to be impossible to import../index
,../b
, or../../whatever
. However I want to preserve the ability to import Node modules, like'my-package'
which can technically occur at any level above, and could even symlink to./b
.Does this request make sense? Basically I’m trying to confine the use of relative paths to a specific folder, and disallow any relative imports outside of it.
The text was updated successfully, but these errors were encountered: