diff --git a/app/components/FilterOptions.tsx b/app/components/FilterOptions.tsx index d1ef547d8..30caeae83 100644 --- a/app/components/FilterOptions.tsx +++ b/app/components/FilterOptions.tsx @@ -1,4 +1,3 @@ -import { find } from "lodash"; import * as React from "react"; import { useMenuState, MenuButton } from "reakit/Menu"; import styled from "styled-components"; @@ -34,11 +33,8 @@ const FilterOptions = ({ modal: true, }); const selected = - find(options, { - key: activeKey, - }) || options[0]; + options.find((option) => option.key === activeKey) || options[0]; - // @ts-expect-error ts-migrate(2339) FIXME: Property 'label' does not exist on type 'number | ... Remove this comment to see the full error message const selectedLabel = selected ? `${selectedPrefix} ${selected.label}` : ""; return ( diff --git a/app/components/GroupListItem.tsx b/app/components/GroupListItem.tsx index 4604d49bd..259f44e06 100644 --- a/app/components/GroupListItem.tsx +++ b/app/components/GroupListItem.tsx @@ -41,7 +41,6 @@ class GroupListItem extends React.Component { const membershipsInGroup = groupMemberships.inGroup(group.id); const users = membershipsInGroup .slice(0, MAX_AVATAR_DISPLAY) - // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'GroupMembe... Remove this comment to see the full error message .map((gm) => gm.user); const overflow = memberCount - users.length; diff --git a/app/components/PaginatedList.test.tsx b/app/components/PaginatedList.test.tsx index e7081c3e7..e95a19eb6 100644 --- a/app/components/PaginatedList.test.tsx +++ b/app/components/PaginatedList.test.tsx @@ -64,8 +64,7 @@ describe("PaginatedList", () => { }); it("calls fetch when options prop changes", async () => { - // @ts-expect-error ts-migrate(2554) FIXME: Expected 1-3 arguments, but got 0. - const fetchedItems = Array(DEFAULT_PAGINATION_LIMIT).fill(); + const fetchedItems = Array(DEFAULT_PAGINATION_LIMIT).fill(undefined); const fetch = jest.fn().mockReturnValue(Promise.resolve(fetchedItems)); const list = shallow( { - // @ts-expect-error ts-migrate(2339) FIXME: Property 'sortBy' does not exist on type 'TableSta... Remove this comment to see the full error message if (!isEqual(newState.sortBy, prevState.sortBy)) { return { ...newState, pageIndex: 0 }; } @@ -127,20 +120,15 @@ function Table({ {headerGroups.map((headerGroup) => ( {headerGroup.headers.map((column) => ( - // @ts-expect-error ts-migrate(2339) FIXME: Property 'getSortByToggleProps' does not exist on ... Remove this comment to see the full error message {column.render("Header")} - { - // @ts-expect-error known issue: https://github.com/tannerlinsley/react-table/issues/2970 - column.isSorted && - // @ts-expect-error ts-migrate(2339) FIXME: Property 'isSortedDesc' does not exist on type 'He... Remove this comment to see the full error message - (column.isSortedDesc ? ( - - ) : ( - - )) - } + {column.isSorted && + (column.isSortedDesc ? ( + + ) : ( + + ))} ))} diff --git a/app/models/GroupMembership.ts b/app/models/GroupMembership.ts index 0ad01ddb9..ef71c6481 100644 --- a/app/models/GroupMembership.ts +++ b/app/models/GroupMembership.ts @@ -1,4 +1,5 @@ import BaseModel from "./BaseModel"; +import User from "./User"; class GroupMembership extends BaseModel { id: string; @@ -6,6 +7,8 @@ class GroupMembership extends BaseModel { userId: string; groupId: string; + + user: User; } export default GroupMembership; diff --git a/app/scenes/Settings/components/PeopleTable.tsx b/app/scenes/Settings/components/PeopleTable.tsx index 3b2951a78..df467400c 100644 --- a/app/scenes/Settings/components/PeopleTable.tsx +++ b/app/scenes/Settings/components/PeopleTable.tsx @@ -12,8 +12,7 @@ import Time from "~/components/Time"; import useCurrentUser from "~/hooks/useCurrentUser"; import UserMenu from "~/menus/UserMenu"; -// @ts-expect-error ts-migrate(2344) FIXME: Type 'Props' does not satisfy the constraint 'Comp... Remove this comment to see the full error message -const Table = React.lazy( +const Table = React.lazy( () => import( /* webpackChunkName: "table" */ @@ -40,38 +39,36 @@ function PeopleTable({ canManage, ...rest }: Props) { id: "name", Header: t("Name"), accessor: "name", - // @ts-expect-error ts-migrate(7031) FIXME: Binding element 'value' implicitly has an 'any' ty... Remove this comment to see the full error message - Cell: observer(({ value, row }) => ( - - {value}{" "} - {currentUser.id === row.original.id && `(${t("You")})`} - - )), + Cell: observer( + ({ value, row }: { value: string; row: { original: User } }) => ( + + {value}{" "} + {currentUser.id === row.original.id && `(${t("You")})`} + + ) + ), }, canManage ? { id: "email", Header: t("Email"), accessor: "email", - // @ts-expect-error ts-migrate(7031) FIXME: Binding element 'value' implicitly has an 'any' ty... Remove this comment to see the full error message - Cell: observer(({ value }) => value), + Cell: observer(({ value }: { value: string }) => <>{value}), } : undefined, { id: "lastActiveAt", Header: t("Last active"), accessor: "lastActiveAt", - Cell: observer( - // @ts-expect-error ts-migrate(7031) FIXME: Binding element 'value' implicitly has an 'any' ty... Remove this comment to see the full error message - ({ value }) => value &&