PolymerElements / iron-input

An input with data binding
https://webcomponents.org/element/PolymerElements/iron-input
33 stars 45 forks source link

iron-input fails polylint #116

Closed kaspnilsson closed 7 years ago

kaspnilsson commented 7 years ago

Looks like the _inputElement property isn't explicitly declared.

/usr/bin/polylint --root polygerrit-ui/app --input elements/gr-app.html
warn:    bower_components/iron-input/iron-input.html:102:3
    Property _inputElement not found in 'properties' for element 'iron-input'

https://github.com/PolymerElements/iron-input/blob/master/iron-input.html#L116

notwaldorf commented 7 years ago

Not convinced it needs to be declared -- it's an implementation detail and it has a public getter.

@rictic: halp? why is polylint so keen here? Is it coming from the observer?

kaspnilsson commented 7 years ago

@notwaldorf I believe the actual issue is that the public getter references something that is not explicitly defined as a property of the element.

It's definitely just semantics, as the property's value is undefined until init is called either way, but I noticed this issue and figured I'd fix it upstream.

notwaldorf commented 7 years ago

But that should be ok, no? That's the point of a public getter, to get around implementation details. We've been using this sort of pattern a lot, I'm surprised it's coming up now

kaspnilsson commented 7 years ago

It makes sense to me that one would want any property or function of a Polymer element to be explicitly defined.

That being said, I'm definitely no webcomponents expert 😄

notwaldorf commented 7 years ago

Merged a PR that fixed this