Skip to content

feat: enable type-aware no-base-to-string rule, fix 56 violations#22750

Merged
kitlangton merged 1 commit intodevfrom
kit/oxlint-base-to-string
Apr 16, 2026
Merged

feat: enable type-aware no-base-to-string rule, fix 56 violations#22750
kitlangton merged 1 commit intodevfrom
kit/oxlint-base-to-string

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Add oxlint-tsgolint and enable no-base-to-string rule
  • Fix 56 violations where objects were coerced to strings without meaningful toString()

Fix patterns

Pattern Count Fix
form.get("x")?.toString() in console routes 30 form.get("x") as string | null (text inputs always return strings)
${error} on unknown types 6 error instanceof Error ? error.message : String(error)
String(unknown) on log/error values 8 Inline suppress — intentional coercion
request.toString() on Request 1 typeof request === "string" ? request : request.url
part.image.toString() on DataContent 2 String(part.image)
Misc number/unknown coercions 9 Explicit String() or type narrowing

Add oxlint-tsgolint and enable no-base-to-string to catch objects
being coerced to strings without a meaningful toString(). Fix 56
violations: convert form.get()?.toString() to typed casts, add
explicit String() coercions, use error.message instead of string
interpolation, and suppress intentional unknown-to-string coercions.
@kitlangton kitlangton force-pushed the kit/oxlint-base-to-string branch from a12a1a2 to fe38816 Compare April 16, 2026 03:43
@kitlangton kitlangton merged commit 8aa0f9f into dev Apr 16, 2026
11 checks passed
@kitlangton kitlangton deleted the kit/oxlint-base-to-string branch April 16, 2026 03:50
jerome-benoit pushed a commit to jerome-benoit/opencode that referenced this pull request Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant