fix: lint
This commit is contained in:
parent
8eec34fd47
commit
6f7ec2e7ac
|
@ -26,6 +26,9 @@ module.exports = {
|
|||
|
||||
// Base config
|
||||
extends: ['eslint:recommended'],
|
||||
rules: {
|
||||
'no-constant-condition': ['error', {checkLoops: false}],
|
||||
},
|
||||
|
||||
overrides: [
|
||||
// Tests
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Arbitrary from '@/ecs/arbitrary.js';
|
||||
import Base from '@/ecs/base.js';
|
||||
import Schema from '@/ecs/schema.js';
|
||||
import gather from '@/util/gather.js';
|
||||
|
||||
|
|
|
@ -75,7 +75,6 @@ export default class Ecs {
|
|||
},
|
||||
next: () => {
|
||||
let result = it.next();
|
||||
let satisfied = false;
|
||||
while (!result.done) {
|
||||
for (const componentName of criteria) {
|
||||
if (!(componentName in result.value[1])) {
|
||||
|
|
|
@ -221,10 +221,11 @@ export default class Engine {
|
|||
entity,
|
||||
payload,
|
||||
] of this.incomingActions) {
|
||||
const {Ecs, Controlled, id, Inventory, Position, Ticking, Wielder} = entity;
|
||||
const {Controlled, Inventory, Ticking, Wielder} = entity;
|
||||
switch (payload.type) {
|
||||
case 'changeSlot': {
|
||||
Wielder.activeSlot = payload.value - 1;
|
||||
break;
|
||||
}
|
||||
case 'moveUp':
|
||||
case 'moveRight':
|
||||
|
|
|
@ -12,5 +12,6 @@ export default function usePacket(type, fn, dependencies) {
|
|||
return () => {
|
||||
client.removePacketListener(type, fn);
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [client, ...dependencies]);
|
||||
}
|
|
@ -24,7 +24,7 @@ export default function Dom({children}) {
|
|||
return () => {
|
||||
window.removeEventListener('resize', onResize);
|
||||
}
|
||||
}, [ref.current]);
|
||||
});
|
||||
return (
|
||||
<div className={styles.dom} ref={ref}>
|
||||
{scale > 0 && (
|
||||
|
|
|
@ -4,8 +4,6 @@ import {useState} from 'react';
|
|||
import {RESOLUTION} from '@/constants.js';
|
||||
import {useEcs} from '@/context/ecs.js';
|
||||
import {useMainEntity} from '@/context/main-entity.js';
|
||||
import Components from '@/ecs-components/index.js';
|
||||
import Systems from '@/ecs-systems/index.js';
|
||||
import usePacket from '@/hooks/use-packet.js';
|
||||
|
||||
import Entities from './entities.jsx';
|
||||
|
|
|
@ -43,7 +43,7 @@ export default function PlaySpecific() {
|
|||
if ('local' !== type) {
|
||||
return;
|
||||
}
|
||||
async function onBeforeUnload(event) {
|
||||
async function onBeforeUnload() {
|
||||
client.disconnect();
|
||||
function waitForSave() {
|
||||
return new Promise((resolve) => setTimeout(resolve, 0));
|
||||
|
|
|
@ -146,4 +146,4 @@ export default class Script {
|
|||
);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import TickingPromise from './ticking-promise.js';
|
|||
|
||||
test('runs executor', async () => {
|
||||
expect(
|
||||
await new TickingPromise((resolve, reject) => {
|
||||
await new TickingPromise((resolve) => {
|
||||
resolve(32);
|
||||
}),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user