diff --git a/.eslintrc.json b/.eslintrc.json index af2f23539..d69a847ac 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,8 @@ "jsx-a11y/anchor-is-valid": "off", "import/no-default-export": "off", "react/forbid-dom-props": "warn", - "@typescript-eslint/require-await": "warn" + "@typescript-eslint/require-await": "warn", + "react/react-in-jsx-scope": "off" }, "parserOptions": { "project": "tsconfig.json" diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index 38adfee78..9dec349d6 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -4,7 +4,7 @@ import LinkedinIcon from 'mdi-react/LinkedinIcon' import TwitterIcon from 'mdi-react/TwitterIcon' import YouTubeIcon from 'mdi-react/YoutubeIcon' import Link from 'next/link' -import React from 'react' +import { FunctionComponent } from 'react' import { StyledFooterWrapper, @@ -28,7 +28,7 @@ interface Props { minimal?: boolean } -const Footer: React.FunctionComponent = ({ minimal }) => ( +const Footer: FunctionComponent = ({ minimal }) => ( {!minimal && ( diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 71ca3f308..f815a8a62 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -1,6 +1,6 @@ import HeaderCta from '@components/atoms/HeaderCta' import Row from '@components/atoms/Row' -import React from 'react' +import { FunctionComponent } from 'react' import { StyledHeaderImage, StyledHeaderText } from './HeaderStyles' @@ -14,7 +14,7 @@ interface Props { text?: string } -const Header: React.FunctionComponent = props => ( +const Header: FunctionComponent = props => ( <> {props.showImage && } diff --git a/components/NavBar/index.tsx b/components/NavBar/index.tsx index b3559609c..d29d90714 100644 --- a/components/NavBar/index.tsx +++ b/components/NavBar/index.tsx @@ -2,7 +2,7 @@ import Button from '@components/atoms/Button' import MenuDownIcon from 'mdi-react/MenuDownIcon' import MenuIcon from 'mdi-react/MenuIcon' import MenuUpIcon from 'mdi-react/MenuUpIcon' -import React, { useState } from 'react' +import { FunctionComponent, useState } from 'react' import { StyledNavBarWrapper, @@ -20,7 +20,7 @@ import { StyledNavBarDropDownItem, } from './NavBarStyles' -const NavBar: React.FunctionComponent = () => { +const NavBar: FunctionComponent = () => { const [ expandDropdown, setExpandDropdown ] = useState(false) const [ expandOnMobile, setExpandOnMobile ] = useState(false) diff --git a/components/atoms/AuthorCard/index.tsx b/components/atoms/AuthorCard/index.tsx index 44db8136f..10dbda415 100644 --- a/components/atoms/AuthorCard/index.tsx +++ b/components/atoms/AuthorCard/index.tsx @@ -1,6 +1,6 @@ import Card from '@components/atoms/Card' import ContentCard from '@components/atoms/ContentCard' -import React from 'react' +import { FunctionComponent } from 'react' import { StyledAuthorImage } from './AuthorCardStyles' @@ -12,7 +12,7 @@ interface Props { id: string } -const AuthorCard: React.FunctionComponent = props => ( +const AuthorCard: FunctionComponent = props => ( = props => ( +const AuthorCardList: FunctionComponent = props => ( {props.authors.map(author => ( diff --git a/components/atoms/Button/index.tsx b/components/atoms/Button/index.tsx index 0a09e8995..83159117e 100644 --- a/components/atoms/Button/index.tsx +++ b/components/atoms/Button/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, FunctionComponent } from 'react' +import { ReactNode, FunctionComponent } from 'react' import { StyledButton } from './ButtonStyles' diff --git a/components/atoms/Card/index.tsx b/components/atoms/Card/index.tsx index f47f148f5..983f6454c 100644 --- a/components/atoms/Card/index.tsx +++ b/components/atoms/Card/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, FunctionComponent } from 'react' +import { ReactNode, FunctionComponent } from 'react' import { StyledCard } from './CardStyles' diff --git a/components/atoms/CollectionView/index.tsx b/components/atoms/CollectionView/index.tsx index d75d054e0..a9796d1a9 100644 --- a/components/atoms/CollectionView/index.tsx +++ b/components/atoms/CollectionView/index.tsx @@ -1,7 +1,7 @@ import Card from '@components/atoms/Card' import MarkdownFile from '@interfaces/MarkdownFile' import Link from 'next/link' -import React from 'react' +import { FunctionComponent } from 'react' import { StyledCollectionHeader, @@ -19,7 +19,7 @@ interface Props { activeSlug?: string } -const CollectionView: React.FunctionComponent = props => ( +const CollectionView: FunctionComponent = props => ( This article is part of a series: diff --git a/components/atoms/Column/index.tsx b/components/atoms/Column/index.tsx index 99bcce1ef..1ce9be624 100644 --- a/components/atoms/Column/index.tsx +++ b/components/atoms/Column/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, FunctionComponent } from 'react' +import { ReactNode, FunctionComponent } from 'react' import { StyledColumn } from './ColumnStyles' diff --git a/components/atoms/Container/index.tsx b/components/atoms/Container/index.tsx index 0fb55ee49..3aa747d74 100644 --- a/components/atoms/Container/index.tsx +++ b/components/atoms/Container/index.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode, FunctionComponent } from 'react' +import { ReactNode, FunctionComponent } from 'react' import { StyledContainer } from './ContainerStyles' diff --git a/components/atoms/ContentCard/index.tsx b/components/atoms/ContentCard/index.tsx index 77a589508..a762d1ced 100644 --- a/components/atoms/ContentCard/index.tsx +++ b/components/atoms/ContentCard/index.tsx @@ -1,6 +1,6 @@ import Card from '@components/atoms/Card' import Link from 'next/link' -import React from 'react' +import { FunctionComponent } from 'react' import { StyledCardBody, @@ -20,7 +20,7 @@ export interface Props { contentType?: string | null } -const ContentCard: React.FunctionComponent = props => { +const ContentCard: FunctionComponent = props => { const isPost = props.contentType === 'post' return ( diff --git a/components/atoms/ContentCardList/index.tsx b/components/atoms/ContentCardList/index.tsx index 33f2a46b1..155b54b5f 100644 --- a/components/atoms/ContentCardList/index.tsx +++ b/components/atoms/ContentCardList/index.tsx @@ -2,13 +2,13 @@ import Column from '@components/atoms/Column' import ContentCard from '@components/atoms/ContentCard' import Row from '@components/atoms/Row' import MarkdownFileWithUrl from '@interfaces/MarkdownFileWithUrl' -import React from 'react' +import { FunctionComponent } from 'react' interface Props { records: MarkdownFileWithUrl[] } -const ContentCardList: React.FunctionComponent = props => ( +const ContentCardList: FunctionComponent = props => ( {props.records.map(record => ( diff --git a/components/atoms/CreativeCommonsNotice/index.tsx b/components/atoms/CreativeCommonsNotice/index.tsx index 4414ffa91..48ee5eb23 100644 --- a/components/atoms/CreativeCommonsNotice/index.tsx +++ b/components/atoms/CreativeCommonsNotice/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import { FunctionComponent } from 'react' import { StyledCreativeCommonsNoticeContainer, @@ -9,7 +9,7 @@ import { const creativeCommonsUrl = 'https://creativecommons.org/licenses/by-nc-sa/4.0/' -const CreativeCommonsNotice: React.FunctionComponent = () => ( +const CreativeCommonsNotice: FunctionComponent = () => ( This work is licensed under a{' '} diff --git a/components/atoms/EmbeddedYoutubeVideo/index.tsx b/components/atoms/EmbeddedYoutubeVideo/index.tsx index 4892045ca..80c326503 100644 --- a/components/atoms/EmbeddedYoutubeVideo/index.tsx +++ b/components/atoms/EmbeddedYoutubeVideo/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import { FunctionComponent } from 'react' import { StyledEmbeddedVideoWrapper, StyledEmbeddedVideo } from './EmbeddedYoutubeVideoStyles' @@ -9,7 +9,7 @@ interface Props { id: string } -const EmbeddedYoutubeVideo: React.FunctionComponent = props => ( +const EmbeddedYoutubeVideo: FunctionComponent = props => ( = props => ( +const GifLikeVideo: FunctionComponent = props => ( . */ -export const GoogleTagManagerScriptTag: React.FunctionComponent = props => ( +export const GoogleTagManagerScriptTag: FunctionComponent = props => (