Finish repo-wide strict equality sweep and enable eqeqeq #517

Open
opened 2026-09-03 12:05:54 +01:00 by Smithy-bot · 1 comment
Member

Parent: #487 (2026 Code Clean Up). Spun out of the review note on PR #515.

Why

PR #515 only converted the comparisons in the five files named by the #487 checklist (InventoryHelper, GetUnclaimedCardsHelper, stats, GetCardsHelper, sacrifice) — 20 ==/!= sites.

At the time of that PR there were still about 73 loose comparisons across 37 files. eqeqeq was not enabled in ESLint, because turning it on fails lint on every unswept file; it has to land with (or after) the final sweep.

This is mechanical and is much faster with a local yarn lint:fix than through the bot's one-file-at-a-time API.

Suggested approach

  1. Merge or rebase on top of #515 if it is not already on release/0.12.0.
  2. Enable eqeqeq in eslint.config.mjs (error).
  3. Run yarn lint:fix (or equivalent) and clear every remaining ==/!= the rule reports.
  4. Pay attention to intentional null checks — prefer == null only where you truly want both null and undefined, or rewrite to explicit checks; do not leave bare ==.
  5. Run yarn build, yarn lint, yarn test.
  6. Especially re-test paths that compare card fields, quantities, and timer IDs. If card metadata validation (#516) is not done yet, exercise /drop, /inventory, and /stats against real cards before release.

Acceptance criteria

  • No remaining == / != in src/ / tests/ except any explicitly justified, lint-disabled sites.
  • eqeqeq is enabled and yarn lint is clean.
  • yarn build and yarn test are clean.
  • Brief note in the PR if any comparison was intentionally left as loose (with a disable comment).
  • PR #515 — partial sweep of the checklist files
  • Sibling #516 — validate card metadata types at parse time (prefer before relying on === against real card JSON)
  • Parent #487

Note on eslint config globs

Separately, eslint.config.mjs currently scopes a rules block to files: ["./src", "./tests"], which matches no files, so several style rules are inert. That is a different fix; do not conflate it with enabling eqeqeq unless you are already touching that config.

Parent: #487 (2026 Code Clean Up). Spun out of the review note on PR #515. ## Why PR #515 only converted the comparisons in the five files named by the #487 checklist (`InventoryHelper`, `GetUnclaimedCardsHelper`, `stats`, `GetCardsHelper`, `sacrifice`) — **20** `==`/`!=` sites. At the time of that PR there were still about **73** loose comparisons across **37** files. `eqeqeq` was **not** enabled in ESLint, because turning it on fails lint on every unswept file; it has to land with (or after) the final sweep. This is mechanical and is much faster with a local `yarn lint:fix` than through the bot's one-file-at-a-time API. ## Suggested approach 1. Merge or rebase on top of #515 if it is not already on `release/0.12.0`. 2. Enable `eqeqeq` in `eslint.config.mjs` (error). 3. Run `yarn lint:fix` (or equivalent) and clear every remaining `==`/`!=` the rule reports. 4. Pay attention to intentional null checks — prefer `== null` only where you truly want both `null` and `undefined`, or rewrite to explicit checks; do not leave bare `==`. 5. Run `yarn build`, `yarn lint`, `yarn test`. 6. Especially re-test paths that compare card fields, quantities, and timer IDs. If card metadata validation (#516) is not done yet, exercise `/drop`, `/inventory`, and `/stats` against real cards before release. ## Acceptance criteria - [ ] No remaining `==` / `!=` in `src/` / `tests/` except any explicitly justified, lint-disabled sites. - [ ] `eqeqeq` is enabled and `yarn lint` is clean. - [ ] `yarn build` and `yarn test` are clean. - [ ] Brief note in the PR if any comparison was intentionally left as loose (with a disable comment). ## Related - PR #515 — partial sweep of the checklist files - Sibling #516 — validate card metadata types at parse time (prefer before relying on `===` against real card JSON) - Parent #487 ## Note on eslint config globs Separately, `eslint.config.mjs` currently scopes a `rules` block to `files: ["./src", "./tests"]`, which matches **no** files, so several style rules are inert. That is a different fix; do not conflate it with enabling `eqeqeq` unless you are already touching that config.
Smithy-bot added this to the 0.12.0 milestone 2026-09-03 12:05:54 +01:00
Owner

Blocked until #516 is done

Blocked until #516 is done
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
External/card-drop#517
No description provided.