Skip to content

Commit

Permalink
Configure eslint using a11y recommendations (#41274)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorsector authored Aug 23, 2023
1 parent 664aa75 commit 4f7c77a
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 88 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ module.exports = {
},
{
files: ["**/*.tsx", "**/*.ts"],
plugins: ["@typescript-eslint", "jsx-a11y"],
extends: ["plugin:jsx-a11y/recommended"],
plugins: ["@typescript-eslint", "primer-react", "jsx-a11y"],
extends: [
"plugin:primer-react/recommended",
"plugin:jsx-a11y/recommended",
],
parser: "@typescript-eslint/parser",
rules: {
camelcase: "off",
Expand Down
5 changes: 4 additions & 1 deletion components/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export const DefaultLayout = (props: Props) => {
</>
)}
</Head>
<a href="#main-content" className="sr-only color-bg-accent-emphasis color-fg-on-emphasis">
<a
href="#main-content"
className="visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis"
>
Skip to main content
</a>
<Header />
Expand Down
2 changes: 1 addition & 1 deletion components/page-header/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Breadcrumbs = ({ inHeader }: Props) => {
const title = `${breadcrumb.title}`
return [
!breadcrumb.href ? (
<span data-testid="breadcrumb-title" key={title} title={title} className="px-2">
<span data-testid="breadcrumb-title" key={title} className="px-2">
{breadcrumb.title}
</span>
) : (
Expand Down
6 changes: 1 addition & 5 deletions components/page-header/DeprecationBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ export const DeprecationBanner = () => {
<p>
<b className="text-bold">
<span dangerouslySetInnerHTML={{ __html: message }} />{' '}
<span
data-date={enterpriseServerReleases.nextDeprecationDate}
data-format="%B %d, %Y"
title={enterpriseServerReleases.nextDeprecationDate}
>
<span data-date={enterpriseServerReleases.nextDeprecationDate} data-format="%B %d, %Y">
{enterpriseServerReleases.nextDeprecationDate}
</span>
.
Expand Down
Loading

0 comments on commit 4f7c77a

Please sign in to comment.