-
-
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
no-restricted-paths
no longer supports regular expressions
#2123
Comments
eslint rules should never support regexes; that's the primary source of CVEs (ReDOS, mostly). https://www.npmjs.com/package/contains-path doesn't mention anything about asterisks being supported, but it's certainly possible they were unintentionally supported, or undocumented, and #2090 removed it. I'd be happy to review a PR that restored/added the ability for globs (not regexes) to go in |
Hey @ljharb I'd be happy to help there! That would greatly simplify an eslint config we have at our company. I've never contributed here. Is this section up to date? If so, I'll implement such a glob feature in the next weeks or so |
As far as i know it is. A PR would be great, thanks. |
This would be a nice feature to have back again. |
@alexmi256 regex support will not be returning; and should never have been permitted in the first place. However, globs will be supported once a PR comes in, and that will allow |
On version 2.22.1 I was able to use regular expressions in the paths for a zone, but this no longer works in 2.23.4:
I suspect it's because of #2090, where the
contains-paths
dependency was replaced by a custom function.The way I set up this zone might not really be the intended use case of this rule, but it might break more valid configurations too. Is this something that could be brought back?
Edit: Regex in the
except
field actually was not supported before, but that would be a nice addition too!The text was updated successfully, but these errors were encountered: