ember-template-lint
ember-template-lint copied to clipboard
Update `require-valid-alt-text` rule to require same value types
Fixes #1555
@rajasegar apologies for the delay- could you please refresh this branch and review the comments on the PR? Thank you!
@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 -- 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 ?