Skip to content
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

[import/no-restricted-paths] configuration items target and form should support array format #2142

Closed
benboba opened this issue Jul 2, 2021 · 4 comments · Fixed by #2466
Closed

Comments

@benboba
Copy link

benboba commented Jul 2, 2021

Sometimes I want to set certain paths in batches to prohibit relying on the same path, or a certain path to prohibit relying on multiple paths.

Now I need to set one by one, and hope to support the incoming array for batch setting.

e.g.
'import/no-restricted-paths': [2, { "zones": [ { "target": "modules/a", "from": ["modules/b", "modules/c"], }, { "target": ["modules/b", "modules/c"], "from": "modules/d", } ] }]

@ljharb
Copy link
Member

ljharb commented Jul 2, 2021

Seems reasonable.

@benboba
Copy link
Author

benboba commented Jul 5, 2021

Maybe it can support a RegExp or RegExp string, which can be more flexible.

@ljharb
Copy link
Member

ljharb commented Jul 6, 2021

Definitely not; that’s a floodgate to CVEs.

@AdriAt360
Copy link
Contributor

@ljharb I submitted a PR to address this issue, I'd be happy to have your feedback on this work 🙏🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants