Create codemod for addressing ESLint warnings (#10032)

This commit is contained in:
DS Boyce
2026-03-11 15:51:31 -07:00
committed by GitHub
parent 80429ec902
commit 1db01a09a8
240 changed files with 1560 additions and 1347 deletions
@@ -1,4 +1,4 @@
import React from 'react'
import {useCallback, useEffect, useMemo, useState} from 'react'
import {type AppBskyActorDefs} from '@atproto/api'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
@@ -71,10 +71,10 @@ function PostThreadFollowBtnLoaded({
const isFollowing = !!profile.viewer?.following
const isFollowedBy = !!profile.viewer?.followedBy
const [wasFollowing, setWasFollowing] = React.useState<boolean>(isFollowing)
const [wasFollowing, setWasFollowing] = useState<boolean>(isFollowing)
// This prevents the button from disappearing as soon as we follow.
const showFollowBtn = React.useMemo(
const showFollowBtn = useMemo(
() => !isFollowing || !wasFollowing,
[isFollowing, wasFollowing],
)
@@ -90,7 +90,7 @@ function PostThreadFollowBtnLoaded({
* sudden rendering of the button. However, on web if we do this, there's an obvious flicker once the
* button renders. So, we update the state in both cases.
*/
React.useEffect(() => {
useEffect(() => {
const updateWasFollowing = () => {
if (wasFollowing !== isFollowing) {
setWasFollowing(isFollowing)
@@ -106,7 +106,7 @@ function PostThreadFollowBtnLoaded({
}
}, [isFollowing, wasFollowing, navigation])
const onPress = React.useCallback(() => {
const onPress = useCallback(() => {
if (!isFollowing) {
requireAuth(async () => {
try {