fix(lint): give randomness guidance for crypto values - #3659
Conversation
Builds on #1729 in the extracted lint package. Co-authored-by: AGRO-CODEX <brstopo@gmail.com>
miguel-heygen
left a comment
There was a problem hiding this comment.
Reviewed 51e21c7ccd491b2bf776188eae8a1441bb8a944e; no actionable findings.
packages/lint/src/rules/core.ts:481 aligns crypto randomness guidance with Math.random() without changing detection or severity. packages/lint/src/rules/core.test.ts:604 pins seeded-PRNG guidance, rejects the old time-dependent wording, and preserves wall-clock guidance for Date.now().
Traced the rule through the shared lint package and CLI formatter. The successful CI Test job explicitly reports 59 core-rule tests and 548 lint-package tests passing; lint, format, typecheck, build, and CLI smoke also passed. No prior substantive reviews to duplicate. Validation used exact-head source and CI logs; no local dependency installation or test run.
Verdict: APPROVE
Reasoning: The wording fix is narrowly scoped and the semantic regression test protects both randomness and clock guidance without adding unnecessary abstractions.
— Magi
hyperframes lintstill labelscrypto.getRandomValues()as time-dependent code in the current extracted lint package. Give it the same seeded-PRNG guidance asMath.random()while retaining clock-specific guidance forDate.now().Builds on #1729 by @AGRO-CODEX. Validation: 59 core-rule tests pass; the new semantic guidance regression fails on unchanged main. Required lint, format and typecheck hooks pass.