Small cleanup to some common
code (#422)
* Remove unnecessary type helpers * Turn on unused code lint
This commit is contained in:
parent
b89753e1fe
commit
f8c44efeba
|
@ -22,7 +22,6 @@ module.exports = {
|
|||
],
|
||||
rules: {
|
||||
'no-extra-semi': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-constant-condition': ['error', { checkLoops: false }],
|
||||
'lodash/import-scope': [2, 'member'],
|
||||
},
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export type FirstArgument<T> = T extends (arg1: infer U, ...args: any[]) => any
|
||||
? U
|
||||
: any
|
||||
|
||||
export type Truthy<T> = Exclude<T, undefined | null | false | 0 | ''>
|
|
@ -29,7 +29,6 @@ import { resolvedPayout } from 'common/calculate'
|
|||
import { formatMoney } from 'common/util/format'
|
||||
import { useUserById } from 'web/hooks/use-users'
|
||||
import { ContractTabs } from 'web/components/contract/contract-tabs'
|
||||
import { FirstArgument } from 'common/util/types'
|
||||
import { contractTextDetails } from 'web/components/contract/contract-details'
|
||||
import { useWindowSize } from 'web/hooks/use-window-size'
|
||||
import Confetti from 'react-confetti'
|
||||
|
@ -88,7 +87,7 @@ export default function ContractPage(props: {
|
|||
return <ContractPageContent {...props} />
|
||||
}
|
||||
|
||||
export function ContractPageContent(props: FirstArgument<typeof ContractPage>) {
|
||||
export function ContractPageContent(props: Parameters<typeof ContractPage>[0]) {
|
||||
const { backToHome } = props
|
||||
|
||||
const user = useUser()
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { FirstArgument } from 'common/util/types'
|
||||
import { Col } from 'web/components/layout/col'
|
||||
import { Spacer } from 'web/components/layout/spacer'
|
||||
import { fromPropz } from 'web/hooks/use-propz'
|
||||
|
@ -10,7 +9,7 @@ import Analytics, {
|
|||
|
||||
export const getStaticProps = fromPropz(getStaticPropz)
|
||||
|
||||
export default function AnalyticsEmbed(props: FirstArgument<typeof Analytics>) {
|
||||
export default function AnalyticsEmbed(props: Parameters<typeof Analytics>[0]) {
|
||||
return (
|
||||
<Col className="w-full bg-white px-2">
|
||||
<CustomAnalytics {...props} />
|
||||
|
|
Loading…
Reference in New Issue
Block a user