Rule conflict between `no-invalid-aria-attributes` and `no-unnecessary-concat`
See original GitHub issueno-invalid-aria-attributes
was recently patched to allow for handlebars as acceptable for aria attributes, #2389 e.g.:
<div aria-label="{{@name}}"></div>
However no-unnecessary-concat
prefers <div aria-label={{@name}}></div>
but no-invalid-aria-attributes
marks this as invalid without the quotes. Both however correctly evaluate to a string.
It seems like no-invalid-aria-attributes
should be aware of no-unnecessary-concat
requirements – opening this issue per https://github.com/ember-template-lint/ember-template-lint/pull/2389#issuecomment-1053609716
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
No results found
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
In my effort to distill this down into a base case I think I over generalized the issue. Each incorrectly flagged instance contains a conditional – which I believe should not be flagged by the linter, correct?.
E.g.
aria-label={{if @label @label @placeholder}}
aria-label={{unless @label @label @placeholder}}
Switching to:
aria-label="{{if @label @label @placeholder}}"
aria-label="{{unless @label @label @placeholder}}"
“Fixes” theno-invalid-aria-attributes
error but then throwsI’m also noticing a similar issue with conditionals and
aria-describedby
when conditional without quotes is used. e.g.Sorry for the misdirection, let me know if I can help clarify further.
@judithhinlung As discussed earlier, I think we need to make the rule more permissive in how it handles mustache statements. They may evaluate into any number of values or types at runtime, so I don’t think we have an accurate means of making that assessment just from the template alone.