From d664ddc9b84b25922239e3bbc253b35ea54f2533 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Sun, 3 Jan 2021 05:47:07 +0300 Subject: Fixes Preexisting Linting Issues Fixes all errors, and most warnings generated by eslint. Most were fixed by eslint automatically such as indentation and quotes. Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> --- .eslintrc.json | 17 ++- src/App.tsx | 76 +++++----- src/api/client.ts | 2 +- src/api/forms.ts | 8 +- src/colors.ts | 14 +- src/components/FormListing.tsx | 26 ++-- src/components/HeaderBar/index.tsx | 26 ++-- src/components/Loading.tsx | 4 +- src/components/OAuth2Button.tsx | 66 ++++----- src/components/Tag.tsx | 2 +- src/index.tsx | 72 +++++----- src/pages/CallbackPage.tsx | 2 +- src/pages/FormPage.tsx | 10 +- src/pages/LandingPage.tsx | 48 +++---- src/react-app-env.d.ts | 30 ++-- src/serviceWorker.ts | 216 ++++++++++++++--------------- src/setupTests.ts | 2 +- src/tests/App.test.tsx | 6 +- src/tests/api/forms.test.ts | 6 +- src/tests/components/FormListing.test.tsx | 24 ++-- src/tests/components/HeaderBar.test.tsx | 10 +- src/tests/components/OAuth2Button.test.tsx | 10 +- src/tests/components/Tag.test.tsx | 12 +- src/tests/globalStyles.test.ts | 2 +- src/tests/pages/CallbackPage.test.tsx | 20 +-- src/tests/pages/FormPage.test.tsx | 14 +- src/tests/pages/LandingPage.test.tsx | 14 +- 27 files changed, 378 insertions(+), 361 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 4e55622..5c7c77a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -37,5 +37,20 @@ "error", "always" ] - } + }, + "settings": { + "react": { + "pragma": "jsx", + "version": "detect", + "flowVersion": "0.53" + } + }, + "overrides": [ + { + "files": "*.test.ts*", + "rules": { + "react/react-in-jsx-scope": "off" + } + } + ] } diff --git a/src/App.tsx b/src/App.tsx index b1b2184..523e583 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,9 +4,9 @@ import React, { Suspense } from "react"; import { jsx, css, Global } from "@emotion/react"; import { - BrowserRouter as Router, - Route, - Switch + BrowserRouter as Router, + Route, + Switch } from "react-router-dom"; import { PropagateLoader } from "react-spinners"; @@ -20,48 +20,48 @@ const FormPage = React.lazy(() => import("./pages/FormPage")); const CallbackPage = React.lazy(() => import("./pages/CallbackPage")); const routes = [ - { path: "/", Component: LandingPage }, - { path: "/form/:id", Component: FormPage}, - { path: "/callback", Component: CallbackPage } -] + { path: "/", Component: LandingPage }, + { path: "/form/:id", Component: FormPage}, + { path: "/callback", Component: CallbackPage } +]; function PageLoading() { - return