Repository navigation
refactor: modernize JS to pass ESLint - #5
Merged
Merged
Conversation
jjroelofs
commented
Aug 6, 2026
jjroelofs
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed the full diff against the old file; no behavioral changes found. Looks good.
What I verified:
- The destructuring of
settings.rlSorting.views[viewDisplayKey]correctly drops onlyentityIds, which was assigned but never read in the old code. The three properties that are used (experimentId,entityUrlMap,rlEndpointUrl) all survive, and the!experimentId || !rlEndpointUrlguard still runs after it. - Hoisting
storageKeyout of thelinks.forEachloop is correct: it depends only onexperimentId, which is fixed per view, so computing it once is equivalent and the click handlers close over the same value. - Converting
sendBatchedTurnsfrom a hoisted function declaration to aconstarrow is safe here because its only call sites (thesetTimeoutinside the IntersectionObserver callback) execute after the declaration; there is no temporal dead zone hazard. visibleArmsandbatchTimercorrectly stayletsince both are reassigned.
On CI: eslint, drupal-check, changes and emdash-lint are green. The drupal-lint failure is unrelated to this PR; the job dies during setup because composer cannot install phpcompatibility/php-compatibility (it reverts composer.json and exits before any linting runs). That is a CI infrastructure issue that will hit every PR in this repo until the lint action's dependency resolution is fixed.
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.
Summary
js/rl-sorting-tracking.jsto pass ESLint with@antfu/eslint-config(zero errors)vardeclarations toconst/letviewSettingsto pull only the three properties actually used (removes the unusedentityIdsassignment)storageKeyout of thelinks.forEachloop since it depends only onexperimentId, not the individual linksendBatchedTurnsfrom a hoisted function declaration to aconstarrow for consistency with the rest of the fileCloses #4
Test plan
npx eslint .and confirm zero errors