From 747ff72e7edc575e55740a0de19a22e5c324463a Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 15:59:19 -0600 Subject: [PATCH 1/9] Fix ESLint warnings in tw_compress.js --- test/unit/tw_compress.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/unit/tw_compress.js b/test/unit/tw_compress.js index 223a8e8d..d865b47b 100644 --- a/test/unit/tw_compress.js +++ b/test/unit/tw_compress.js @@ -94,28 +94,25 @@ test('handles type INPUT_DIFF_BLOCK_SHADOW (3) compressed inputs', t => { test('all IDs unique', t => { const soup = 'abcdefghjijklmnopqstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'; - for (const [ - variableSoup, - listSoup, - broadcastSoup - ] of [ + const items = [ [soup, '', ''], ['', soup, ''], - ['', '', soup], - ]) { + ['', '', soup] + ]; + for (const [variableSoup, listSoup, broadcastSoup] of items) { const data = { targets: [ { isStage: true, name: 'Stage', variables: Object.fromEntries( - variableSoup.split('').map((id) => [id, [id, 0]]) + variableSoup.split('').map(id => [id, [id, 0]]) ), lists: Object.fromEntries( - listSoup.split('').map((id) => [id, [id, []]]) + listSoup.split('').map(id => [id, [id, []]]) ), broadcasts: Object.fromEntries( - broadcastSoup.split('').map((id) => [id, id]) + broadcastSoup.split('').map(id => [id, id]) ), blocks: { 'CmRa^i]o}QL77;hk:54o': { From 354e9411a5b088af7dc4488d2d11aef3d5b2a8aa Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:00:16 -0600 Subject: [PATCH 2/9] Fix ESLint warning in engine_runtime.js We used to add some more tests to this file, then we moved them to a separate file, which is probably when this newline was introduced --- test/unit/engine_runtime.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unit/engine_runtime.js b/test/unit/engine_runtime.js index e8e67679..f2a696af 100644 --- a/test/unit/engine_runtime.js +++ b/test/unit/engine_runtime.js @@ -273,4 +273,3 @@ test('Clock is reset on runtime dispose', t => { t.ok(c.projectTimer() === 0); t.end(); }); - From 03bca533bad3a17538df9a7cdd2b66fb60012054 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:01:24 -0600 Subject: [PATCH 3/9] Fix ESLint warning in tw-generate-comparison-matrix-inline.js --- test/fixtures/execute/tw-generate-comparison-matrix-inline.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/fixtures/execute/tw-generate-comparison-matrix-inline.js b/test/fixtures/execute/tw-generate-comparison-matrix-inline.js index 14c97551..2b1b25ed 100644 --- a/test/fixtures/execute/tw-generate-comparison-matrix-inline.js +++ b/test/fixtures/execute/tw-generate-comparison-matrix-inline.js @@ -2,6 +2,8 @@ const fs = require('fs'); const Cast = require('../../../src/util/cast'); /* +This is a command-line tool to generate the tw-comparison-matrix-inline test project. + To use output: Blockly.Xml.domToWorkspace( new DOMParser().parseFromString(XML_GOES_HERE, 'text/xml').documentElement, @@ -9,6 +11,8 @@ Blockly.Xml.domToWorkspace( ); */ +/* eslint-disable no-console */ + const VALUES = [ '0', '0.0', From 8995c6a8f28695679ae2fb4fc43301dc43a93ca9 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:07:48 -0600 Subject: [PATCH 4/9] Fix ESLint warning in tw-compress-sb3.js --- src/serialization/tw-compress-sb3.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/serialization/tw-compress-sb3.js b/src/serialization/tw-compress-sb3.js index 83d65e16..63c4aed3 100644 --- a/src/serialization/tw-compress-sb3.js +++ b/src/serialization/tw-compress-sb3.js @@ -30,17 +30,15 @@ class Pool { entries.sort((a, b) => b[1] - a[1]); let i = 0; - let newId; for (const entry of entries) { const oldId = entry[0]; - while (true) { + + let newId = generateId(i); + while (this.skippedIds.has(newId)) { + i++; newId = generateId(i); - if (this.skippedIds.has(newId)) { - i++; - } else { - break; - } } + this.generatedIds.set(oldId, newId); i++; } From fd6f4e6597338bb1a8fd4bc83326dce040f81dbf Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:10:20 -0600 Subject: [PATCH 5/9] Remove unused import from scratch3_looks.js --- src/blocks/scratch3_looks.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blocks/scratch3_looks.js b/src/blocks/scratch3_looks.js index 3903dd1a..36ad5de5 100644 --- a/src/blocks/scratch3_looks.js +++ b/src/blocks/scratch3_looks.js @@ -1,6 +1,5 @@ const Cast = require('../util/cast'); const Clone = require('../util/clone'); -const RenderedTarget = require('../sprites/rendered-target'); const uid = require('../util/uid'); const StageLayering = require('../engine/stage-layering'); const getMonitorIdForBlockWithArgs = require('../util/get-monitor-id'); From 162bc0280a036072008f96626df7a165759c78ff Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:10:30 -0600 Subject: [PATCH 6/9] Remove unused import from scratch3_pen/index.js --- src/extensions/scratch3_pen/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/extensions/scratch3_pen/index.js b/src/extensions/scratch3_pen/index.js index 965a3ed8..47e0a5d4 100644 --- a/src/extensions/scratch3_pen/index.js +++ b/src/extensions/scratch3_pen/index.js @@ -6,7 +6,6 @@ const Clone = require('../../util/clone'); const Color = require('../../util/color'); const formatMessage = require('format-message'); const MathUtil = require('../../util/math-util'); -const RenderedTarget = require('../../sprites/rendered-target'); const log = require('../../util/log'); const StageLayering = require('../../engine/stage-layering'); From aa3edc7be5bba1b90dc65943e01bb5157eab9681 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:10:44 -0600 Subject: [PATCH 7/9] Fix ESLint warning in cli/index.js --- src/cli/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/index.js b/src/cli/index.js index 525f01b5..92541162 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,6 +1,7 @@ const fs = require('fs'); const VirtualMachine = require('../index'); +/* eslint-env node */ /* eslint-disable no-console */ const file = process.argv[2]; From 6044a05139a664332ed83c35392a7c7ef00032f4 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:11:10 -0600 Subject: [PATCH 8/9] Silence ESLint warning in runtime.js --- src/engine/runtime.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 1dd6f11e..5ac87933 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -2495,6 +2495,7 @@ class Runtime extends EventEmitter { this.emit(Runtime.STAGE_SIZE_CHANGED, width, height); } + // eslint-disable-next-line no-unused-vars setInEditor (inEditor) { // no-op } From 23cab6b8cc58c4a074104704c24c6c86959851ff Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 11 Feb 2023 16:11:20 -0600 Subject: [PATCH 9/9] Fix ESLint warning in worker-dispatch.js --- src/dispatch/worker-dispatch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dispatch/worker-dispatch.js b/src/dispatch/worker-dispatch.js index 0cc18b34..f413e6f3 100644 --- a/src/dispatch/worker-dispatch.js +++ b/src/dispatch/worker-dispatch.js @@ -63,7 +63,9 @@ class WorkerDispatch extends SharedDispatch { log.warn(`Worker dispatch replacing existing service provider for ${service}`); } this.services[service] = provider; - return this.waitForConnection.then(() => this._remoteCall(centralDispatchService, 'dispatch', 'setService', service)); + return this.waitForConnection.then(() => ( + this._remoteCall(centralDispatchService, 'dispatch', 'setService', service) + )); } /**