ember-cli-app-version icon indicating copy to clipboard operation
ember-cli-app-version copied to clipboard

app-version doesn't support AngleBracket notation

Open BryanCrotaz opened this issue 5 years ago • 6 comments

BryanCrotaz avatar Apr 15 '20 23:04 BryanCrotaz

Can you provide more information? I can't tell from your title what you are referring to. Some info that would be helpful:

  • what are you trying to do?
  • what doesn't work?
  • what versions of ember-cli-app-version / ember-source / ember-cli are you using?

rwjblue avatar Apr 16 '20 13:04 rwjblue

If you are referring to {{app-version}}, then I think there must be a misunderstanding. That is not a component invocation (it is a helper) and therefore cannot be invoked as <AppVersion />. This isn't a bug, it is a design decision. 😸

I'll leave open to confirm that is what you meant though...

rwjblue avatar Apr 16 '20 13:04 rwjblue

Aha. It ended up throwing a template-lint warning - is there any way to hint to template-lint that this is a helper and so shouldn't be warned? (other than putting every helper into every application's template-lint rules)

BryanCrotaz avatar Apr 16 '20 13:04 BryanCrotaz

The documentation for the no-implicit-this and no-curly-component-invocation rules show how to do this (via the allow config option):

  • https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-implicit-this.md#configuration
  • https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-curly-component-invocation.md#configuration

But as for automatically wiring it up, I think the best we could do is hard code this particular helper (since it is shipped in the default ember new stack). I don't really like doing that, but overtime I think this will resolve itself so it may be a fine stop gap for now.

rwjblue avatar Apr 16 '20 14:04 rwjblue

I found the warning confusing because it didn't say where to put the rule - I spent ages fiddling with .eslintrc

BryanCrotaz avatar Apr 16 '20 14:04 BryanCrotaz

can this addon modify .template-lintrc.js during installation?

BryanCrotaz avatar Apr 16 '20 14:04 BryanCrotaz