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
+4 -6
View File
@@ -1,4 +1,4 @@
import React from 'react'
import {useRef, useState} from 'react'
import {View} from 'react-native'
import {useDialogStateControlContext} from '#/state/dialogs'
@@ -18,11 +18,9 @@ export function Dialogs() {
const testDialog = Dialog.useDialogControl()
const {closeAllDialogs} = useDialogStateControlContext()
const unmountTestDialog = Dialog.useDialogControl()
const [reducedMotionEnabled, setReducedMotionEnabled] =
React.useState<boolean>()
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] =
React.useState(false)
const unmountTestInterval = React.useRef<number>(undefined)
const [reducedMotionEnabled, setReducedMotionEnabled] = useState<boolean>()
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] = useState(false)
const unmountTestInterval = useRef<number>(undefined)
const onUnmountTestStartPressWithClose = () => {
setShouldRenderUnmountTest(true)
+12 -12
View File
@@ -1,4 +1,4 @@
import React from 'react'
import {useRef, useState} from 'react'
import {type TextInput, View} from 'react-native'
import {APP_LANGUAGES} from '#/lib/../locale/languages'
@@ -16,21 +16,21 @@ import * as Select from '#/components/Select'
import {H1, H3} from '#/components/Typography'
export function Forms() {
const [toggleGroupAValues, setToggleGroupAValues] = React.useState(['a'])
const [toggleGroupBValues, setToggleGroupBValues] = React.useState(['a', 'b'])
const [toggleGroupCValues, setToggleGroupCValues] = React.useState(['a', 'b'])
const [toggleGroupDValues, setToggleGroupDValues] = React.useState(['warn'])
const [segmentedControlValue, setSegmentedControlValue] = React.useState<
const [toggleGroupAValues, setToggleGroupAValues] = useState(['a'])
const [toggleGroupBValues, setToggleGroupBValues] = useState(['a', 'b'])
const [toggleGroupCValues, setToggleGroupCValues] = useState(['a', 'b'])
const [toggleGroupDValues, setToggleGroupDValues] = useState(['warn'])
const [segmentedControlValue, setSegmentedControlValue] = useState<
'hide' | 'warn' | 'show'
>('warn')
const [value, setValue] = React.useState('')
const [date, setDate] = React.useState('2001-01-01')
const [countryCode, setCountryCode] = React.useState<CountryCode>('US')
const [phoneNumber, setPhoneNumber] = React.useState('')
const [lang, setLang] = React.useState('en')
const [value, setValue] = useState('')
const [date, setDate] = useState('2001-01-01')
const [countryCode, setCountryCode] = useState<CountryCode>('US')
const [phoneNumber, setPhoneNumber] = useState('')
const [lang, setLang] = useState('en')
const inputRef = React.useRef<TextInput>(null)
const inputRef = useRef<TextInput>(null)
return (
<View style={[a.gap_4xl, a.align_start]}>
+4 -4
View File
@@ -1,4 +1,4 @@
import React from 'react'
import {useMemo, useRef, useState} from 'react'
import {View} from 'react-native'
import {ScrollProvider} from '#/lib/ScrollContext'
@@ -8,10 +8,10 @@ import * as Toggle from '#/components/forms/Toggle'
import {Text} from '#/components/Typography'
export function ListContained() {
const [animated, setAnimated] = React.useState(false)
const ref = React.useRef<ListMethods>(null)
const [animated, setAnimated] = useState(false)
const ref = useRef<ListMethods>(null)
const data = React.useMemo(() => {
const data = useMemo(() => {
return Array.from({length: 100}, (_, i) => ({
id: i,
text: `Message ${i}`,
+2 -2
View File
@@ -1,4 +1,4 @@
import React from 'react'
import {useState} from 'react'
import {View} from 'react-native'
import {useNavigation} from '@react-navigation/native'
@@ -28,7 +28,7 @@ import {Typography} from './Typography'
export default function Storybook() {
const {setColorMode, setDarkTheme} = useSetThemePrefs()
const [showContainedList, setShowContainedList] = React.useState(false)
const [showContainedList, setShowContainedList] = useState(false)
const navigation = useNavigation<NavigationProp>()
const requestDeviceGeolocation = useRequestDeviceGeolocation()
const {setDeviceGeolocation} = useDeviceGeolocationApi()