Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove validation of mustache statements in no-invalid-aria-attributes rule #2466

Conversation

judithhinlung
Copy link
Collaborator

@judithhinlung judithhinlung commented Apr 13, 2022

This PR fixes #2405 and fixes #2451.

Besides string, number, and boolean literals, mustache statements often also contains helpers, variables, and other nested statements. Since it is not possible to check what a given mustache statement evaluates to at the template level, this PR removes their validation to prevent valid ARIA attribute values in complex statements from failing the rule.

Allowed:

# examples
<div aria-label={{this.foo}} />
<div aria-label={{if @label @label @placeholder}} />
<button aria-label={{if @isNew (t "actions.add") (t "actions.edit")}}></button>

Testing

Test Suites: 135 passed, 135 total
Tests: 5 skipped, 7459 passed, 7464 total
Snapshots: 969 passed, 969 total
Time: 96.051 s
Ran all test suites.
✨ Done in 107.73s.

@judithhinlung judithhinlung marked this pull request as ready for review April 14, 2022 16:07
@bmish bmish added the bug label Apr 14, 2022
@bmish bmish changed the title Removes validation of mustache statements in no-invalid-aria-attributes rule… Remove validation of mustache statements in no-invalid-aria-attributes rule Apr 14, 2022
Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bmish bmish merged commit 714250d into ember-template-lint:master Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants