Page MenuHomePhabricator

[QS-GUI] 🚧 Make legacy code more readable / understandable
Closed, ResolvedPublic

Description

As part of T431803 we not only started modernizing the codebase to use modules (ES6). We also increased the JSHint "esversion" to 9 and had to disable a few rules the same time. We believe this is an opportunity to (mostly automatically) upgrade the codebase to modern syntax.

  • Replace ambiguous var with const where possible, otherwise let. These communicate the intention behind a var much better and make the code easier to understand.
  • Replace function () with the () => arrow syntax, where appropriate. This notably avoids confusions about the this context and allows us to remove self = this workarounds.

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Re-enable ESLint rules with no violationsrepos/wmde/wikidata-query-gui!68thiemowmdeesLintOnmain
Remove bogus, outdated SPARQL endpointrepos/wmde/wikidata-query-gui!67thiemowmdeoutdatedEndpointmain
Enable no-var eslint rulerepos/wmde/wikidata-query-gui!65thiemowmdenoVarmain
Replace some let with const where possiblerepos/wmde/wikidata-query-gui!64thiemowmdeconstsSourcemain
Replace all var with const/let in test coderepos/wmde/wikidata-query-gui!61thiemowmdeconstsTestsmain
Replace some forEach calls with native for-of loopsrepos/wmde/wikidata-query-gui!58thiemowmdeforEachmain
Customize query in GitLab

Event Timeline

ArthurTaylor renamed this task from [QS-GUI] Make legacy code more readable / understandable to [QS-GUI] 🚧 Make legacy code more readable / understandable.Jul 15 2026, 11:02 AM
ArthurTaylor moved this task from Incoming to The Board on the Wikidata-Omega board.
ArthurTaylor edited projects, added: Wikidata-Omega (The Board); removed: Wikidata-Omega.

Change #1311027 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[operations/deployment-charts@master] wikidata-query-gui: Bump query-gui image version

https://gerrit.wikimedia.org/r/1311027

Change #1311027 merged by jenkins-bot:

[operations/deployment-charts@master] wikidata-query-gui: Bump query-gui image version

https://gerrit.wikimedia.org/r/1311027