Skip to content

Commit 920287e

Browse files
committed
fix(lint): address explicit-any, unused-vars, and exhaustive-deps
1 parent 38d8124 commit 920287e

File tree

14 files changed

+287
-349
lines changed

14 files changed

+287
-349
lines changed

app/api/generate-schema-doc/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import * as JsonSchemaStaticDocsLib from "json-schema-static-docs"; // Use names
44
import fs from "fs/promises";
55
import path from "path";
66
import os from "os";
7-
import { createRequire } from "module"; // Import createRequire
7+
// import { DocGenerator } from "json-schema-static-docs"; // Removed
88

99
// Helper to resolve package paths
10-
const require = createRequire(import.meta.url);
10+
// const require = createRequire(import.meta.url);
1111

1212
// Recursive copy function (fs.cp might not be available everywhere or handle nested dirs reliably)
1313
async function copyDirRecursive(src: string, dest: string) {
1414
await fs.mkdir(dest, { recursive: true });
1515
const entries = await fs.readdir(src, { withFileTypes: true });
16-
for (let entry of entries) {
16+
for (const entry of entries) {
1717
const srcPath = path.join(src, entry.name);
1818
const destPath = path.join(dest, entry.name);
1919
if (entry.isDirectory()) {
@@ -25,7 +25,7 @@ async function copyDirRecursive(src: string, dest: string) {
2525
}
2626

2727
// Helper to create a temporary file
28-
async function writeTempSchemaFile(schema: any): Promise<string> {
28+
async function writeTempSchemaFile(schema: Record<string, unknown>): Promise<string> {
2929
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "schema-"));
3030
const tempFilePath = path.join(tempDir, "schema.json");
3131
await fs.writeFile(tempFilePath, JSON.stringify(schema, null, 2));

app/api/schemas/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NextResponse } from "next/server";
2-
import fs from "fs";
2+
import fs from "fs/promises";
33
import path from "path";
44

5-
export async function GET() {
5+
export function GET() {
66
try {
77
const schemasDir = path.join(process.cwd(), "schemas", "v1");
88
const files = fs.readdirSync(schemasDir).filter((f) => f.endsWith(".json"));

0 commit comments

Comments
 (0)