-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fix custom classnames rule with VueJS objects within list. #359
Conversation
@@ -302,7 +299,7 @@ function parseNodeRecursive(rootNode, childNode, cb, skipConditional = false, is | |||
return; | |||
case 'ObjectExpression': | |||
childNode.properties.forEach((prop) => { | |||
const isUsedByClassNamesPlugin = rootNode.callee && rootNode.callee.name === 'classnames'; | |||
const isUsedByClassNamesPlugin = (rootNode.callee && rootNode.callee.name === 'classnames') || rootNode.type === 'VAttribute'; |
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.
This is the change that make it works. As there is no callee
for this type of rootNode, I directly checked the type here.
I ensured it works with other possible props, dynamics or not.
@francoismassart it would be great if this was merged, especially as it can leads to subtle bugs 🙂 |
Hi @Ericlm, |
Thank you very much ! 🙏😊 |
Publié avec la |
De rien, merci encore pour ce plugin très utile 😀 |
Fix custom classnames rule with VueJS objects within list syntax.
Description
This PR fixes an issue occurring with the
no-custom-classname
rule, where it did not detect custom classes inside object in list patterns:<div :class="[{'custom-not-detected': true}]"/>
.Fixes #319
Type of change
How Has This Been Tested?
New tests have been added. They're all using vue-eslint-parser in a .vue file.
Test Configuration:
Checklist: