ember-cli / ember-cli/eslint-plugin-ember
`no-empty-glimmer-component-classes` reports violation for glimmer component when `this` reference in template
- Dominant language
- JavaScript
- Stars
- 263
- Forks
- 214
- Avg merge
- 30m
- Merged PRs (30d)
- 5
Description
Glimmer component required `js` file when template contains `this` reference usage.
In this case, we need to create a `js` file with `empty-glimmer-component-class` and it is not an error, right?
But we have `eslint` offense:
```
yarn lint:js
yarn run v1.21.1
$ eslint . --cache
/demo-ember-no-empty-glimmer-component-classes-bug-when-this-in-template/app/components/checkbox.js
4:16 error Do not create empty backing classes for Glimmer components ember/no-empty-glimmer-component-classes
✖ 1 problem (1 error, 0 warnings)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
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
```
"ember-source": "~3.24.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-ember": "^10.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
```
Related to:
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-empty-glimmer-component-classes.md
- https://discuss.emberjs.com/t/can-addons-use-template-only-components/17399/6
Repo with bug reproduce:
https://github.com/Mifrill/demo-ember-no-empty-glimmer-component-classes-bug-when-this-in-template
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.