eslint-plugin-ban
eslint-plugin-ban copied to clipboard
Extend wildcard functionality
Right now we would support the wildcard operator in the following situation:
"rules": {
"ban/ban": [
"error",
{
name: ["api", "*"],
message: "Some message",
},
]
}
The following is another situation which is not supported but I think we should support:
"rules": {
"ban/ban": [
"error",
{
name: ["api", "getAllBy*"],
message: "Some message",
},
]
}
Basically, the first situation shows the wildcard being used to match everything, the second shows it in combination with a precursor. Additionally, something like *text should be supported where the wildcard is first.
I would be happy to put up a diff supporting this if you tell me that you would be okay with it
Hello @oriooctopus, this could be a good feature. It should be easy to implement, feel free to push a MR.
Thanks for the idea !!
Our case is probably related…
We want to ban this
this.routerService.navigate()
as well as
routerService.navigate()
["pRouterService", "navigate"] does not catch this.routerService.navigate()
["*", "pRouterService", "navigate"] does not catch anything
["this.routerService", "navigate"] does not catch anything
["*", "navigate"] is our workaround but would also catch somethingElse.navigate()