You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ERBLint v0.4.0](https://github.com/Shopify/erb-lint/releases/tag/v0.4.0) introduces support for inline lint rule disables.
4
+
5
+
Since an inline disable feature is now natively available, it is time to move away from the in-house (hacky) counter system we've used internally over the years and in this library. 🎉
6
+
7
+
Our latest `erblint-github` release removes the `-Counter` prefix from all of the lint rules. Please update your `.erb-lint.yml` accordingly.
It should become the following, with `-Counter` removed to make sure the rules run correctly.
23
+
24
+
```yaml
25
+
---
26
+
linters:
27
+
GitHub::Accessibility::AvoidBothDisabledAndAria:
28
+
enabled: true
29
+
GitHub::Accessibility::AvoidGenericLinkText:
30
+
enabled: true
31
+
GitHub::Accessibility::DisabledAttribute:
32
+
enabled: true
33
+
```
34
+
35
+
## Easing migration
36
+
37
+
In order to ease migration for codebases where counter comments are in place (especially large codebases), we will continue to support counters for existing lint rules for a few releases until we deprecate it completely. This should allow you to migrate rules one-by-one, rather than all at once.
38
+
39
+
With this release, the counter system will now be toggled off by default, so please explicitly enable them in your `.erb-lint.yml` config if you would like to enable counters.
40
+
41
+
```yaml
42
+
---
43
+
linters:
44
+
GitHub::Accessibility::AvoidBothDisabledAndAria:
45
+
enabled: true
46
+
counter_enabled: true
47
+
GitHub::Accessibility::AvoidGenericLinkText:
48
+
enabled: true
49
+
counter_enabled: true
50
+
```
51
+
52
+
With this `counter_enabled: true` config, your counter comments like `<%# erblint:counter GitHub::Accessibility::AvoidBothDisabledAndAriaCounter 1` should work as it did before.
53
+
54
+
However, we will drop support for the counter system within the next few releases so please take time to migrate your counter comments to native inline disable comments. Any new rules added to this library will not support the counter system.
55
+
56
+
Once your files do not have any counter comments, remove the `counter_enabled: true` from your configuration to ensure no new ones are added.
57
+
58
+
## Automate migration
59
+
60
+
Adding inline disables for large codebases can be extremely tedious. We recommend using a script to automate this process.
MESSAGE="[aria-disabled] may be used in place of native HTML [disabled] to allow tab-focus on an otherwise ignored element. Setting both attributes is contradictory."
assert_match(/If you must, add <%# erblint:counter GitHub::Accessibility::AvoidBothDisabledAndAriaDisabled 7 %> to bypass this check/,@linter.offenses.last.message)
0 commit comments