question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] `no-curly-component-invocation` rule throwing unexpectedly

See original GitHub issue

After 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:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rwjbluecommented, Oct 15, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found