Fix no-base-to-string

This commit is contained in:
Gregory Schier
2026-03-13 07:48:50 -07:00
parent e4103f1a4a
commit be34dfe74a
11 changed files with 14 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
/* oxlint-disable no-base-to-string */
import { DOMParser } from '@xmldom/xmldom';
import type { PluginDefinition } from '@yaakapp/api';
import xpath from 'xpath';

View File

@@ -1,3 +1,4 @@
/* oxlint-disable no-base-to-string */
import type {
Context,
Environment,

View File

@@ -1,3 +1,4 @@
/* oxlint-disable no-base-to-string */
import type {
Context,
Environment,

View File

@@ -1,3 +1,4 @@
/* oxlint-disable no-base-to-string */
import { DOMParser } from '@xmldom/xmldom';
import type { CallTemplateFunctionArgs, Context, PluginDefinition } from '@yaakapp/api';
import xpath from 'xpath';

View File

@@ -103,7 +103,7 @@ function GrpcProtoSelectionDialogWithRequest({ request }: Props & { request: Grp
Found services{' '}
{services?.slice(0, 5).map((s, i) => {
return (
<span key={s.name + s.methods.join(',')}>
<span key={s.name + s.methods.map((m) => m.name).join(',')}>
<InlineCode>{s.name}</InlineCode>
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
</span>
@@ -119,7 +119,7 @@ function GrpcProtoSelectionDialogWithRequest({ request }: Props & { request: Grp
Server reflection found services
{services?.map((s, i) => {
return (
<span key={s.name + s.methods.join(',')}>
<span key={s.name + s.methods.map((m) => m.name).join(',')}>
<InlineCode>{s.name}</InlineCode>
{i === services.length - 1 ? '' : i === services.length - 2 ? ' and ' : ', '}
</span>

View File

@@ -102,7 +102,7 @@ const markdownComponents: Partial<Components> = {
language={match[1]}
style={prismTheme}
>
{String(children).replace(/\n$/, '')}
{String(children as string).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code {...extraProps} ref={ref} className={className}>

View File

@@ -329,7 +329,7 @@ function BaseInput({
</HStack>
{type === 'password' && !disableObscureToggle && (
<IconButton
title={obscured ? `Show ${label}` : `Obscure ${label}`}
title={obscured ? `Show ${typeof label === 'string' ? label : 'field'}` : `Obscure ${typeof label === 'string' ? label : 'field'}`}
size="xs"
className={classNames('mr-0.5 !h-auto my-0.5', disabled && 'opacity-disabled')}
color={tint}

View File

@@ -213,7 +213,7 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
</HStack>
{type === 'password' && !hideObscureToggle && (
<IconButton
title={obscured ? `Show ${label}` : `Obscure ${label}`}
title={obscured ? `Show ${typeof label === 'string' ? label : 'field'}` : `Obscure ${typeof label === 'string' ? label : 'field'}`}
size="xs"
className="mr-0.5 group/obscure !h-auto my-0.5"
iconClassName="group-hover/obscure:text"

View File

@@ -27,7 +27,7 @@ export function HistoryDialog({ log }: Props) {
</TableHead>
<TableBody>
{log.map((l) => (
<TableRow key={l.author + (l.message ?? 'n/a') + l.when}>
<TableRow key={(l.author.name ?? '') + (l.author.email ?? '') + (l.message ?? 'n/a') + l.when}>
<TruncatedWideTableCell>
{l.message || <em className="text-text-subtle">No message</em>}
</TruncatedWideTableCell>

View File

@@ -146,7 +146,7 @@ export const GraphQLDocsExplorer = memo(function GraphQLDocsExplorer({
</div>
) : (
<div
key={activeItem.type.toString()} // Reset scroll position to top
key={activeItem.type.name} // Reset scroll position to top
className="overflow-y-auto h-full w-full p-3 grid grid-cols-[minmax(0,1fr)]"
>
<GqlTypeInfo item={activeItem} setItem={setActiveItem} schema={schema} />
@@ -202,7 +202,7 @@ function GraphQLExplorerHeader({
})}
</div>
<GqlSchemaSearch
key={item?.type.toString()} // Force reset when changing items
key={item?.type.name} // Force reset when changing items
maxHeight={containerHeight}
currentItem={item}
schema={schema}
@@ -798,7 +798,7 @@ function GqlSchemaSearch({
label="search"
hideLabel
defaultValue={value}
placeholder={focused ? `Search ${currentItem?.type.toString() ?? 'Schema'}` : 'Search'}
placeholder={focused ? `Search ${currentItem != null ? currentItem.type.name : 'Schema'}` : 'Search'}
leftSlot={
<div className="w-10 flex justify-center items-center">
<Icon size="sm" icon="search" color="secondary" />

View File

@@ -5,7 +5,7 @@ import type { ReactNode } from 'react';
* https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react
*/
export function getNodeText(node: ReactNode): string {
if (['string', 'number'].includes(typeof node)) {
if (typeof node === 'string' || typeof node === 'number') {
return String(node);
}