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
Rule proposal: vue/v-text-no-child-content #1701
Comments
Thank you for the rule proposal. That rule is sounds good to me. |
The same is true for |
You're right 👍. |
Hm, come to think of it, can we generalize it and make the directives configurable? vue-i18n for example has a // .eslintrc.js
module.exports = {
rules: {
// default: ["error", "always", { directives: ["text", "html"] }]
"vue/no-child-content", ["error", "always", { directives: ["text", "html", "t"] }],
},
} |
That's a good idea! |
We probably don't need the second option ( |
hello, how can I disable this rule ? |
Same as any other eslint rule: Add See the documentation for further details. |
hello, actually my problem is related to the i am having a problem on my application due the need of using childs tags inside a tag with i NEED that this tag accepts childs so i can add tags inside this father-tag on futher occasions (and together with the v-html elements when I open the page too!) i am desactivating it as the documentation explains but for some reason the rule is still on operation in my application.. here is my
|
The rule is called If you have more problems with that rule, please check the documentation and open a new issue instead of commenting on old issues (otherwise it's more likely to go off-topic, be overlooked, or cause noise for unrelated people). |
(Sorry, my bad :)) |
Please describe what the rule should do:
When using the
v-text
directive, the element's inner content gets overwritten by the result of thev-text
expression.What category should the rule belong to?
[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
This might just belong to the layout category, not sure.
Provide 2-3 code examples that this rule should warn about:
Additional context
I'm in the process of localizing an app, and stumbled upon a few elements which already used
v-text
, but also had child content:This isn't really a problem, just unnecessary and confusing.
The text was updated successfully, but these errors were encountered: