Skip to content

Commit 679e429

Browse files
chore(importer): fix lint errors flagged by CI
- cutover-dry-run.ts: drop the redundant `= 0` assignment that the try/catch immediately overrides (no-useless-assignment) - importer.ts: convert `(_msg: string) => {}` to `(): void => {}` (no-unused-vars); add `cause` to the error rethrown from `ensureGitRepo` (preserve-caught-error) - tests/import-laddr.test.ts: drop unused RawPersonSchema / RawProjectSchema imports; rename `_` loop variable to `_row` with an explicit eslint-disable so the no-unused-vars rule is silenced Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e7e57d0 commit 679e429

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

apps/api/scripts/cutover-dry-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export async function runDryRun(opts: DryRunOptions): Promise<DryRunReport> {
213213
// but flag them in the report so they're visible.
214214
const countDiffs: CountDiff[] = [];
215215
for (const { path, sheet } of ENDPOINT_TO_SHEET) {
216-
let sourceTotal = 0;
216+
let sourceTotal: number;
217217
try {
218218
sourceTotal = await fetchTotal(path, {
219219
host: opts.sourceHost,

apps/api/scripts/import-laddr/importer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export async function importLaddrFromJson(opts: ImportOptions): Promise<ImportRe
159159
const runAt = opts.now ?? new Date().toISOString();
160160
const branch = opts.branch ?? 'legacy-import';
161161
const initialParent = opts.initialParent ?? 'origin/empty';
162-
const log = opts.verbose ? (msg: string) => console.log(msg) : (_msg: string) => {};
162+
const log = opts.verbose ? (msg: string) => console.log(msg) : (): void => {};
163163

164164
const warningsList: string[] = [];
165165
const warnings: Warnings = {
@@ -646,6 +646,7 @@ async function ensureGitRepo(repo: string): Promise<void> {
646646
} catch (err) {
647647
throw new Error(
648648
`[import-laddr] ${repo} is not a git working directory: ${describe(err)}`,
649+
{ cause: err },
649650
);
650651
}
651652
}

apps/api/tests/import-laddr.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import { describe, expect, it } from 'vitest';
1717
import { importLaddrFromJson } from '../scripts/import-laddr/importer.js';
1818
import {
1919
fetchAllPages,
20-
RawPersonSchema,
21-
RawProjectSchema,
2220
RawTagSchema,
2321
type RawPerson,
2422
type RawProject,
@@ -168,7 +166,8 @@ describe('fetchAllPages', () => {
168166
{ host: 'example.test', pageSize: 2, delayMs: 0, fetchImpl: makeFetch(routes) },
169167
);
170168
await expect((async () => {
171-
for await (const _ of it_) {
169+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
170+
for await (const _row of it_) {
172171
// intentionally empty
173172
}
174173
})()).rejects.toThrow();

0 commit comments

Comments
 (0)