style: fix eslint issues (#437)

This commit is contained in:
Hugo 2020-01-17 20:40:06 +00:00 committed by Andrew Luca
parent bffba4b313
commit df662048f4
6 changed files with 25 additions and 18 deletions

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState, forwardRef, useRef } from 'react';
import React, { useEffect, useState, useRef } from 'react';
function useInterval(callback, delay) {
const savedCallback = useRef();
@ -44,7 +44,7 @@ function useWickedFavIcon() {
}
export default function FavIcon() {
const { letter, index, canvasRef } = useWickedFavIcon();
const { /* letter, index, */ canvasRef } = useWickedFavIcon();
return (
<div>
<canvas

View file

@ -7,7 +7,7 @@ import * as icons from '../util/icons';
export default function Person({ person, currentTag }) {
const url = new URL(person.url);
const img = `https://images.weserv.nl/?url=https://unavatar.now.sh/${url.host}&w=100&l=9&af&il&n=-1`
const img = `https://images.weserv.nl/?url=https://unavatar.now.sh/${url.host}&w=100&l=9&af&il&n=-1`;
return (
<PersonWrapper>
<PersonInner>
@ -23,11 +23,10 @@ export default function Person({ person, currentTag }) {
rel="noopener noreferrer"
className="displayLink"
href={person.url}
>{`${url.host}${
url.pathname.endsWith('/')
? url.pathname.substr(0, url.pathname.length - 1)
: url.pathname
}`}</a>
>
{url.host}
{url.pathname.replace(/\/$/, '')}
</a>
</header>
<p>{person.description}</p>
<Tags>

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState, useRef } from 'react';
import React from 'react';
import { Link } from 'gatsby';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
@ -34,10 +34,14 @@ function Header({ siteTitle, siteDescription, siteUrl }) {
}
Header.propTypes = {
siteTitle: PropTypes.string,
siteDescription: PropTypes.string,
siteUrl: PropTypes.string,
};
Header.defaultProps = {
siteTitle: ``,
siteTitle: '',
siteDescription: '',
siteUrl: '',
};
export default Header;

View file

@ -1,6 +1,6 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import Img from 'gatsby-image';
/*
* This component is built using `gatsby-image` to automatically serve optimized
@ -24,9 +24,9 @@ const Image = () => {
}
}
}
`)
`);
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />
}
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />;
};
export default Image
export default Image;

View file

@ -44,5 +44,9 @@ const FilterProvider = function({ children }) {
);
};
FilterProvider.propTypes = {
children: React.Children,
};
export default FilterContext;
export { FilterProvider };

View file

@ -21,7 +21,7 @@ export function countries() {
.reduce((acc, country) => {
if (acc[country.name]) {
// exists, update
acc[country.name].count = acc[country.name].count + 1;
acc[country.name].count += acc[country.name].count;
} else {
acc[country.name] = {
...country,