style: format code with prettier
Local Build and Deploy / deploy (push) Successful in 49s

This commit is contained in:
openhands committed 2026-07-12 21:07:34 +02:00
1 parent e85e4d74ea
commit 2e4ed76121
378 files changed
+22404 -20686

No files matched your search

+19 -5
View File
@@ -7,8 +7,21 @@ export interface MissingLocalImport {
}
const sourceExtensions = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
const resolutionSuffixes = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".css", "/index.ts", "/index.tsx", "/index.js", "/index.jsx"];
const importPattern = /(?:import|export)\s+(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\(\s*["']([^"']+)["']\s*\)|require\(\s*["']([^"']+)["']\s*\)/g;
const resolutionSuffixes = [
".ts",
".tsx",
".js",
".jsx",
".mjs",
".cjs",
".css",
"/index.ts",
"/index.tsx",
"/index.js",
"/index.jsx",
];
const importPattern =
/(?:import|export)\s+(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\(\s*["']([^"']+)["']\s*\)|require\(\s*["']([^"']+)["']\s*\)/g;
async function collectSourceFiles(directory: string): Promise<string[]> {
const entries = await readdir(directory, { withFileTypes: true });
@@ -49,7 +62,8 @@ export async function findMissingLocalImports(root: string): Promise<MissingLoca
const source = await readFile(importer, "utf8");
for (const match of source.matchAll(importPattern)) {
const specifier = match[1] ?? match[2] ?? match[3];
if (!specifier?.startsWith("@/") && !specifier?.startsWith("./") && !specifier?.startsWith("../")) continue;
if (!specifier?.startsWith("@/") && !specifier?.startsWith("./") && !specifier?.startsWith("../"))
continue;
const base = specifier.startsWith("@/")
? resolve(src, specifier.slice(2))
: resolve(dirname(importer), specifier);
@@ -62,7 +76,7 @@ export async function findMissingLocalImports(root: string): Promise<MissingLoca
}
}
return missing.sort((a, b) =>
a.importer.localeCompare(b.importer) || a.specifier.localeCompare(b.specifier),
return missing.sort(
(a, b) => a.importer.localeCompare(b.importer) || a.specifier.localeCompare(b.specifier),
);
}