Files
TheLastGarden/src/sim/__test_violation__/date-now-violator.ts
T
josh 2a8d354b58 chore(02-01): eslint sim-purity rule + Date.now violator fixture
- eslint.config.js block 3: no-restricted-syntax bans Date.now() and
  setInterval() inside src/sim/**, with src/sim/scheduler/clock.ts as
  the single allowed wall-clock owner (CONTEXT D-33, RESEARCH Pitfall 1)
- date-now-violator.ts deliberate-violation fixture (excluded from
  default lint by Block 1's top-level ignores; the programmatic ESLint
  test passes ignore: false to override)
- lint-firewall.test.ts gains 2 new cases: positive (rule fires on
  violator) + negative (rule does NOT fire on clock.ts the one exception)
- Existing CORE-10 firewall test left untouched and remains green
2026-05-09 09:20:44 -04:00

15 lines
648 B
TypeScript

// DELIBERATE VIOLATION OF CONTEXT D-33 — DO NOT USE OUTSIDE THE FIREWALL TEST.
//
// This file lives under src/sim/__test_violation__/ and is excluded from
// `npm run lint` via the `ignores` block in eslint.config.js. Its sole
// purpose is to be lint-tested by lint-firewall.test.ts to prove the
// no-restricted-syntax rule (Phase 2 sim-purity) actually fires.
//
// The Vitest test runs ESLint programmatically with `ignore: false`
// against this file and asserts that `no-restricted-syntax` fires with
// the D-33 message.
export function violator(): number {
return Date.now(); // intentional violation — Phase 2 Plan 02-01 Task 3
}