ember-template-lint icon indicating copy to clipboard operation
ember-template-lint copied to clipboard

Update `require-valid-alt-text` rule to require same value types

Open rajasegar opened this issue 5 years ago • 3 comments
trafficstars

Fixes #1555

rajasegar avatar Oct 02 '20 11:10 rajasegar

@rajasegar apologies for the delay- could you please refresh this branch and review the comments on the PR? Thank you!

MelSumner avatar Apr 13 '21 17:04 MelSumner

@MelSumner Are we clear on how we going to proceed for the case mentioned above by @lifeart

{{#each this.levels as |level index|}}
  <img src={{level.src}} alt="{{concat "Photo of car with index" index}}" />
{{/each}

because the value types are different here: MustacheStatement and ConcatStatement Also we have clashes with existing tests here https://github.com/ember-template-lint/ember-template-lint/blob/1722f4f5734ec66db2119cd6285408bfa176eef8/test/unit/recommended-config-test.js#L50

rajasegar avatar Apr 19 '21 09:04 rajasegar

@rajasegar -- Didn't realized that this issue was being worked on. Feel free to checkout https://github.com/ember-template-lint/ember-template-lint/pull/1973.

I think for https://github.com/ember-template-lint/ember-template-lint/blob/1722f4f5734ec66db2119cd6285408bfa176eef8/test/unit/recommended-config-test.js#L50

We can update it to:

ensureValid('<img alt={{this.alt}} src={{some-dir/some-thing this.x}}>');

What do you think @MelSumner ?

faith-or avatar May 30 '21 08:05 faith-or