chore: Move to Typescript (#2783)

This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously.

closes #1282
This commit is contained in:
Tom Moor
2021-11-29 06:40:55 -08:00
committed by GitHub
parent 25ccfb5d04
commit 15b1069bcc
1017 changed files with 17410 additions and 54942 deletions

View File

@@ -1,11 +1,9 @@
// @flow
import { Table, TBody, TR, TD } from "oy-vey";
import * as React from "react";
import EmptySpace from "./EmptySpace";
type Props = {
children: React.Node,
children: React.ReactNode;
};
export default ({ children }: Props) => {

View File

@@ -1,7 +1,9 @@
// @flow
import * as React from "react";
type Props = { href: string, children: React.Node };
type Props = {
href: string;
children: React.ReactNode;
};
export default (props: Props) => {
const style = {
@@ -14,7 +16,6 @@ export default (props: Props) => {
textDecoration: "none",
cursor: "pointer",
};
return (
<a {...props} style={style}>
{props.children}

View File

@@ -1,10 +1,9 @@
// @flow
import { Table, TBody, TR, TD } from "oy-vey";
import * as React from "react";
import theme from "../../../shared/theme";
import theme from "@shared/theme";
type Props = {
children: React.Node,
children: React.ReactNode;
};
export default (props: Props) => (

View File

@@ -1,4 +1,3 @@
// @flow
import { Table, TBody, TR, TD } from "oy-vey";
import * as React from "react";
@@ -9,7 +8,6 @@ const EmptySpace = ({ height }: { height?: number }) => {
fontSize: "1px",
msoLineHeightRule: "exactly",
};
return (
<Table width="100%">
<TBody>
@@ -18,7 +16,9 @@ const EmptySpace = ({ height }: { height?: number }) => {
width="100%"
height={`${height}px`}
style={style}
dangerouslySetInnerHTML={{ __html: "&nbsp;" }}
dangerouslySetInnerHTML={{
__html: "&nbsp;",
}}
/>
</TR>
</TBody>

View File

@@ -1,11 +1,10 @@
// @flow
import { Table, TBody, TR, TD } from "oy-vey";
import * as React from "react";
import theme from "../../../shared/theme";
import { twitterUrl } from "../../../shared/utils/routeHelpers";
import theme from "@shared/theme";
import { twitterUrl } from "@shared/utils/routeHelpers";
type Props = {
unsubscribeUrl?: string,
unsubscribeUrl?: string;
};
export default ({ unsubscribeUrl }: Props) => {
@@ -15,26 +14,22 @@ export default ({ unsubscribeUrl }: Props) => {
color: theme.slate,
fontSize: "14px",
};
const unsubStyle = {
padding: "0",
color: theme.slate,
fontSize: "14px",
};
const linkStyle = {
color: theme.slate,
fontWeight: 500,
textDecoration: "none",
marginRight: "10px",
};
const externalLinkStyle = {
color: theme.slate,
textDecoration: "none",
margin: "0 10px",
};
return (
<Table width="100%">
<TBody>

View File

@@ -1,4 +1,3 @@
// @flow
import { Table, TBody, TR, TD } from "oy-vey";
import * as React from "react";
import EmptySpace from "./EmptySpace";

View File

@@ -1,13 +1,11 @@
// @flow
import * as React from "react";
const style = {
fontWeight: 500,
fontSize: "18px",
};
type Props = {
children: React.Node,
children: React.ReactNode;
};
export default ({ children }: Props) => (