Closed pbrzosko closed 1 week ago
eslint-plugin-vue doesn't have access to other components' files, so this kind of check is impossible. Also note that property-that-doesnt-exist
will actually render as an HTML attribute.
So, should it be vue-tsc that could handle that?
vue-tsc will also not report this as an error because – as I said – that property-that-doesnt-exist
is not invalid and will actually render as an HTML attribute.
But I guess there is a finite set of HTML attributes plus the ones starting with data- and aria-. So in theory you could validate whether provided attribute is a component property or a valid HTML attribute and then have a fail if not?
But I guess there is a finite set of HTML attributes plus the ones starting with data- and aria-.
The aria-*
are also explicitly defined, so e.g. aria-foo
should then also be reported.
So in theory you could validate whether provided attribute is a component property or a valid HTML attribute and then have a fail if not?
In vue-tsc, this would potentially be possible. In eslint-plugin-vue, this is infeasible, because we can't distinguish "invalid" HTML properties from valid component props.
Ok, please close this one then. I will post one for vue-tsc team.
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
What did you expect to happen? I would expect that eslint will mark "property-that-doesnt-exist" and "other-property" as invalid, as they are neither HTML attributes nor properties defined on the component.
What actually happened? No error message.
Repository to reproduce this issue Code is provided in the issue description.