aboutsummaryrefslogtreecommitdiff
path: root/utils/assert/assert.ts
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-04-22 06:22:14 +0530
committerBobby <[email protected]>2026-04-22 06:31:59 +0530
commit8732fd527e32e77c9f6994d27eecd99b9b31afc5 (patch)
tree2cd0c5f67287a2dfcd6e980173864b19542c0aa9 /utils/assert/assert.ts
parent762bdbbee5d21a8785b3b9d5ab766faf6a8bfcb9 (diff)
downloadhollowdark-8732fd527e32e77c9f6994d27eecd99b9b31afc5.tar.xz
hollowdark-8732fd527e32e77c9f6994d27eecd99b9b31afc5.zip
Forbid Math.random in gameplay code via ESLint
Determinism is load-bearing in Hollowdark (ARCHITECTURE.md §26). Same seed plus same choices must produce bit-identical outcomes — otherwise bug reproduction, lazy NPC backfill, and save integrity all break. Every random call has to route through the seeded PRNG in rng/. Three restricted-syntax rules, scoped to gameplay directories via an explicit files glob: - Math.random() — forbidden - crypto.getRandomValues() — forbidden for gameplay - Date.now() — forbidden; use GameTime from time/ Each rule carries a specific error message pointing at the architectural rationale. The restrictions lift inside tests/, scripts/, and *.{test,spec}.ts where non-deterministic helpers are fine. @typescript-eslint/no-explicit-any set to error across the board.
Diffstat (limited to 'utils/assert/assert.ts')
0 files changed, 0 insertions, 0 deletions