Use eslint-config-react-app

This commit is contained in:
Michael Jackson
2019-10-20 21:55:56 -07:00
parent 6f880c6ea7
commit fe833797e8
7 changed files with 574 additions and 386 deletions

View File

@ -1,17 +1,5 @@
{
"env": {
"browser": true
},
"plugins": ["react", "react-hooks"],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {
"version": "16"
}
}
}

View File

@ -15,7 +15,7 @@ function getBasename(path) {
function ImageViewer({ path, uri }) {
return (
<div css={{ padding: 20, textAlign: 'center' }}>
<img title={getBasename(path)} src={uri} />
<img alt={getBasename(path)} src={uri} />
</div>
);
}

View File

@ -67,6 +67,7 @@ function AboutLogo({ children }) {
}
function AboutLogoImage(props) {
/* eslint-disable-next-line jsx-a11y/alt-text */
return <img {...props} css={{ maxWidth: '90%' }} />;
}
@ -442,7 +443,11 @@ export default function App() {
>
<AboutLogo>
<a title="Cloudflare" href="https://www.cloudflare.com">
<AboutLogoImage src={CloudflareLogo} height="100" />
<AboutLogoImage
alt="Cloudflare"
src={CloudflareLogo}
height="100"
/>
</a>
</AboutLogo>
</div>
@ -473,7 +478,7 @@ export default function App() {
>
<AboutLogo>
<a title="Angular" href="https://angular.io">
<AboutLogoImage src={AngularLogo} width="200" />
<AboutLogoImage alt="Angular" src={AngularLogo} width="200" />
</a>
</AboutLogo>
</div>