mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 03:56:15 -08:00
`nx lint electron-backend` ran `eslint apps/electron-backend/**/*.ts`
unquoted. Nx executes commands through /bin/sh, which has no `globstar`, so
`**` collapsed to `*` and the shell expanded the pattern itself — matching a
single file out of 247. Quoting hands the pattern to eslint, which expands it
recursively. Two sibling patterns were already quoted, so the breakage had
been worked around per-file rather than fixed; they are now redundant
(verified: the quoted glob alone resolves to the identical 247-file set,
including all 24 frame-copy-runtime files) and collapse into one.
That exposed five real errors the broken glob had been hiding:
- `no-unsafe-finally` x2 — `closeSession` and `disposeSession` both did
`try { ... } finally { return ...; }`. A `return` inside `finally`
discards an in-flight exception, so a failing close/dispose was
indistinguishable from a clean one. Both intentionally always complete
teardown (`shutdown()` disposes every session in turn and must not stop at
the first failure), so the fix keeps that guarantee via an explicit `catch`
and logs the reason instead of dropping it.
- `prefer-const` x2 — a write-once `timeoutId` and module-level `Database`.
The other `timeoutId` in the same file is genuinely reassigned and stays
`let`.
- `no-control-regex` — the filename sanitizer strips control characters on
purpose; disabled inline with that rationale.
The three `max-lines` violations this would also have surfaced are already
gone: #1288 split those specs.
Regression coverage for both teardown paths, each verified to fail against
the old code.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>