Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure how to handle/fix "no-this-in-template-only-components" #41

Open
boris-petrov opened this issue Jan 22, 2021 · 2 comments · May be fixed by ember-template-lint/ember-template-lint#1707

Comments

@boris-petrov
Copy link

test('it renders', async function (assert) {
  this.set('foo', 420);
  await render(hbs`{{some-component foo=this.foo}}`);
});

This leads to:

Usage of 'this' in path 'this.foo' is not allowed in a template-only component. Use '@foo' if it is a named argument or create a component.js for this component. (fixable)ember-template-lint(no-this-in-template-only-components)

This doesn't make sense in this case.

cc @rwjblue @dwickern

@dwickern
Copy link

I wonder why I get different results. When I test using ember-bootstrap, the rule fails on this line since there is no file path:

/Users/dwickern/code/ember-bootstrap/tests/integration/components/bs-tab/pane-test.js
  13:18  error  1 error(s): The "path" argument must be of type string. Received undefined  hbs/check-hbs-template-literals
  27:18  error  1 error(s): The "path" argument must be of type string. Received undefined  hbs/check-hbs-template-literals
  49:18  error  1 error(s): The "path" argument must be of type string. Received undefined  hbs/check-hbs-template-literals

What hbs file path is being passed for you?

@boris-petrov
Copy link
Author

boris-petrov commented Jan 24, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants