ESLint: ~20 empty catch blocks and ~6 loose equality comparisons in assets/js/ #44

Open
opened 2026-08-31 21:29:48 -04:00 by jared · 0 comments
Owner

Severity: Low

eslint over assets/js/ returns 0 errors but 73 warnings, with two notable clusters:

  • ~20 no-empty: silently swallowed catch {} blocks. Worth a pass to at least console.debug/comment why each is intentionally ignored — a couple appear to mask real fetch failures rather than known-benign cases (e.g. Date parsing).
  • ~6 eqeqeq: loose ==/!= instead of ===/!== in dashboard.js/ticket.js (e.g. data.comment_id == x), comparing values of possibly-differing types. Low risk today but an easy source of a future type-coercion bug.

phpcs --standard=.phpcs.xml across the whole tree is clean (0 violations) — this issue is JS-only.

Fix: Sweep the empty catches to add at minimum a comment explaining why the error is safely ignored (or log it), and switch the flagged loose comparisons to strict equality.

**Severity:** Low `eslint` over `assets/js/` returns 0 errors but 73 warnings, with two notable clusters: - **~20 `no-empty`**: silently swallowed `catch {}` blocks. Worth a pass to at least `console.debug`/comment why each is intentionally ignored — a couple appear to mask real fetch failures rather than known-benign cases (e.g. `Date` parsing). - **~6 `eqeqeq`**: loose `==`/`!=` instead of `===`/`!==` in `dashboard.js`/`ticket.js` (e.g. `data.comment_id == x`), comparing values of possibly-differing types. Low risk today but an easy source of a future type-coercion bug. `phpcs --standard=.phpcs.xml` across the whole tree is clean (0 violations) — this issue is JS-only. **Fix:** Sweep the empty catches to add at minimum a comment explaining why the error is safely ignored (or log it), and switch the flagged loose comparisons to strict equality.
jared added the dead-codepriority/low labels 2026-09-08 10:15:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#44