Skip to content

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

Closed
@jd-solanki

Description

@jd-solanki

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions