[BUG] `no-curly-component-invocation` rule throwing unexpectedly
See original GitHub issueAfter enabling this rule, in my template files I’m seeing yielded arguments all throw the corresponding lint error
Example, from a template only glimmer-component:
{{#each @options as |option|}}
{{option}}
{{/each}}
2:2 error You are using the component {{option}} with curly component syntax. You should use <Option> instead. If it is actually a helper you must manually add it to the 'no-curly-component-invocation' rule configuration, e.g. `'no-curly-component-invocation': { allow: ['option'] }`. no-curly-component-invocation
{{option}}
isn’t a component or helper, it’s simply a POJO or some raw data passed into the component.
Is it really necessary to whitelist all yielded arguments like this?
Versions:
ember-template-lint@^1.1.0:
version "1.5.3"
ember-cli-template-lint@^1.0.0-beta.3:
version "1.0.0-beta.3"
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Ten simple rules for reporting a bug - PLOS
Rule 2: Check whether the bug is already fixed Filing a bug that has already been fixed is a waste of time for...
Read more >SonarCloud: Fixing unexpected unknown at-rule @tailwind - Tim
I'm a big fan of using SonarCloud. Not only does it help to maintain the quality of your projects but the error descriptions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed by https://github.com/ember-template-lint/ember-template-lint/pull/861
This is a tricky one. For a block param, we can’t know for sure if it is a component invocation, some text, or heck even a DOM element. The rule does not make any different assumptions about yielded block params at the moment.
We could tweak things a bit so that the rule does not apply to block params when used without any arguments (e.g.
{{foo}}
vs either{{foo whatever}}
or{{foo some=thing}}
). 🤔@patocallaghan / @GavinJoyce / @Turbo87 / @bmish - What do y’all think?