Skip to content

Commit

Permalink
docs: fix accessibility lint rules (angular#32661)
Browse files Browse the repository at this point in the history
Add and fix accessibility rules, bump codelyzer to support pseudo events
for template-click-events-have-key-events rule.

PR Close angular#32661
  • Loading branch information
edbzn authored and alxhub committed Oct 7, 2019
1 parent 0ce8621 commit 40d87dd
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion aio/package.json
Expand Up @@ -116,7 +116,7 @@
"chalk": "^2.1.0",
"chrome-launcher": "^0.10.7",
"cjson": "^0.5.0",
"codelyzer": "^5.0.0",
"codelyzer": "^5.1.1",
"cross-spawn": "^5.1.0",
"css-selector-parser": "^1.3.0",
"dgeni": "^0.4.11",
Expand Down
Expand Up @@ -7,10 +7,11 @@ import { LocationService } from 'app/shared/location.service';
selector: `aio-contributor-list`,
template: `
<div class="flex-center group-buttons">
<a *ngFor="let name of groupNames"
[class.selected]="name == selectedGroup.name"
class="button mat-button filter-button"
(click)="selectGroup(name)">{{name}}</a>
<a *ngFor="let name of groupNames"
[class.selected]="name == selectedGroup.name"
class="button mat-button filter-button"
(click)="selectGroup(name)"
(keyup.enter)="selectGroup(name)">{{name}}</a>
</div>
<section *ngIf="selectedGroup" class="grid-fluid">
<div class="contributor-group">
Expand Down
Expand Up @@ -8,7 +8,7 @@ import { CONTENT_URL_PREFIX } from 'app/documents/document.service';
template: `
<div [ngClass]="{ 'flipped': person.isFlipped }" class="contributor-card">
<div class="card-front" (click)="flipCard(person)">
<div class="card-front" (click)="flipCard(person)" (keyup.enter)="flipCard(person)">
<h3>{{person.name}}</h3>
<div class="contributor-image" [style.background-image]="'url('+pictureBase+(person.picture || noPicture)+')'">
Expand All @@ -28,7 +28,7 @@ import { CONTENT_URL_PREFIX } from 'app/documents/document.service';
</div>
</div>
<div class="card-back" *ngIf="person.isFlipped" (click)="flipCard(person)">
<div class="card-back" *ngIf="person.isFlipped" (click)="flipCard(person)" (keyup.enter)="flipCard(person)">
<h3>{{person.name}}</h3>
<p class="contributor-bio">{{person.bio}}</p>
</div>
Expand Down
Expand Up @@ -4,6 +4,7 @@ import { PlatformLocation } from '@angular/common';
import { Category } from './resource.model';
import { ResourceService } from './resource.service';

/* tslint:disable:template-accessibility-elements-content */
@Component({
selector: 'aio-resource-list',
templateUrl: 'resource-list.component.html'
Expand Down
@@ -1,4 +1,4 @@
<span class="content" (click)="contentClick()">
<span class="content" (click)="contentClick()" (keyup.enter)="contentClick()">
<ng-content></ng-content>
</span>

Expand Down
12 changes: 11 additions & 1 deletion aio/tslint.json
Expand Up @@ -96,6 +96,16 @@
"ban-keywords",
"check-format",
"require-const-for-all-caps"
]
],
"template-accessibility-alt-text": true,
"template-accessibility-elements-content": true,
"template-accessibility-label-for": true,
"template-accessibility-tabindex-no-positive": true,
"template-accessibility-table-scope": true,
"template-accessibility-valid-aria": true,
"template-click-events-have-key-events": true,
"template-mouse-events-have-key-events": true,
"template-no-autofocus": true,
"template-no-distracting-elements": true
}
}
18 changes: 9 additions & 9 deletions aio/yarn.lock
Expand Up @@ -1594,10 +1594,10 @@ anymatch@^3.0.1:
normalize-path "^3.0.0"
picomatch "^2.0.4"

app-root-path@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.1.0.tgz#98bf6599327ecea199309866e8140368fd2e646a"
integrity sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=
app-root-path@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.2.1.tgz#d0df4a682ee408273583d43f6f79e9892624bc9a"
integrity sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA==

append-transform@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -2850,12 +2850,12 @@ code-point-at@^1.0.0:
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=

codelyzer@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-5.0.0.tgz#e4032efb23a7c5d4bcfe7321fc1789490c679837"
integrity sha512-Bif70XYt8NFf/Q9GPTxmC86OsBRfQZq1dBjdruJ5kZhJ8/jKhJL6MvCLKnYtSOG6Rhiv/44DU0cHk6GYthjy8Q==
codelyzer@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-5.1.1.tgz#a599fa8c2a5847f553a792b934e493d1506a4a62"
integrity sha512-t8ZLSZBUjVFOJVk4jASLgmTdKWK/0ZsQCnPXy6PXw1LWOOormQOVnyy4OYoiZ6rAWTrz60Obx+zA2t8xY53QzQ==
dependencies:
app-root-path "^2.1.0"
app-root-path "^2.2.1"
aria-query "^3.0.0"
axobject-query "^2.0.2"
css-selector-tokenizer "^0.7.1"
Expand Down

0 comments on commit 40d87dd

Please sign in to comment.