Port over counter implementation and introduce linter against title attribute #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/github/accessibility/issues/646, #18
Context
titleattribute is frequently used though it is inaccessible to many groups of users and hardly useful. This PR introduces a linter rule against it. This rule is implemented as a counter unlike the other rules, though we may consider converting other rules to counters too. This means that if a user wants to disable this rule on a file, they need to disable it with the exact offense count like:instead of
The counter implementation is a workaround ported over from dotcom.
erb-lintdoes not natively support granular rule disables so in dotcom we've resorted to a file-level offense implementation and a counter implementation (both of which this library uses too). Having this workaround isn't great.I've opened a proposal PR to shopify/erb-lint (Shopify/erb_lint#249) with the hopes that we can move away from these workarounds and have disable rule at offense-level like rubocop and eslint allows. Until we have that support, we'll need to work with our workarounds with file-level disable and counters