Skip to content

fix: resolve implicit global variables in github-queries.js#816

Open
praaatap wants to merge 1 commit intoprecice:masterfrom
praaatap:fix/github-queries-globals
Open

fix: resolve implicit global variables in github-queries.js#816
praaatap wants to merge 1 commit intoprecice:masterfrom
praaatap:fix/github-queries-globals

Conversation

@praaatap
Copy link
Contributor

Description

This PR fixes a few places where variables were being assigned without an explicit declaration (let, const, or var) in [js/github-queries.js]

  • Pollution of the global namespace.
  • Conflict with other scripts.
  • Difficult-to-debug side effects.

I have refactored these places to use const because these variables are not being reassigned in their scopes.

Changes

  • Declared date inside the function.
  • Declared [tag]
  • Declared count inside the stargazers-fetching closure.

Verification

  • Verified by reviewing the script logic.
  • Verified locally to ensure GitHub stats are still being fetched and displayed correctly.

@MakisH MakisH added GSoC Contributed in the context of the Google Summer of Code technical Technical issues on the website labels Feb 26, 2026
url = data[0].html_url
const tag = data[0].name;
const published_at = data[0].published_at;
const url = data[0].html_url
Copy link
Contributor

@hanzalahwaheed hanzalahwaheed Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semicolon missing here. I noticed rest of the file uses semicolons at the end. lets follow a common syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya thanks for help @hanzalahwaheed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code technical Technical issues on the website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants