You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you expect to happen?
As rule vue/v-on-event-hyphenation set to autofix, I expect @update:modelValue to be fixed to @update:model-value
What actually happened?
Eslint shows that it can autofix that issue, but does not fix it.
That happens, because source code of this rule has this check before autofix:
// eslint-plugin-vue/utils/casingfunctionisKebabCase(str){if(hasUpper(str)||hasSymbols(str)||/^-/u.exec(str)||// starts with hyphen is not kebab-case/_|--|\s/u.exec(str)){returnfalse}returntrue}functionhasSymbols(str){return/[!"#%&'()*+,./:;<=>?@[\\\]^`{|}]/u.exec(str)// without " ", "$", "-" and "_"}
Source code of hasSymbols function
So, we see, that inside hasSymbols regex includes symbol "@", and because of that check doesn't pass and autofix does not work.
If you willing, I can open PR with fix of this rule
The text was updated successfully, but these errors were encountered:
maxsimych
changed the title
vue/v-on-event-hyphenation does not fix events that starts with @ (@update:modelValue, etc)
vue/v-on-event-hyphenation does not fix events that start with @ (@update:modelValue, etc)
Sep 24, 2021
Uh oh!
There was an error while loading. Please reload this page.
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen?
As rule vue/v-on-event-hyphenation set to autofix, I expect
@update:modelValue
to be fixed to@update:model-value
What actually happened?
Eslint shows that it can autofix that issue, but does not fix it.
That happens, because source code of this rule has this check before autofix:
Source code of hasSymbols function
So, we see, that inside hasSymbols regex includes symbol "@", and because of that check doesn't pass and autofix does not work.
If you willing, I can open PR with fix of this rule
The text was updated successfully, but these errors were encountered: