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
Currently this plugin expects to scan whole HTML pages which it does perfectly.
However, working with a frontend framework like Angular, HTML related to a component are not expected to be complete pages but component templates.
This in conclusion creates situations where some rules are not really applicable at component level since from the view of a component we don't know in which context they are used.
For example, the following component template would report the issues:
Accessibility Linter: All page content should be contained by landmarks
<article><header><h2>My Article</h2></header><divclass="article-body" aria-label="Content">
foo, bar
</div></article>
It makes sense since the linter expects to scan a whole HTML page but not only a fragment.
To apply the specific rule, its necessary, to know the whole DOM / accessibility tree since we just don't know if or in which region the component is used.
The current workaround is to disable a rule globally by using a axe-linter.yml file:
# see: https://plugins.jetbrains.com/plugin/19498-accessibility-linter
# All rules: https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md
rules:
region: false # disables region rule
However, this will globally disable the rule which is possibly not what we want.
Possible solutions
Auto-detect Angular components and filter-out not applicable rules and add a config option for it
Allow to disable rules using a comment (e. g. <!-- axe-linter-disable region -->)
Allow to configure a filter in the axe-linter.yml for specific files
In my opinion option 2. would be the most flexible one and also it's a common solution for other tools such es ESLint, etc.
The text was updated successfully, but these errors were encountered:
Currently this plugin expects to scan whole HTML pages which it does perfectly.
However, working with a frontend framework like Angular, HTML related to a component are not expected to be complete pages but component templates.
This in conclusion creates situations where some rules are not really applicable at component level since from the view of a component we don't know in which context they are used.
For example, the following component template would report the issues:
It makes sense since the linter expects to scan a whole HTML page but not only a fragment.
To apply the specific rule, its necessary, to know the whole DOM / accessibility tree since we just don't know if or in which region the component is used.
The current workaround is to disable a rule globally by using a
axe-linter.yml
file:However, this will globally disable the rule which is possibly not what we want.
Possible solutions
<!-- axe-linter-disable region -->
)axe-linter.yml
for specific filesIn my opinion option 2. would be the most flexible one and also it's a common solution for other tools such es ESLint, etc.
The text was updated successfully, but these errors were encountered: