From 170f789ddda1a6f291a901d8e5d85b1d6f45a431 Mon Sep 17 00:00:00 2001 From: Kristoffer Eide Date: Tue, 19 Oct 2021 21:42:20 +0200 Subject: [PATCH] Replace ReactElement with JSX.Element and remove eslint-disable --- components/LandingPageNav.js | 5 ++--- components/LargeHeroContent.js | 5 ++--- components/LargeHeroSection.js | 5 ++--- pages/_app.js | 2 +- pages/_document.js | 2 -- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/components/LandingPageNav.js b/components/LandingPageNav.js index 44c69689..2c77dac6 100644 --- a/components/LandingPageNav.js +++ b/components/LandingPageNav.js @@ -1,6 +1,5 @@ // @ts-check -// eslint-disable-next-line no-unused-vars -import { ReactElement, useEffect, useState } from 'react'; // ReactElement is only imported for typechecking +import { useEffect, useState } from 'react'; // import { BsSearch } from 'react-icons/bs'; // import { Routes } from '../models/routes'; import { FaRegHeart } from 'react-icons/fa'; @@ -13,7 +12,7 @@ import { FaRegHeart } from 'react-icons/fa'; * * @param {Object} props - { fadeInSpeed } * @param {String} [props.fadeInSpeed = '700' ] - change the speed of fade in "ease-in duration-`fadeInSpeed`" | Example: `"700"` : [tailwind durations](https://tailwindcss.com/docs/transition-duration) - * @returns {ReactElement} JSX + * @returns {JSX.Element} JSX */ const LandingPageNav = ({ fadeInSpeed = '1000' }) => { const [navOpacity, setnavOpacity] = useState(0); diff --git a/components/LargeHeroContent.js b/components/LargeHeroContent.js index 17093714..35ca38f4 100644 --- a/components/LargeHeroContent.js +++ b/components/LargeHeroContent.js @@ -1,6 +1,5 @@ // @ts-check -// eslint-disable-next-line no-unused-vars -import { ReactElement, useEffect, useState } from 'react'; // ReactElement is only imported for typechecking +import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; /** @@ -17,7 +16,7 @@ import PropTypes from 'prop-types'; * @param {String} props.title - The title of the hero section * @param {String} [props.titleSize = '5xl'] - "text-`titleSize`" | Example: `"5xl"` | [Tailwind text sizes](https://tailwindcss.com/docs/font-size) * @param {*} props.children - The content of the hero section - * @returns {ReactElement} JSX + * @returns {JSX.Element} JSX */ const LargeHeroContent = ({ diff --git a/components/LargeHeroSection.js b/components/LargeHeroSection.js index 166cf18c..85a4e7d9 100644 --- a/components/LargeHeroSection.js +++ b/components/LargeHeroSection.js @@ -1,7 +1,6 @@ // @ts-check -// eslint-disable-next-line no-unused-vars -import { ReactElement, useEffect, useState } from 'react'; // ReactElement is only imported for typechecking import PropTypes from 'prop-types'; +import React from 'react'; /** * ## Large Hero Section @@ -14,7 +13,7 @@ import PropTypes from 'prop-types'; * @param {String} props.bgImage - Background image url * @param {String} [props.opacity = '60' ] "bg-opacity-`opacity`" | Example: `"30"` | [Tailwind opacity](https://tailwindcss.com/docs/background-opacity) * @param {*} props.children - Children elements - * @returns {ReactElement} JSX + * @returns {JSX.Element} JSX */ const LargeHeroSection = ({ bgImage, children, opacity = '60' }) => { diff --git a/pages/_app.js b/pages/_app.js index ad77b6fe..ba5805f5 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -9,7 +9,7 @@ function MyApp({ Component, pageProps }) { MyApp.propTypes = { Component: PropTypes.func, - pageProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types + pageProps: PropTypes.object, }; export default MyApp; diff --git a/pages/_document.js b/pages/_document.js index 591b2e16..3192491e 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -3,13 +3,11 @@ import Document, { Head, Html, Main, NextScript } from 'next/document'; import React from 'react'; class MyDocument extends Document { - // eslint-disable-next-line static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx); return { ...initialProps }; } - // eslint-disable-next-line render() { return (