Open florian-sanders-cc opened 4 months ago
I agree on this!
I had a look at this project https://github.com/43081j/eslint-plugin-wc and I don't see such a rule. I wonder how we will list and maintain all forbidden names.
@hsablonniere when working on eslint upgrade I found this one: https://github.com/43081j/eslint-plugin-lit/blob/master/docs/rules/no-native-attributes.md
It's great so I've included it within our config :wink:
Context
We have faced several cases with prop names that clashed with native properties / attributes.
For instance, exposing a prop
title
on a web component is not a good idea because it will generate a tooltip (nativetitle
behavior).Disabled prop resets the focus when set to true with Chrome (see #1124).
Decision
It only forbids usage of "global" attributes so
disabled
is ok, which is a good thing because we want to use it for form control components.