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> --- src/index.tsx | 72 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 73e8120..871eb40 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,50 +1,52 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; -import * as serviceWorker from './serviceWorker'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App"; +import * as serviceWorker from "./serviceWorker"; import * as Sentry from "@sentry/react"; import colors from "./colors"; if (process.env.NODE_ENV === "production") { - Sentry.init({ - dsn: process.env.REACT_APP_SENTRY_DSN, - tracesSampleRate: 0.25, - release: `forms-frontend@${process.env.REACT_APP_SHA}`, - environment: process.env.CONTEXT - }); + Sentry.init({ + dsn: process.env.REACT_APP_SENTRY_DSN, + tracesSampleRate: 0.25, + release: `forms-frontend@${process.env.REACT_APP_SHA}`, + environment: process.env.CONTEXT + }); } -console.log("%c Python Discord Forms ", `font-size: 6em; font-family: "Hind", "Arial"; font-weight: 900; background-color: ${colors.blurple}; border-radius: 10px;`) -console.log("%cWelcome to Python Discord Forms", `font-size: 3em; font-family: "Hind", "Arial";`) +console.log("%c Python Discord Forms ", `font-size: 6em; font-family: "Hind", "Arial"; font-weight: 900; background-color: ${colors.blurple}; border-radius: 10px;`); +console.log("%cWelcome to Python Discord Forms", "font-size: 3em; font-family: \"Hind\", \"Arial\";"); -console.log(` Environment: %c ${process.env.NODE_ENV} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.NODE_ENV === "production" ? colors.success : colors.error}`) -console.log(` Context: %c ${process.env.CONTEXT} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.CONTEXT === "production" ? colors.success : colors.error}`) -console.log(` Location: %c ${document.location.pathname + document.location.search + document.location.hash} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`) -console.log(` User Agent: %c ${navigator.userAgent} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`) -console.log(` Branch: %c ${process.env.REACT_APP_BRANCH} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.REACT_APP_BRANCH === "main" ? colors.success : colors.error}`) -console.log(` SHA: %c ${process.env.REACT_APP_SHA} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`) +console.log(` Environment: %c ${process.env.NODE_ENV} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.NODE_ENV === "production" ? colors.success : colors.error}`); +console.log(` Context: %c ${process.env.CONTEXT} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.CONTEXT === "production" ? colors.success : colors.error}`); +console.log(` Location: %c ${document.location.pathname + document.location.search + document.location.hash} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`); +console.log(` User Agent: %c ${navigator.userAgent} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`); +console.log(` Branch: %c ${process.env.REACT_APP_BRANCH} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.REACT_APP_BRANCH === "main" ? colors.success : colors.error}`); +console.log(` SHA: %c ${process.env.REACT_APP_SHA} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`); -console.log("%cCome join us on Discord! https://discord.gg/python", `font-size: 1.5em; font-family: "Hind", "Arial"; color: ${colors.blurple}`) +console.log("%cCome join us on Discord! https://discord.gg/python", `font-size: 1.5em; font-family: "Hind", "Arial"; color: ${colors.blurple}`); +/* eslint-disable react/react-in-jsx-scope */ ReactDOM.render( - - An error has occurred with Python Discord Forms. Please let us know in the Discord server at discord.gg/python

} - showDialog={true} - dialogOptions={{ - title: "You've found a bug in PyDis forms!" - }} - onError={(err) => { - if(process.env.NODE_ENV === "development") - console.log(err) - }} - > - -
-
, - document.getElementById('root') + + An error has occurred with Python Discord Forms. Please let us know in the Discord server at discord.gg/python

} + showDialog={true} + dialogOptions={{ + title: "You've found a bug in PyDis forms!" + }} + onError={(err) => { + if(process.env.NODE_ENV === "development") + console.log(err); + }} + > + +
+
, + document.getElementById("root") ); +/* eslint-enable react/react-in-jsx-scope */ serviceWorker.unregister(); -- cgit v1.2.3