Skip to content

Commit c65807d

Browse files
committed
Fix remaining ESLint and TypeScript issues across the codebase
1 parent bf61d69 commit c65807d

File tree

6 files changed

+1415
-44
lines changed

6 files changed

+1415
-44
lines changed

packages/react-hook-tracer/src/Tracer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const traceToConsole = (logEntry: LogEntry) => {
164164
// TODO: Would be nice to use show if it is user-specified, but we currently cannot determine that here.
165165
const message = payload.type === 'string' ? payload.message : ''
166166

167-
const initialArgs: (string | unknown)[] = [
167+
const initialArgs: string[] = [
168168
`${componentLabel} %c${originType}%c ` +
169169
`%c${origin.label ? ${origin.label}» ` : ''}%c` +
170170
`%c${phase ?? ''}%c${colon}` +

packages/react-hook-tracer/src/components/TraceLog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const TraceLog = (): JSX.Element => {
167167
return (
168168
<div className="trace-log">
169169
<div className="header">
170-
<div className="title">Trace log</div>
170+
<div className="title">Trrace log</div>
171171
<div className="spacer"></div>
172172
<div className="buttons">
173173
<SvgButton

packages/react-hook-tracer/src/hooks/useReducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function useReducer<I, S, A>(
8484
// eslint-disable-next-line react-hooks/rules-of-hooks
8585
return useReducerTraced(reducer, initialArg, initializer, traceOptions)
8686
} else {
87-
// eslint-disable-next-line react-hooks/rules-of-hooks, @typescript-eslint/no-explicit-any
87+
// eslint-disable-next-line react-hooks/rules-of-hooks, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
8888
return React.useReducer(reducer, initialArg as any, initializer as any)
8989
}
9090
}
@@ -120,7 +120,7 @@ const useReducerTraced = <I, S, A>(
120120
return state
121121
}
122122

123-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
123+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
124124
const [state, dispatch] = React.useReducer(reducer, initialArg as any, initializer as any) // Unavoidable any's.
125125

126126
const showActionRef = React.useRef(showAction) // Ref to pass showAction to dispatch function.

packages/react-hook-tracer/src/hooks/useRef.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-call */
12
import { act, render, screen } from '@testing-library/react'
23

34
import { TraceLog } from '../components/TraceLog'

packages/react-hook-tracer/src/hooks/useState.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-call */
12
import { act, render, screen } from '@testing-library/react'
23

34
import { TraceLog } from '../components/TraceLog'

0 commit comments

Comments
 (0)