-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
[Update] Make vue/prop-name-casing
fixable
#402
[Update] Make vue/prop-name-casing
fixable
#402
Conversation
* [Update] Make `vue/max-attributes-per-line` fixable * [fix] bug and style * [fix] Switch indent calculation method with node and attribute * [fix] don't handle indentation * [add] autofix test max-attributes-per-line.js
* [Update] Make `vue/order-in-components` fixable This Commit makes `vue/order-in-components` fixable. In case of `The "A" property should be above the "B" property` error, autofix will move A before B * [fix] fail test at [email protected] * [fix] If there is a possibility of a side effect, don't autofix * [fix] failed test at node v4 * [update] use Traverser * [fix] failed test [email protected] * [fix] I used `output: null` to specify "not fix"
lib/rules/prop-name-casing.js
Outdated
}, | ||
fix: canFixPropertyName(item) ? fixer => { | ||
return item.key.type === 'Literal' | ||
? fixer.replaceText(item.key, item.key.raw.replace(item.key.value, convertedName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the original name is "🍻"
, what does it happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why!? It became "" !!!
Emoji is difficult...
Thanks for review! |
output: null, | ||
parserOptions, | ||
errors: [{ | ||
// bug ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so, it shouldn't throw error in this case I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we can deal with it in separate task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your view
I wrote an issue #442
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @ota-meshi ✌️
Make prop-name-casing fixable is very dangerous, because the fix code only fix the props name and leave the reference code same. I think the fix should leave to manual, we just show the alert and do nothing else. |
This PR makes
vue/prop-name-casing
fixable.This implements autofix of rules proposed in #252