Add formatting/linting CI (#18)

This commit is contained in:
sepro
2025-10-23 21:24:31 +02:00
committed by GitHub
parent 52a4f9d19a
commit b57ce18965
12 changed files with 153 additions and 44 deletions

View File

@@ -25,7 +25,9 @@ export function matchesStructure<T extends ESTree.Node>(
if ("anykey" in structure && Array.isArray(structure.anykey)) {
// Handle `{ anykey: [a, b] }`
const haystack = Array.isArray(obj) ? obj : Object.values(obj);
return structure.anykey.every(value => haystack.some((el) => matchesStructure(el, value)));
return structure.anykey.every((value) =>
haystack.some((el) => matchesStructure(el, value)),
);
}
for (const [key, value] of Object.entries(structure)) {
if (!matchesStructure(obj[key as keyof typeof obj], value)) {

View File

@@ -24,6 +24,7 @@ export async function getIO(): Promise<IO> {
async function _getIO(): Promise<IO> {
// Old Deno requires casting to any as globalThis lacks an index signature
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((globalThis as any).process?.release?.name === "node") {
// Assume node compatibility
const { access, readFile } = await import("node:fs/promises");