Skip to content

Restore Biome checks for JavaScript sources - #567

Open
snowyukitty wants to merge 5 commits into
NextCommunity:mainfrom
snowyukitty:fix-biome-js-checks
Open

Restore Biome checks for JavaScript sources#567
snowyukitty wants to merge 5 commits into
NextCommunity:mainfrom
snowyukitty:fix-biome-js-checks

Conversation

@snowyukitty

@snowyukitty snowyukitty commented Jul 26, 2026

Copy link
Copy Markdown

Fixes #406.

Summary

  • add src/assets/js/**/*.js back to Biome's configured file set
  • annotate declarations consumed by other classic scripts or inline handlers
    without changing their runtime bindings
  • remove genuinely unused arguments and apply the requested optional-chain
    cleanups without weakening Biome's recommended rules
  • keep the two touched complex functions within DeepSource's configured
    threshold by consolidating layered audio sequences and extracting
    Space Invaders movement and bullet access
  • expose playSound at its definition through the repository's existing
    window.* convention
  • update the pre-commit hook description to match the files it checks

Restoring the JavaScript include exposes 32 warnings that Super-Linter 8.7.0
treats as errors. The targeted suppressions only cover declarations that Biome
cannot see being consumed outside their source file; unrelated unused
declarations remain protected by the rule.

Scope

Biome still reports 20 informational diagnostics: 16 useTemplate
suggestions, two useParseIntRadix suggestions, and two configuration
migration notices. They do not fail --error-on-warnings and are left for
separate style/version work.

This change also leaves the pre-commit warning policy and unpinned local Biome
dependency unchanged. Aligning those with Super-Linter's pinned Biome 2.5.0
should be handled together as a follow-up.

Testing

  • uvx prek run --all-files
  • npm run build
  • Biome 2.5.0 lint, format, and check over configured tracked files with
    --error-on-warnings --no-errors-on-unmatched
  • Biome 2.5.0 lint and format over all 142 tracked files with the same
    Super-Linter flags
  • behavior-trace comparison against the pre-refactor code for 15 audio
    state/type cases and seven Space Invaders update scenarios
  • focused cyclomatic-complexity cross-check at a maximum of five
  • git diff --check origin/main...HEAD
  • DeepSource JavaScript and Secrets checks
  • Socket Project Report and Pull Request Alerts

Manual browser interaction was not run in this environment.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@deepsource-io

deepsource-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in aa10215...f78699a on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jul 26, 2026 11:30p.m. Review ↗
Secrets Jul 26, 2026 11:30p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Comment thread src/assets/js/games/space-invaders.js Outdated
@@ -70,7 +71,7 @@ const SpaceInvaders = (() => {
}

function _onUpdate() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`_onUpdate` has a cyclomatic complexity of 6 with "medium" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

Comment thread src/assets/js/script.js Outdated
@@ -79,7 +80,7 @@ window.addEventListener("keydown", initAudio, { once: true });

function playSound(type) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`playSound` has a cyclomatic complexity of 6 with "medium" risk


A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.

Comment thread src/assets/js/script.js Outdated
osc.stop(now + 1.5);
} else if (type === "secret") {
} else {
playLayeredSound(type, osc, now);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'playLayeredSound' was used before it was defined


It is recommended to use a variable only after it is defined as it might produce errors at runtime.

Comment thread src/assets/js/script.js Outdated

// biome-ignore lint/correctness/noUnusedVariables: Used outside this classic script.
function toggleTheme() {
playSound("click");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'playSound' is not defined


Variables that aren't defined, but accessed may throw reference errors at runtime.

NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Using variables that are injected by scripts included in an HTML file is currently not supported.

Comment thread src/assets/js/script.js Outdated

// biome-ignore lint/correctness/noUnusedVariables: Used outside this classic script.
function scrollToRandomUser() {
playSound("click");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'playSound' is not defined


Variables that aren't defined, but accessed may throw reference errors at runtime.

NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Using variables that are injected by scripts included in an HTML file is currently not supported.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Fix biome lint / check errors in all JS files

1 participant