Skip to content

Commit 4f7c77a

Browse files
authored
Configure eslint using a11y recommendations (#41274)
1 parent 664aa75 commit 4f7c77a

File tree

10 files changed

+324
-88
lines changed

10 files changed

+324
-88
lines changed

.eslintrc.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ module.exports = {
3535
},
3636
{
3737
files: ["**/*.tsx", "**/*.ts"],
38-
plugins: ["@typescript-eslint", "jsx-a11y"],
39-
extends: ["plugin:jsx-a11y/recommended"],
38+
plugins: ["@typescript-eslint", "primer-react", "jsx-a11y"],
39+
extends: [
40+
"plugin:primer-react/recommended",
41+
"plugin:jsx-a11y/recommended",
42+
],
4043
parser: "@typescript-eslint/parser",
4144
rules: {
4245
camelcase: "off",

components/DefaultLayout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ export const DefaultLayout = (props: Props) => {
108108
</>
109109
)}
110110
</Head>
111-
<a href="#main-content" className="sr-only color-bg-accent-emphasis color-fg-on-emphasis">
111+
<a
112+
href="#main-content"
113+
className="visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
114+
>
112115
Skip to main content
113116
</a>
114117
<Header />

components/page-header/Breadcrumbs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Breadcrumbs = ({ inHeader }: Props) => {
3636
const title = `${breadcrumb.title}`
3737
return [
3838
!breadcrumb.href ? (
39-
<span data-testid="breadcrumb-title" key={title} title={title} className="px-2">
39+
<span data-testid="breadcrumb-title" key={title} className="px-2">
4040
{breadcrumb.title}
4141
</span>
4242
) : (

components/page-header/DeprecationBanner.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ export const DeprecationBanner = () => {
2626
<p>
2727
<b className="text-bold">
2828
<span dangerouslySetInnerHTML={{ __html: message }} />{' '}
29-
<span
30-
data-date={enterpriseServerReleases.nextDeprecationDate}
31-
data-format="%B %d, %Y"
32-
title={enterpriseServerReleases.nextDeprecationDate}
33-
>
29+
<span data-date={enterpriseServerReleases.nextDeprecationDate} data-format="%B %d, %Y">
3430
{enterpriseServerReleases.nextDeprecationDate}
3531
</span>
3632
.

0 commit comments

Comments
 (0)