Open Mifrill opened 3 years ago
Looking at your example given, I would question if the backing JavaScript class should be empty. I think it should explicitly declare the isChecked
property, which is used in the template. It should also be decorated with @tracked
. Current code relies on {{toogle}}
helper using Ember.set()
. Otherwise the property wouldn't be tracked.
:thinking: interesting point, my thought was about: declare the tracked
property only if going to use it in js
file itself, because it's working fine in a template without tracked
decorator in js
Glimmer component required
js
file when template containsthis
reference usage. In this case, we need to create ajs
file withempty-glimmer-component-class
and it is not an error, right?But we have
eslint
offense:it force to skip this rule, which looks incorrect:
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
Details: https://github.com/Mifrill/demo-ember-no-empty-glimmer-component-classes-bug-when-this-in-template/blob/main/app/components/checkbox.hbs
https://github.com/Mifrill/demo-ember-no-empty-glimmer-component-classes-bug-when-this-in-template/blob/main/app/components/checkbox.js
Related to:
Repo with bug reproduce: https://github.com/Mifrill/demo-ember-no-empty-glimmer-component-classes-bug-when-this-in-template