fix: lint

This commit is contained in:
cha0s 2024-06-23 07:35:56 -05:00
parent 8eec34fd47
commit 6f7ec2e7ac
10 changed files with 10 additions and 9 deletions

View File

@ -26,6 +26,9 @@ module.exports = {
// Base config
extends: ['eslint:recommended'],
rules: {
'no-constant-condition': ['error', {checkLoops: false}],
},
overrides: [
// Tests

View File

@ -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';

View File

@ -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])) {

View File

@ -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':

View File

@ -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]);
}

View File

@ -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 && (

View File

@ -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';

View File

@ -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));

View File

@ -146,4 +146,4 @@ export default class Script {
);
}
};
}

View File

@ -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);
}),
)