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

Allow regex in vue/no-restricted-class #1877

Closed
jd-solanki opened this issue May 5, 2022 · 1 comment · Fixed by #2013
Closed

Allow regex in vue/no-restricted-class #1877

jd-solanki opened this issue May 5, 2022 · 1 comment · Fixed by #2013

Comments

@jd-solanki
Copy link

What rule do you want to change?
vue/no-restricted-class

Does this change cause the rule to produce more or fewer warnings?
No

How will the change be implemented? (New option, new default behavior, etc.)?
Allow a regex pattern just like we did here

Please provide some example code that this change will affect:

<div class="ml-2" />

What does the rule currently do for this code?
Right now to restrict the classes which are not RTL friendly I have to write long list of them:

'vue/no-restricted-class': ['error', 'ml-1', 'ml-2', /* And more... */],

What will the rule do after it's changed?
Once this rule accept regex pattern we don't have to write long list, just below is enough:

'vue/no-restricted-class': ['error', '/^(m|p)(l|r)-/'],

Additional context
None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants