From 8275842e78ad9173c48f0ddf9a4c9f03f6ff0d6c Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 1 Aug 2026 17:14:48 +0200 Subject: [PATCH] fix(scripts): resolve noAssignInExpressions lint error in schema generator --- scripts/generate-drizzle-schema.mjs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/generate-drizzle-schema.mjs b/scripts/generate-drizzle-schema.mjs index 62fbeacd..7b078e42 100644 --- a/scripts/generate-drizzle-schema.mjs +++ b/scripts/generate-drizzle-schema.mjs @@ -42,13 +42,15 @@ function parseDrizzleTables(source) { const re2 = /^export const (\w+) = mysqlTable\(\s*"([^"]+)"\s*,\s*\{([\s\S]*?)\n\}(?:,\s*\(t\)\s*=>\s*\[([\s\S]*?)\])?\s*\);/gm; - let match; + let match = re2.exec(source); const seen = new Set(); - while ((match = re2.exec(source)) !== null) { + while (match !== null) { const [, name, table, body, extras] = match; - if (seen.has(name)) continue; - seen.add(name); - models.push(parseTableBody(name, table, body, extras ?? "")); + if (!seen.has(name)) { + seen.add(name); + models.push(parseTableBody(name, table, body, extras ?? "")); + } + match = re2.exec(source); } if (models.length === 0) {