-
-
Notifications
You must be signed in to change notification settings - Fork 681
vue/no-bare-strings-in-template
allow numbers
#2695
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
Comments
If there was a way to extends the default 'vue/no-bare-strings-in-template': [
'error',
{
allowlist: [ ...allowlist, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
attributes: {
'/.+/': [
'title',
'description',
'label',
'help',
'tooltip',
'placeholder',
'errors',
'content',
'confirmButtonLabel',
'cancelButtonLabel',
],
},
directives: ['v-text'],
},
], |
The proposal to allow regexp patterns in the
Hmm, as far as I know, currently there's none. |
I'll close this issue for now, since v10.1.0 supports regexp. |
What rule do you want to change?
vue/no-bare-strings-in-template
Does this change cause the rule to produce more or fewer warnings?
Fewer
How will the change be implemented? (New option, new default behavior, etc.)?
Either add an option to allow numbers:
{ "vue/no-bare-strings-in-template": ["error", { + "allowNumbers": true, "allowlist": [ "(", ")", ",", ".", "&", "+", "-", "=", "*", "/", "#", "%", "!", "?", ":", "[", "]", "{", "}", "<", ">", "\u00b7", "\u2022", "\u2010", "\u2013", "\u2014", "\u2212", "|" ], "attributes": { "/.+/": ["title", "aria-label", "aria-placeholder", "aria-roledescription", "aria-valuetext"], "input": ["placeholder"], "img": ["alt"] }, "directives": ["v-text"] }] }
or add all number to the default allowList:
Please provide some example code that this change will affect:
What does the rule currently do for this code?
What will the rule do after it's changed?
No error, number don't need to be "translated" (unless they are formatted, which is not alwats needed)
Additional context
The text was updated successfully, but these errors were encountered: