Skip to content

Commit bf5cd45

Browse files
authored
Fix lint errors (iway1#46)
1 parent 1bc7038 commit bf5cd45

File tree

14 files changed

+25
-22
lines changed

14 files changed

+25
-22
lines changed

biome.jsonc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
"useExhaustiveDependencies": "warn"
2525
},
2626
"suspicious": {
27-
"noExplicitAny": "warn"
27+
"noExplicitAny": "warn",
28+
"noDuplicateFontNames": "off"
29+
},
30+
"style": {
31+
"noNonNullAssertion": "warn"
2832
},
2933
"recommended": true
3034
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"cpy:readme": "cp README.MD packages/trpc-ui/README.md",
1313
"start:test-app": "node ./packages/test-app/lib/server.ts",
1414
"biome:check": "biome check --max-diagnostics=none",
15+
"biome:check:errors": "biome check --max-diagnostics=none --diagnostic-level=error",
1516
"biome:check:changed": "biome check --changed --max-diagnostics=none",
1617
"biome:check:fix": "biome check --write --unsafe --max-diagnostics=none"
1718
},

packages/trpc-ui/src/parse/routerType.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const ProcedureSchema = z.object({
8686

8787
export type Procedure = z.infer<typeof ProcedureSchema>;
8888

89+
// biome-ignore lint/complexity/noBannedTypes: <explanation>
8990
export function isProcedure(obj: unknown | Function): obj is Procedure {
9091
if (typeof obj !== "function" || !("_def" in obj)) return false;
9192
return ProcedureDefSchema.safeParse((obj as any)._def).success;

packages/trpc-ui/src/react-app/components/CollapsableSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export function CollapsableSection({
7272
>
7373
{collapsable ? (
7474
<button
75+
type="button"
7576
onClick={() => {
7677
collapsables.toggle(fullPath);
7778
setPath(fullPath.join("."));

packages/trpc-ui/src/react-app/components/HeadersPopup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function HeadersPopup() {
9494
</div>
9595
<div className="flex flex-col space-y-2 px-4 py-2">
9696
{headers.map(([headerKey, headerValue], i) => (
97-
<div className="flex flex-col" key={`${i}`}>
97+
<div className="flex flex-col" key={`${headerKey}, ${headerValue}`}>
9898
<div className="flex flex-row items-start">
9999
<BaseTextField
100100
className="flex-1"

packages/trpc-ui/src/react-app/components/LogoSvg.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export function LogoSvg({ className }: { className?: string }) {
1313
enableBackground="new 0 0 512 512"
1414
className={className}
1515
>
16+
<title>trpc-ui logo</title>
1617
<path
1718
fill="#282829"
1819
opacity="1.000000"

packages/trpc-ui/src/react-app/components/SideNav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function SideNavItem({
4747
<>
4848
{path.length > 0 && (
4949
<button
50+
type="button"
5051
className={`flex w-full flex-row items-center justify-between font-bold ${
5152
shown ? "" : "opacity-70"
5253
}`}

packages/trpc-ui/src/react-app/components/contexts/AllPathsContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function flatten(
1818
if (node.nodeType === "router") {
1919
const o = Object.values(node.children)
2020
.map(flatten)
21+
// biome-ignore lint/performance/noAccumulatingSpread: <idk what this code is even doing>
2122
.reduce((a, b) => [...a, ...b]);
2223
return [...r, ...o, [node.path.join("."), colorSchemeType]];
2324
}

packages/trpc-ui/src/react-app/components/form/ProcedureForm/Error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FormSection } from "./FormSection";
44
import { StackTrace } from "./StackTrace";
55
import type { TRPCErrorType } from "./index";
66

7-
export function Error({ error }: { error: TRPCErrorType }) {
7+
export function ErrorDisplay({ error }: { error: TRPCErrorType }) {
88
const json = error.meta.responseJSON[0]?.error.json ?? ({} as any);
99
const msg = json.message;
1010
const code = json.code;

packages/trpc-ui/src/react-app/components/form/ProcedureForm/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import getSize from "string-byte-length";
1919
import SuperJson from "superjson";
2020
import { z } from "zod";
2121
import JSONEditor from "../JSONEditor";
22-
import { Error as ErrorComponent } from "./Error";
22+
import { ErrorDisplay as ErrorComponent } from "./Error";
2323
import { FormSection } from "./FormSection";
2424
import { ProcedureFormButton } from "./ProcedureFormButton";
2525
import { Response } from "./Response";
@@ -161,7 +161,7 @@ export function ProcedureForm({
161161
);
162162
setShouldReset(false);
163163
}
164-
}, [shouldReset]);
164+
}, [shouldReset, setShouldReset, resetForm, defaultFormValuesForNode]);
165165
function reset() {
166166
setShouldReset(true);
167167
setQueryEnabled(false);

0 commit comments

Comments
 (0)