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

Extend wildcard functionality #28

Open
oriooctopus opened this issue Jun 2, 2022 · 2 comments
Open

Extend wildcard functionality #28

oriooctopus opened this issue Jun 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@oriooctopus
Copy link

oriooctopus commented Jun 2, 2022

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

@remithomas
Copy link
Owner

Hello @oriooctopus,
this could be a good feature. It should be easy to implement, feel free to push a MR.

Thanks for the idea !!

@remithomas remithomas added the enhancement New feature or request label Jun 25, 2022
@DerZyklop
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants