diff options
| author | Kit Langton <[email protected]> | 2026-04-15 23:50:47 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-16 03:50:47 +0000 |
| commit | 8aa0f9fe9515ba0234ab6a0a58c868068913bb05 (patch) | |
| tree | d079fdd75796492449157256dafe7e309e04da63 /packages/ui | |
| parent | c802695ee9555ccfd8b0a6ae2215f750bccda712 (diff) | |
| download | opencode-8aa0f9fe9515ba0234ab6a0a58c868068913bb05.tar.gz opencode-8aa0f9fe9515ba0234ab6a0a58c868068913bb05.zip | |
feat: enable type-aware no-base-to-string rule, fix 56 violations (#22750)
Diffstat (limited to 'packages/ui')
| -rw-r--r-- | packages/ui/src/components/file.tsx | 3 | ||||
| -rw-r--r-- | packages/ui/src/components/session-turn.tsx | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/packages/ui/src/components/file.tsx b/packages/ui/src/components/file.tsx index fd902b2e0..633b23b70 100644 --- a/packages/ui/src/components/file.tsx +++ b/packages/ui/src/components/file.tsx @@ -698,6 +698,7 @@ function TextViewer<T>(props: TextFileProps<T>) { if (typeof value === "string") return value if (Array.isArray(value)) return value.join("\n") if (value == null) return "" + // oxlint-disable-next-line no-base-to-string -- file contents cast to unknown, coercion is intentional return String(value) } @@ -712,11 +713,13 @@ function TextViewer<T>(props: TextFileProps<T>) { if (typeof value === "string") return value.length if (Array.isArray(value)) { return value.reduce( + // oxlint-disable-next-line no-base-to-string -- array parts coerced intentionally (sum, part) => sum + (typeof part === "string" ? part.length + 1 : String(part).length + 1), 0, ) } if (value == null) return 0 + // oxlint-disable-next-line no-base-to-string -- file contents cast to unknown, coercion is intentional return String(value).length }) diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index 2e5f9e38b..75279a90e 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -313,6 +313,7 @@ export function SessionTurn( const msg = error()?.data?.message if (typeof msg === "string") return unwrap(msg) if (msg === undefined || msg === null) return "" + // oxlint-disable-next-line no-base-to-string -- msg is unknown from error data, coercion is intentional return unwrap(String(msg)) }) |
