Repository navigation
ci(lint): declare getNodeFreshness as a readonly browser global - #62
Merged
Merged
Conversation
roles.js defines window.getNodeFreshness at load time and index.html loads it before nodes.js and live.js, which call it as a bare global. ESLint's no-undef flagged both calls because the global was missing from .eslintrc.json, failing the frontend lint step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "🧹 Frontend lint (eslint no-undef)" CI step (
npx eslint public/*.js, eslint 8.57.1) fails on mastere17377d8with two errors:They were introduced with relay-aware node staleness (
06cd0b73,6edb1820, 2026-08-06) but stayed hidden because the CI job always stopped at an earlier step; the first run to reach lint was the CI integration draft #61.Cause: missing lint declaration, not a runtime error
public/roles.js:528assignswindow.getNodeFreshness = function (…)directly in the file's top-level IIFE (not in a callback), so it exists as soon asroles.jshas executed. Loadingroles.jsalone in a VM confirms it is a function immediately after load.public/index.htmlloadsroles.jssynchronously first (line 177), beforenodes.js(216) andlive.js(224); none of them usedefer/async/type="module", andindex.htmlis the only page loadinglive.js/nodes.js.window.getNodeFreshness ? getNodeFreshness(…) : null.ESLint only reports it because the bare call
getNodeFreshness(…)refers to a browser global that is not listed in.eslintrc.json, unlike the neighbouringgetNodeStatus/getHealthThresholdshelpers.Change
.eslintrc.jsononly (+1): add"getNodeFreshness": "readonly"toglobals, alphabetically betweengetHealthThresholdsandgetNodeStatus, following the file's existing convention. No change tono-undefor any other rule, workflows, or runtime code.Verification (local, eslint 8.57.1 — the version the CI step installed — in an isolated scratch directory, workflow command
eslint public/*.js)✖ 91 problems (2 errors, 89 warnings)— identical to CI, including the two errors above.✖ 89 problems (0 errors, 89 warnings); the 89 warning lines are identical to baseline (pre-existingno-unused-varswarnings, not addressed here).live.jscall togetNodeFreshnessTypofails again with'getNodeFreshnessTypo' is not defined (no-undef), so real undefined references are still caught..eslintrc.jsonparses as JSON;git diff --checkclean.Relation to other PRs
Independent of #56, #59 and #60. It is being added to the CI integration draft #61 ("CI integration only — do not merge") so the combined run can get past the lint step. GitHub CI for this PR on its own will still stop earlier (the Kpa-clawbot#1648 M4 scan is fixed by #56) and may hit the known flaky ingestor watchdog test.
🤖 Generated with Claude Code