Skip to content

Commit

Permalink
chore: Remove useless configs (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 authored Dec 9, 2023
1 parent 5db615a commit e51997b
Show file tree
Hide file tree
Showing 39 changed files with 387 additions and 381 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js

This file was deleted.

Empty file removed .gitmodules
Empty file.
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

6 changes: 5 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
module.exports = require('@amaurym/eslintrc/prettierrc');
module.exports = {
semi: true,
tabWidth: 4,
useTabs: true,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dev": "next dev",
"build": "next build",
"gen:license": "ts-node -P scripts/tsconfig.json scripts/license.ts",
"lint": "tsc --noEmit && eslint . --ext js,ts,tsx",
"lint": "tsc --noEmit && prettier -w */**/*.{ts,tsx}",
"start": "next start"
},
"dependencies": {
Expand Down
24 changes: 12 additions & 12 deletions src/components/ApiUsage.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Capacity, Loading, Spacer, Text } from '@geist-ui/react';
import { Loader } from '@geist-ui/react-icons';
import { format, parseISO } from 'date-fns';
import React, { useEffect, useState } from 'react';
import { Capacity, Loading, Spacer, Text } from "@geist-ui/react";
import { Loader } from "@geist-ui/react-icons";
import { format, parseISO } from "date-fns";
import React, { useEffect, useState } from "react";

import { sentryException } from '../util/sentry';
import { subApiMaxCalls } from '../util/subs';
import { getApiUsageClient } from '../util/supabaseClient';
import { useUser } from '../util/useUser';
import styles from './ApiUsage.module.css';
import { Demo } from './Demo';
import { sentryException } from "../util/sentry";
import { subApiMaxCalls } from "../util/subs";
import { getApiUsageClient } from "../util/supabaseClient";
import { useUser } from "../util/useUser";
import styles from "./ApiUsage.module.css";
import { Demo } from "./Demo";

export function ApiUsage(): React.ReactElement {
const { subscription, user, userFinishedLoading } = useUser();
Expand All @@ -34,7 +34,7 @@ export function ApiUsage(): React.ReactElement {
Email verifications this month
{subscription && (
<>
{' '}
{" "}
({formatDate(
subscription.current_period_start
)} - {formatDate(subscription.current_period_end)})
Expand Down Expand Up @@ -71,5 +71,5 @@ export function ApiUsage(): React.ReactElement {
}

function formatDate(d: string | Date): string {
return format(typeof d === 'string' ? parseISO(d) : d, 'do MMM yyyy');
return format(typeof d === "string" ? parseISO(d) : d, "do MMM yyyy");
}
8 changes: 4 additions & 4 deletions src/components/Crisp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */

import { useEffect } from 'react';
import { useEffect } from "react";

export default function Crisp(): null {
useEffect(() => {
Expand All @@ -10,11 +10,11 @@ export default function Crisp(): null {
window.CRISP_WEBSITE_ID = process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID;
(() => {
const d = document;
const s = d.createElement('script');
s.src = 'https://client.crisp.chat/l.js';
const s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
// @ts-ignore
s.async = 1;
d.getElementsByTagName('body')[0].appendChild(s);
d.getElementsByTagName("body")[0].appendChild(s);
})();
}, []);

Expand Down
24 changes: 12 additions & 12 deletions src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Link as GLink, Loading, Page, Spacer, Text } from '@geist-ui/react';
import React from 'react';
import { Link as GLink, Loading, Page, Spacer, Text } from "@geist-ui/react";
import React from "react";

import { StripeMananageButton } from '../components/StripeManageButton';
import { SubGetStarted } from '../components/SubGetStarted/';
import { StripeMananageButton } from "../components/StripeManageButton";
import { SubGetStarted } from "../components/SubGetStarted/";
import {
COMMERCIAL_LICENSE_PRODUCT_ID,
productName,
SAAS_10K_PRODUCT_ID,
} from '../util/subs';
import { SupabaseProductWithPrice } from '../util/supabaseClient';
import { useUser } from '../util/useUser';
import { ApiUsage } from './ApiUsage';
import styles from './Dashboard.module.css';
} from "../util/subs";
import { SupabaseProductWithPrice } from "../util/supabaseClient";
import { useUser } from "../util/useUser";
import { ApiUsage } from "./ApiUsage";
import styles from "./Dashboard.module.css";

interface DashboardProps {
products: SupabaseProductWithPrice[];
Expand All @@ -25,7 +25,7 @@ export function Dashboard({ products }: DashboardProps): React.ReactElement {
({ id }) => id === COMMERCIAL_LICENSE_PRODUCT_ID
);
if (!saasProduct || !licenseProduct) {
throw new Error('Dashboard: saasProduct or licenseProduct not found.');
throw new Error("Dashboard: saasProduct or licenseProduct not found.");
}

if (!userFinishedLoading) {
Expand All @@ -41,9 +41,9 @@ export function Dashboard({ products }: DashboardProps): React.ReactElement {
<section className={styles.plan}>
<div>
<Spacer y={2} />
<Text h2>Hello{userDetails?.full_name || ''},</Text>
<Text h2>Hello{userDetails?.full_name || ""},</Text>
<Text p>
Thanks for using the Reacher{' '}
Thanks for using the Reacher{" "}
{productName(subscription?.prices?.products)}!
</Text>
<div className="flex">
Expand Down
42 changes: 21 additions & 21 deletions src/components/Demo.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button, Card, Code, Input, Spacer, Text } from '@geist-ui/react';
import { CheckEmailOutput } from '@reacherhq/api/lib';
import React, { useState } from 'react';
import { Button, Card, Code, Input, Spacer, Text } from "@geist-ui/react";
import { CheckEmailOutput } from "@reacherhq/api/lib";
import React, { useState } from "react";

import { postData } from '../util/helpers';
import { sentryException } from '../util/sentry';
import { useUser } from '../util/useUser';
import { postData } from "../util/helpers";
import { sentryException } from "../util/sentry";
import { useUser } from "../util/useUser";

function alertError(e: string) {
alert(
Expand All @@ -18,12 +18,12 @@ interface DemoProps {

export function Demo({ onVerified }: DemoProps): React.ReactElement {
const { user, userDetails } = useUser();
const [email, setEmail] = useState('');
const [email, setEmail] = useState("");
const [loading, setLoading] = useState(false);
const [result, setResult] = useState<CheckEmailOutput | undefined>();

function handleVerify() {
window.sa_event && window.sa_event('dashboard:verify:click');
window.sa_event && window.sa_event("dashboard:verify:click");
if (!email) {
return;
}
Expand All @@ -32,7 +32,7 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement {

if (!userDetails) {
alertError(
`userDetails is undefined for user ${user?.id || 'undefined'}`
`userDetails is undefined for user ${user?.id || "undefined"}`
);
return;
}
Expand Down Expand Up @@ -95,23 +95,23 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement {
{result && (
<>
<Text>
Congratulations 💪! We got a result with{' '}
Congratulations 💪! We got a result with{" "}
<code>
is_reachable ={' '}
is_reachable ={" "}
<strong>{result.is_reachable}</strong>
</code>
, {explanation(result)}. The full response is below,
check out{' '}
check out{" "}
<a
href="https://help.reacher.email/email-attributes-inside-json"
target="_blank"
rel="noopener noreferrer"
>
the documentation
</a>{' '}
</a>{" "}
to understand all the fields.
</Text>
<Code block>{JSON.stringify(result, undefined, ' ')}</Code>
<Code block>{JSON.stringify(result, undefined, " ")}</Code>
</>
)}
</Card>
Expand All @@ -120,13 +120,13 @@ export function Demo({ onVerified }: DemoProps): React.ReactElement {

function explanation(result: CheckEmailOutput): string {
switch (result.is_reachable) {
case 'invalid':
return 'which means the email does not exist';
case 'safe':
return 'which means the email exists';
case 'risky':
return 'which means the email exists, but sending an email there might bounce';
case 'unknown':
case "invalid":
return "which means the email does not exist";
case "safe":
return "which means the email exists";
case "risky":
return "which means the email exists, but sending an email there might bounce";
case "unknown":
return "which means Reacher currently isn't able to tell if the email exists or not";
}
}
16 changes: 8 additions & 8 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import { Divider, Grid, Link, Spacer, Text } from '@geist-ui/react';
import Image from 'next/image';
import React from 'react';
import { Divider, Grid, Link, Spacer, Text } from "@geist-ui/react";
import Image from "next/image";
import React from "react";

import logo from '../assets/logo/reacher.svg';
import styles from './Footer.module.css';
import logo from "../assets/logo/reacher.svg";
import styles from "./Footer.module.css";

export function Footer(): React.ReactElement {
return (
Expand Down Expand Up @@ -106,23 +106,23 @@ export function Footer(): React.ReactElement {

<div className={styles.bottom}>
<Text small>
© Reacher 2020-2022,{' '}
© Reacher 2020-2022,{" "}
<Link
href="https://help.reacher.email/mentions-lgales"
target="_blank"
rel="noopener noreferrer"
>
Mentions légales
</Link>
,{' '}
,{" "}
<Link
href="https://help.reacher.email/cgu-cgv"
target="_blank"
rel="noopener noreferrer"
>
CGU/CGV
</Link>
,{' '}
,{" "}
<Link
href="https://help.reacher.email/politique-de-confidentialit"
target="_blank"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Head.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NextHead from 'next/head';
import React from 'react';
import NextHead from "next/head";
import React from "react";

export function Head(): React.ReactElement {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactElement } from 'react';
import React, { ReactElement } from "react";

import { Footer } from './Footer';
import { Head } from './Head';
import { Footer } from "./Footer";
import { Head } from "./Head";

export interface LayoutProps {
children: React.ReactChild;
Expand Down
22 changes: 11 additions & 11 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import { Link as GLink, Select, Spacer, Text } from '@geist-ui/react';
import Image from 'next/image';
import { useRouter } from 'next/router';
import React from 'react';
import { Link as GLink, Select, Spacer, Text } from "@geist-ui/react";
import Image from "next/image";
import { useRouter } from "next/router";
import React from "react";

import logo from '../assets/logo/reacher.svg';
import { sentryException } from '../util/sentry';
import { useUser } from '../util/useUser';
import styles from './Nav.module.css';
import logo from "../assets/logo/reacher.svg";
import { sentryException } from "../util/sentry";
import { useUser } from "../util/useUser";
import styles from "./Nav.module.css";

export function Nav(): React.ReactElement {
const { user, userDetails, signOut } = useUser();
Expand All @@ -19,7 +19,7 @@ export function Nav(): React.ReactElement {
<div>
<a
className="flex"
href={user ? '/dashboard' : 'https://reacher.email'}
href={user ? "/dashboard" : "https://reacher.email"}
>
<Image height={24} src={logo} width={24} />
<Text className={styles.reacher} h3>
Expand Down Expand Up @@ -67,11 +67,11 @@ export function Nav(): React.ReactElement {
<Select.Option
onClick={() => {
signOut()
.then(() => router.push('/login'))
.then(() => router.push("/login"))
.catch(sentryException);
}}
>
Log Out{' '}
Log Out{" "}
</Select.Option>
</Select>
)}
Expand Down
24 changes: 12 additions & 12 deletions src/components/SigninLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Button, Grid, Loading, Text } from '@geist-ui/react';
import type { ButtonProps } from '@geist-ui/react/dist/button/button';
import { CheckCircle, XCircle } from '@geist-ui/react-icons';
import type { User } from '@supabase/supabase-js';
import React from 'react';
import { Button, Grid, Loading, Text } from "@geist-ui/react";
import type { ButtonProps } from "@geist-ui/react/dist/button/button";
import { CheckCircle, XCircle } from "@geist-ui/react-icons";
import type { User } from "@supabase/supabase-js";
import React from "react";

import { Nav } from '../components';
import styles from './SigninLayout.module.css';
import { Nav } from "../components";
import styles from "./SigninLayout.module.css";

interface SiginLayoutProps extends React.HTMLProps<HTMLDivElement> {
title: string;
Expand Down Expand Up @@ -44,7 +44,7 @@ export function SigninLayout({
}

export interface SigninMessage {
type: 'error' | 'success';
type: "error" | "success";
content: string;
}

Expand All @@ -57,11 +57,11 @@ export function SigninLayoutMessage({
}: SigninLayoutMessageProps): React.ReactElement {
return (
<Text small p type={message.type}>
{message.type === 'error' ? (
{message.type === "error" ? (
<XCircle size={16} />
) : (
<CheckCircle size={16} />
)}{' '}
)}{" "}
{message.content}
</Text>
);
Expand All @@ -70,8 +70,8 @@ export function SigninLayoutMessage({
export function SigninButton({
children,
className = styles.button,
size = 'large',
type = 'secondary',
size = "large",
type = "secondary",
...rest
}: Partial<ButtonProps>): React.ReactElement {
return (
Expand Down
Loading

0 comments on commit e51997b

Please sign in to comment.