fix: update eslint config to test .ts and .js separately (#2805)

* fix: update eslint config

* fix: update ts ignore

* fix: update eslint config

* Update TeamAvailabilityScreen.tsx

* Type fixes

* Update useIntercom.ts

Co-authored-by: Omar López <[email protected]>
This commit is contained in:
iamkunandOmar López authored and GitHub committed 2022-05-18 10:05:25 -06:00
1 parent 952a149604
commit 31aff64e42
12 files changed
+43 -36

No files matched your search

@@ -1,12 +1,12 @@
import dayjs from "dayjs";
import React, { useState, useEffect, CSSProperties } from "react";
import { CSSProperties, useEffect, useState } from "react";
import TimezoneSelect, { ITimezone } from "react-timezone-select";
import AutoSizer from "react-virtualized-auto-sizer";
import { FixedSizeList as List } from "react-window";
import { WEBSITE_URL } from "@calcom/lib/constants";
import { trpc, inferQueryOutput } from "@lib/trpc";
import { inferQueryOutput, trpc } from "@lib/trpc";
import Avatar from "@components/ui/Avatar";
import { DatePicker } from "@components/ui/form/DatePicker";
@@ -100,10 +100,8 @@ export default function TeamAvailabilityScreen(props: Props) {
</div>
</div>
<div className="flex h-full flex-1">
{/* @ts-ignore */}
<AutoSizer>
{({ height, width }) => (
// @ts-ignore
<List
itemSize={240}
itemCount={props.team?.members?.length ?? 0}
@@ -2,19 +2,19 @@ import Router from "next/router";
import { useCallback, useMemo, useState } from "react";
import React from "react";
import Web3 from "web3";
import { AbstractProvider } from "web3-core";
import { AbiItem } from "web3-utils";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import showToast from "@calcom/lib/notification";
import { Button } from "@calcom/ui/Button";
import { useLocale } from "@lib/hooks/useLocale";
import { useContracts } from "../../../contexts/contractsContext";
import genericAbi from "../../../web3/abis/abiWithGetBalance.json";
import verifyAccount, { AUTH_MESSAGE } from "../../../web3/utils/verifyAccount";
interface Window {
ethereum: any;
ethereum: AbstractProvider & { selectedAddress: string };
web3: Web3;
}
interface EvtsToVerify {
@@ -40,7 +40,7 @@ const CryptoSection = (props: CryptoSectionProps) => {
const { t } = useLocale();
const connectMetamask = useCallback(async () => {
if (window.ethereum) {
if (window.ethereum && typeof window.ethereum.request === "function") {
await window.ethereum.request({ method: "eth_requestAccounts" });
window.web3 = new Web3(window.ethereum);
toggleEthEnabled(true);
@@ -64,10 +64,7 @@ const CryptoSection = (props: CryptoSectionProps) => {
throw new Error("Specified wallet does not own any tokens belonging to this smart contract");
} else {
const account = (await window.web3.eth.getAccounts())[0];
// @ts-ignore
const signature = await window.web3.eth.personal.sign(AUTH_MESSAGE, account);
// @ts-ignore
const signature = await window.web3.eth.personal.sign(AUTH_MESSAGE, account, "");
addContract({ address: props.smartContractAddress, signature });
await verifyAccount(signature, account);
@@ -11,6 +11,7 @@ const ImpersonationProvider = CredentialsProvider({
username: { label: "Username", type: "text " },
},
async authorize(creds, req) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore need to figure out how to correctly type this
const session = await getSession({ req });
if (session?.user.role !== "ADMIN") {
+3 -2
View File
@@ -1,11 +1,12 @@
import noop from "lodash/noop";
import { useIntercom as _useIntercom } from "react-use-intercom";
export const useIntercom =
typeof window !== "undefined" && !!process.env.NEXT_PUBLIC_INTERCOM_APP_ID
? _useIntercom
: () => ({
boot: () => {},
show: () => {},
boot: noop,
show: noop,
});
export default useIntercom;
@@ -126,7 +126,7 @@ async function handlePaymentSuccess(event: Stripe.Event) {
if (booking.location) evt.location = booking.location;
let bookingData: Prisma.BookingUpdateInput = {
const bookingData: Prisma.BookingUpdateInput = {
paid: true,
confirmed: true,
};