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
+6 -6
View File
@@ -1,15 +1,15 @@
import React from 'react'
import {createContext, useContext, useState} from 'react'
type StateContext = boolean
type ApiContext = (hasNew: boolean) => void
const stateContext = React.createContext<StateContext>(false)
const stateContext = createContext<StateContext>(false)
stateContext.displayName = 'HomeBadgeStateContext'
const apiContext = React.createContext<ApiContext>((_: boolean) => {})
const apiContext = createContext<ApiContext>((_: boolean) => {})
apiContext.displayName = 'HomeBadgeApiContext'
export function Provider({children}: React.PropsWithChildren<{}>) {
const [state, setState] = React.useState(false)
const [state, setState] = useState(false)
return (
<stateContext.Provider value={state}>
<apiContext.Provider value={setState}>{children}</apiContext.Provider>
@@ -18,9 +18,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
}
export function useHomeBadge() {
return React.useContext(stateContext)
return useContext(stateContext)
}
export function useSetHomeBadge() {
return React.useContext(apiContext)
return useContext(apiContext)
}