Set typescript eslint settings to strict

This commit is contained in:
uwap 2026-01-03 02:26:11 +01:00
parent 2375765503
commit 36b21e0260
19 changed files with 320 additions and 291 deletions

View file

@ -1,43 +1,38 @@
export const closestTowerToFill = (pos: RoomPosition): StructureTower | null =>
pos.findClosestByRange(FIND_MY_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_TOWER
&& (structure as StructureTower).store
.getFreeCapacity(RESOURCE_ENERGY) > 0,
&& structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0,
});
export const closestExtensionToFill
= (pos: RoomPosition): StructureExtension | null =>
pos.findClosestByRange(FIND_MY_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_EXTENSION
&& (structure as StructureExtension).store
.getFreeCapacity(RESOURCE_ENERGY) > 0,
&& structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0,
});
export const closestContainerWithEnergy
= (pos: RoomPosition): StructureContainer | null =>
pos.findClosestByRange(FIND_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_CONTAINER
&& (structure as StructureContainer).store
.getUsedCapacity(RESOURCE_ENERGY) > 0,
&& structure.store.getUsedCapacity(RESOURCE_ENERGY) > 0,
});
export const closestContainerToFill
= (pos: RoomPosition): StructureContainer | null =>
pos.findClosestByRange(FIND_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_CONTAINER
&& (structure as StructureContainer).store
.getFreeCapacity(RESOURCE_ENERGY) > 0,
&& structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0,
});
export const closestStorageWithResource
= (pos: RoomPosition, t: ResourceConstant): StructureStorage | null =>
pos.findClosestByRange(FIND_MY_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_STORAGE
&& (structure as StructureStorage).store
.getUsedCapacity(t) > 0,
&& structure.store.getUsedCapacity(t) > 0,
});
export const closestStorageToFill
= (pos: RoomPosition, t: ResourceConstant): StructureStorage | null =>
pos.findClosestByRange(FIND_MY_STRUCTURES, {
filter: structure => structure.structureType === STRUCTURE_STORAGE
&& (structure as StructureStorage).store.getFreeCapacity(t) > 0,
&& structure.store.getFreeCapacity(t) > 0,
});