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
Not exactly a specific rule, but I have been motivated by vue/no-v-text-v-html-on-component being falsely triggered on MathML tags. isCustomComponent() is being called from 17 rules. The problem lies with the fact that every composition component starts with a top-level namespace of HTML, which makes it impossible to create partial, especially recursive components within another namespace without confusing the linter.
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.)?
There are multiple options:
Stop examining namespaces when determining whether something is an element or a component.
Treat the HTML namespace as valid namespace for SVG and MathML tags.
Looks for xmlns on the top-level <template/> and adjust namespace accordingly.
Implement (1) or (2), but gate it behind a configuration option.
Please provide some example code that this change will affect:
Triggers vue/no-v-text-v-html-on-component because it does not see <mfrac/> as being inside MathML namespace. Which is impossible to realize, because <math/> cannot be nested and is only specified at the top level. This component recurses into the data, rendering the full MathML structure.
What will the rule do after it's changed?
In case of (1), (2), (4) it won't consider using <mfrac/> in this context as an error.
In case of (3):
It will accept this otherwise invalid, but (probably) harmless syntax to indicate that we are inside MathML namespace and proceed from there on, possibly marking HTML and SVG elements as out of place.
Additional context
This obviously applies to SVG as well, although there is not that high probability somebody will be doing anything recursive in there. Math is a different story, though.
The text was updated successfully, but these errors were encountered:
What rule do you want to change?
Not exactly a specific rule, but I have been motivated by
vue/no-v-text-v-html-on-component
being falsely triggered on MathML tags.isCustomComponent()
is being called from 17 rules. The problem lies with the fact that every composition component starts with a top-level namespace of HTML, which makes it impossible to create partial, especially recursive components within another namespace without confusing the linter.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.)?
There are multiple options:
xmlns
on the top-level<template/>
and adjust namespace accordingly.Please provide some example code that this change will affect:
What does the rule currently do for this code?
Triggers
vue/no-v-text-v-html-on-component
because it does not see<mfrac/>
as being inside MathML namespace. Which is impossible to realize, because<math/>
cannot be nested and is only specified at the top level. This component recurses into the data, rendering the full MathML structure.What will the rule do after it's changed?
In case of (1), (2), (4) it won't consider using
<mfrac/>
in this context as an error.In case of (3):
It will accept this otherwise invalid, but (probably) harmless syntax to indicate that we are inside MathML namespace and proceed from there on, possibly marking HTML and SVG elements as out of place.
Additional context
This obviously applies to SVG as well, although there is not that high probability somebody will be doing anything recursive in there. Math is a different story, though.
The text was updated successfully, but these errors were encountered: