Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix unused assignments#8836

Merged
DNin01 merged 5 commits intoScratchAddons:masterfrom
DNin01:fix-unused-assignments
Feb 22, 2026
Merged

Fix unused assignments#8836
DNin01 merged 5 commits intoScratchAddons:masterfrom
DNin01:fix-unused-assignments

Conversation

@DNin01
Copy link
Member

@DNin01 DNin01 commented Feb 11, 2026

Problem

The ESLint rule no-useless-assignment recently became recommended and is now checked for in our repository. As a result, some code now creates error messages. These errors happen when a variable is assigned a value that is never read later or is guaranteed to be reassigned before it is read.

You can learn more about this on the ESLint Docs.

Changes

These errors were fixed. In the process, a bug in editor-theme3 where the addon always use the old Blockly reference for FieldNote was fixed. The 10 other changes should have no effect.

Since opening this PR, ESLint was pinned to version 9.x, so this PR explicitly enables the rule that is recommended on v10.

Tests

ESLint checks succeed on the changes.

Webpages tested in Edge 145.

@DNin01 DNin01 requested review from Hans5958 and mxmou February 11, 2026 19:57
@DNin01 DNin01 added scope: meta Related to the meta of the development (repository, store, etc) scope: development Related to developing, documentation, DevEx, etc. labels Feb 11, 2026
@DNin01 DNin01 marked this pull request as ready for review February 11, 2026 19:57
@Samq64
Copy link
Member

Samq64 commented Feb 11, 2026

It might be a good idea to pin the ESLint version to 10.x and update it on our own schedule.

@DNin01 DNin01 mentioned this pull request Feb 17, 2026
@Hans5958 Hans5958 removed their request for review February 18, 2026 15:00
@DNin01 DNin01 added type: bug A bug in the addon loader, or in a specific addon scope: addon Related to one or multiple addons scope: core Related to the core script/extension workings labels Feb 19, 2026
mxmou
mxmou previously approved these changes Feb 19, 2026
@DNin01 DNin01 dismissed mxmou’s stale review February 19, 2026 22:28

Additional revisions made.

@DNin01 DNin01 requested a review from mxmou February 19, 2026 22:28
@DNin01
Copy link
Member Author

DNin01 commented Feb 22, 2026

No opinions on the no-useless-assignment rule yet, but it's recommended by the latest version of ESLint and even helped us fix a bug, so I say, let's give it a try.

@DNin01 DNin01 merged commit 815a672 into ScratchAddons:master Feb 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: addon Related to one or multiple addons scope: core Related to the core script/extension workings scope: development Related to developing, documentation, DevEx, etc. scope: meta Related to the meta of the development (repository, store, etc) type: bug A bug in the addon loader, or in a specific addon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants