Address lint warnings (#10188)

This commit is contained in:
DS Boyce
2026-04-08 15:54:43 -07:00
committed by GitHub
parent e4b4e48acb
commit d0d00ba9f8
15 changed files with 170 additions and 173 deletions
+18 -24
View File
@@ -1,8 +1,6 @@
import {useEffect, useRef, useState} from 'react'
import {type TextInput, View} from 'react-native'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {Plural, Trans} from '@lingui/react/macro'
import {Plural, Trans, useLingui} from '@lingui/react/macro'
import * as EmailValidator from 'email-validator'
import type tldts from 'tldts'
@@ -60,7 +58,7 @@ export function StepInfo({
refetchServer: () => void
isLoadingStarterPack: boolean
}) {
const {_} = useLingui()
const {t: l} = useLingui()
const ax = useAnalytics()
const {state, dispatch} = useSignupContext()
const preemptivelyCompleteActivePolicyUpdate =
@@ -94,12 +92,12 @@ export function StepInfo({
const tldtsRef = useRef<typeof tldts>(undefined)
useEffect(() => {
// @ts-expect-error - valid path
import('tldts/dist/index.cjs.min.js').then(tldts => {
void import('tldts/dist/index.cjs.min.js').then(tldts => {
tldtsRef.current = tldts
})
// This will get used in the avatar creator a few steps later, so lets preload it now
// @ts-expect-error - valid path
import('react-native-view-shot/src/index')
void import('react-native-view-shot/src/index')
}, [])
const onNextPress = () => {
@@ -115,21 +113,21 @@ export function StepInfo({
if (state.serviceDescription?.inviteCodeRequired && !inviteCode) {
return dispatch({
type: 'setError',
value: _(msg`Please enter your invite code.`),
value: l`Please enter your invite code.`,
field: 'invite-code',
})
}
if (!email) {
return dispatch({
type: 'setError',
value: _(msg`Please enter your email.`),
value: l`Please enter your email.`,
field: 'email',
})
}
if (!EmailValidator.validate(email)) {
return dispatch({
type: 'setError',
value: _(msg`Your email appears to be invalid.`),
value: l`Your email appears to be invalid.`,
field: 'email',
})
}
@@ -139,9 +137,7 @@ export function StepInfo({
setHasWarnedEmail(true)
return dispatch({
type: 'setError',
value: _(
msg`Please double-check that you have entered your email address correctly.`,
),
value: l`Please double-check that you have entered your email address correctly.`,
})
}
} else if (hasWarnedEmail) {
@@ -151,14 +147,14 @@ export function StepInfo({
if (!password) {
return dispatch({
type: 'setError',
value: _(msg`Please choose your password.`),
value: l`Please choose your password.`,
field: 'password',
})
}
if (password.length < 8) {
return dispatch({
type: 'setError',
value: _(msg`Your password must be at least 8 characters long.`),
value: l`Your password must be at least 8 characters long.`,
field: 'password',
})
}
@@ -205,7 +201,7 @@ export function StepInfo({
dispatch({type: 'clearError'})
}
}}
label={_(msg`Required for this provider`)}
label={l`Required for this provider`}
defaultValue={state.inviteCode}
autoCapitalize="none"
autoComplete="email"
@@ -241,7 +237,7 @@ export function StepInfo({
dispatch({type: 'clearError'})
}
}}
label={_(msg`Enter your email address`)}
label={l`Enter your email address`}
defaultValue={state.email}
autoCapitalize="none"
autoComplete="email"
@@ -269,7 +265,7 @@ export function StepInfo({
dispatch({type: 'clearError'})
}
}}
label={_(msg`Choose your password`)}
label={l`Choose your password`}
defaultValue={state.password}
secureTextEntry
autoComplete="new-password"
@@ -297,8 +293,8 @@ export function StepInfo({
value: sanitizeDate(new Date(date)),
})
}}
label={_(msg`Date of birth`)}
accessibilityHint={_(msg`Select your date of birth`)}
label={l`Date of birth`}
accessibilityHint={l`Select your date of birth`}
maximumDate={new Date()}
/>
</View>
@@ -331,9 +327,7 @@ export function StepInfo({
<Trans>
Have we got your location wrong?{' '}
<SimpleInlineLinkText
label={_(
msg`Tap here to confirm your location with GPS.`,
)}
label={l`Tap here to confirm your location with GPS.`}
{...createStaticClick(() => {
locationControl.open()
})}>
@@ -363,7 +357,7 @@ export function StepInfo({
props.closeDialog(() => {
// set this after close!
setDeviceGeolocation(props.geolocation)
Toast.show(_(msg`Your location has been updated.`), {
Toast.show(l`Your location has been updated.`, {
type: 'success',
})
})
@@ -380,7 +374,7 @@ export function StepInfo({
onBackPress={onPressBack}
onNextPress={onNextPress}
onRetryPress={refetchServer}
overrideNextText={hasWarnedEmail ? _(msg`It's correct`) : undefined}
overrideNextText={hasWarnedEmail ? l`It's correct` : undefined}
/>
</>
)