Merge pull request #118 from TurboWarp/fix-eslint-warnings

Fix some ESLint warnings
This commit is contained in:
GarboMuffin authored and GitHub committed 2023-02-11 18:27:49 -06:00
commit 703ee8fa35
9 files changed
+21 -21

No files matched your search

-1
View File
@@ -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');
+1
View File
@@ -1,6 +1,7 @@
const fs = require('fs');
const VirtualMachine = require('../index');
/* eslint-env node */
/* eslint-disable no-console */
const file = process.argv[2];
+3 -1
View File
@@ -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)
));
}
/**
+1
View File
@@ -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
}
-1
View File
@@ -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');
+5 -7
View File
@@ -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++;
}
@@ -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',
-1
View File
@@ -273,4 +273,3 @@ test('Clock is reset on runtime dispose', t => {
t.ok(c.projectTimer() === 0);
t.end();
});
+7 -10
View File
@@ -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': {