From e214cc2b7b016874b1c91f685be78ada60b74fde Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sun, 27 Sep 2026 07:01:17 +0000 Subject: [PATCH] LOC-ENUS counts the named constant, so folding the literal is not mistaken for fixing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folding eight en-US call sites onto library/utils/formatCount.js took the matrix from 13 warns to 3, and that looked like progress. It was not: the rule matches a LITERAL 'en-US', the helper calls toLocaleString(COUNT_LOCALE), so my eight sites went INVISIBLE while the behaviour was untouched — the same false-green as a precondition that skips the file under test. The audit had stopped seeing a decision that is still in force. The rule now also matches the constant's DEFINITION. One site, attributed to every bundle that imports it, which is what "held in one place" should read as: 5 warns — library/utils/formatCount.js:26 against research-dashboard and people-groups-grid RegionCountryMap.vue:394 regions' held Driver decision pplr-coverage.vue:128, pplr-pins.vue:60 regions' catch-fallback discrimination is untouched and its self-test stays green (rc=0). Gate only, no product code, no rebuild. --- internal/check-universal-props.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/check-universal-props.mjs b/internal/check-universal-props.mjs index 681dfb720..9a19779f1 100644 --- a/internal/check-universal-props.mjs +++ b/internal/check-universal-props.mjs @@ -106,6 +106,15 @@ const RULES = [ && /(?:toLocaleString|NumberFormat|DateTimeFormat)\s*\(\s*`[^`]*\$\{/.test(before) if (!isFallback) out.push(m.index) } + // ★ THE NAMED CONSTANT COUNTS TOO, or folding the literal into one module LOOKS like fixing it. + // library/utils/formatCount.js now holds the fleet's en-US decision and calls + // toLocaleString(COUNT_LOCALE) — no literal — so the pattern above went quiet and 8 of the + // tree's 13 warns vanished with the BEHAVIOUR unchanged. That is the same false-green as a + // precondition that skips the file under test: the audit stopped seeing a decision still in + // force. One site, attributed to every bundle that imports it, is what "held in one place" + // should read as in the matrix — not zero. + const constRe = /COUNT_LOCALE\s*=\s*['"]en(?:-US)?['"]/g + while ((m = constRe.exec(src))) out.push(m.index) return out } }, // A whole-file rule: the fetch and the helper need not be on the same line, only in the same file.