LWC template "iterator" directive shows incorrect error if custom name is used

Issue #1938 resolved
Chuck Liddell created an issue

LWC <template> tags can generate lists using either “for:each” or “iterator:<myIteratorName>”.

The example code on this documentation page uses the name “it” for the iterator.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_lists

In IlluminatedCloud, that example works fine.

However, using a custom iterator name results in a couple error messages in the editor (see screenshots).

This isn’t actually an error. There’s no compile error on the Salesforce side, and the component successfully loops when run in the browser.

I’m not losing any sleep over this one.

Comments (3)

  1. Scott Wells repo owner

    Yeah, I've known about this one for a while...IC2 knows about iterator:it but not any custom iterator names, and of course not only does that stifle the best practice of descriptive naming, but it kills nested iteration. I'll take a look and see if I can make IC2 properly grok these custom names.

  2. Log in to comment