add runtime accesibility warnings

This commit is contained in:
Tao Bror Bojlén 2019-07-20 21:08:56 +03:00
parent 7fe85958db
commit 33e0c79611
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
4 changed files with 30 additions and 1 deletions

View file

@ -69,6 +69,7 @@
"@types/styled-components": "4.1.18", "@types/styled-components": "4.1.18",
"husky": "^3.0.0", "husky": "^3.0.0",
"lint-staged": "^9.2.0", "lint-staged": "^9.2.0",
"react-axe": "^3.2.0",
"tslint": "^5.18.0", "tslint": "^5.18.0",
"tslint-config-security": "^1.16.0", "tslint-config-security": "^1.16.0",
"tslint-eslint-rules": "^5.4.0", "tslint-eslint-rules": "^5.4.0",

View file

@ -385,7 +385,11 @@ class SidebarImpl extends React.Component<ISidebarProps, ISidebarState> {
private renderRobotsTxtState = () => { private renderRobotsTxtState = () => {
return ( return (
<NonIdealState <NonIdealState
icon={<span>🤖</span>} icon={
<span role="img" aria-label="robot">
🤖
</span>
}
title="No data" title="No data"
description="This instance was not crawled because its robots.txt did not allow us to." description="This instance was not crawled because its robots.txt did not allow us to."
/> />

View file

@ -29,3 +29,9 @@ ReactDOM.render(
</Provider>, </Provider>,
document.getElementById("root") as HTMLElement document.getElementById("root") as HTMLElement
); );
if (process.env.NODE_ENV !== "production") {
// tslint:disable-next-line:no-var-requires
const axe = require("react-axe");
axe(React, ReactDOM, 5000);
}

View file

@ -2093,6 +2093,11 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
axe-core@^3.0.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-3.3.0.tgz#3b32d7e54390d89ff4891b20394d33ad7a192776"
integrity sha512-54XaTd2VB7A6iBnXMUG2LnBOI7aRbnrVxC5Tz+rVUwYl9MX/cIJc/Ll32YUoFIE/e9UKWMZoQenQu9dFrQyZCg==
axobject-query@^2.0.2: axobject-query@^2.0.2:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
@ -8831,6 +8836,14 @@ react-app-polyfill@^1.0.1:
regenerator-runtime "0.13.2" regenerator-runtime "0.13.2"
whatwg-fetch "3.0.0" whatwg-fetch "3.0.0"
react-axe@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-axe/-/react-axe-3.2.0.tgz#d17427e5d54d6c4561e74ad9cf8c1839e411bde3"
integrity sha512-2KlO2wZq58+GSFP4oWA2ZjU1ggbXdDLJc7tMUXUXkE4NVQ3FftdYtb7qNR+x1nTLeuVYiH4nH4hzIz9vQZ/Chw==
dependencies:
axe-core "^3.0.0"
requestidlecallback "^0.3.0"
react-dev-utils@^9.0.1: react-dev-utils@^9.0.1:
version "9.0.1" version "9.0.1"
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.0.1.tgz#5c03d85a0b2537d0c46af7165c24a7dfb274bef2" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.0.1.tgz#5c03d85a0b2537d0c46af7165c24a7dfb274bef2"
@ -9306,6 +9319,11 @@ request@^2.87.0, request@^2.88.0:
tunnel-agent "^0.6.0" tunnel-agent "^0.6.0"
uuid "^3.3.2" uuid "^3.3.2"
requestidlecallback@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/requestidlecallback/-/requestidlecallback-0.3.0.tgz#6fb74e0733f90df3faa4838f9f6a2a5f9b742ac5"
integrity sha1-b7dOBzP5DfP6pIOPn2oqX5t0KsU=
require-directory@^2.1.1: require-directory@^2.1.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"