diff --git a/biome.jsonc b/biome.jsonc index 637eb2daafd..6d3ad9240b4 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -136,7 +136,7 @@ "useJsonImportAttribute": "error", "useIndexOf": "warn", "useObjectSpread": "info", - "useNumericSeparators": "info", + "useNumericSeparators": "off", // TODO: enable? "useIterableCallbackReturn": "warn", "useSingleJsDocAsterisk": "warn", "noShadow": "warn" diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 13d6ddbb687..784c3ce8334 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -468,7 +468,7 @@ export default class BattleScene extends SceneBase { true, ); - //@ts-ignore (the defined types in the package are incromplete...) + //@ts-expect-error (the defined types in the package are incromplete...) transition.transit({ mode: "blinds", ease: "Cubic.easeInOut", @@ -1167,7 +1167,7 @@ export default class BattleScene extends SceneBase { this.field.remove(this.currentBattle.mysteryEncounter?.introVisuals, true); } - //@ts-ignore - allowing `null` for currentBattle causes a lot of trouble + //@ts-expect-error - allowing `null` for currentBattle causes a lot of trouble this.currentBattle = null; // TODO: resolve ts-ignore // Reset RNG after end of game or save & quit. diff --git a/src/battle.ts b/src/battle.ts index 245705f4801..45373402e12 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -178,7 +178,7 @@ export default class Battle { ) .map(i => { const ret = i as PokemonHeldItemModifier; - //@ts-ignore - this is awful to fix/change + //@ts-expect-error - this is awful to fix/change ret.pokemonId = null; return ret; }), diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 4af16f1ef54..bed17fb0ebc 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -359,15 +359,11 @@ class AnimTimedUpdateBgEvent extends AnimTimedBgEvent { tweenProps["alpha"] = (this.opacity || 0) / 255; } if (Object.keys(tweenProps).length) { - globalScene.tweens.add( - Object.assign( - { - targets: moveAnim.bgSprite, - duration: getFrameMs(this.duration * 3), - }, - tweenProps, - ), - ); + globalScene.tweens.add({ + targets: moveAnim.bgSprite, + duration: getFrameMs(this.duration * 3), + ...tweenProps, + }); } return this.duration * 2; } @@ -1641,12 +1637,12 @@ export async function populateAnims() { let props: string[]; for (let p = 0; p < propSets.length; p++) { props = propSets[p]; - // @ts-ignore TODO + // @ts-expect-error TODO const ai = props.indexOf(a.key); if (ai === -1) { continue; } - // @ts-ignore TODO + // @ts-expect-error TODO const bi = props.indexOf(b.key); return ai < bi ? -1 : ai > bi ? 1 : 0; diff --git a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts index 9bdaa603540..818318bb499 100644 --- a/src/data/mystery-encounters/encounters/clowning-around-encounter.ts +++ b/src/data/mystery-encounters/encounters/clowning-around-encounter.ts @@ -135,7 +135,7 @@ export const ClowningAroundEncounter: MysteryEncounter = MysteryEncounterBuilder ); clownConfig.setPartyTemplates(clownPartyTemplate); clownConfig.setDoubleOnly(); - // @ts-ignore + // @ts-expect-error clownConfig.partyTemplateFunc = null; // Overrides party template func if it exists // Generate random ability for Blacephalon from pool diff --git a/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts b/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts index 010358ea3b2..ae3d905cf91 100644 --- a/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts +++ b/src/data/mystery-encounters/encounters/mysterious-challengers-encounter.ts @@ -92,7 +92,7 @@ export const MysteriousChallengersEncounter: MysteryEncounter = MysteryEncounter const brutalConfig = trainerConfigs[brutalTrainerType].clone(); brutalConfig.title = trainerConfigs[brutalTrainerType].title; brutalConfig.setPartyTemplates(e4Template); - // @ts-ignore + // @ts-expect-error brutalConfig.partyTemplateFunc = null; // Overrides gym leader party template func female = false; if (brutalConfig.hasGenders) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d918ca2b2f1..2e47c9e8de4 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4373,9 +4373,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { scene.time.delayedCall(fixedInt(Math.ceil(duration * 0.4)), () => { try { SoundFade.fadeOut(scene, cry, fixedInt(Math.ceil(duration * 0.2))); - fusionCry = this.getFusionSpeciesForm(undefined, true).cry( - Object.assign({ seek: Math.max(fusionCry.totalDuration * 0.4, 0) }, soundConfig), - ); + fusionCry = this.getFusionSpeciesForm(undefined, true).cry({ + seek: Math.max(fusionCry.totalDuration * 0.4, 0), + ...soundConfig, + }); SoundFade.fadeIn( scene, fusionCry, @@ -4517,13 +4518,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } if (i === transitionIndex && fusionCryKey) { SoundFade.fadeOut(globalScene, cry, fixedInt(Math.ceil((duration / rate) * 0.2))); - fusionCry = globalScene.playSound( - fusionCryKey, - Object.assign({ - seek: Math.max(fusionCry.totalDuration * 0.4, 0), - rate: rate, - }), - ); + fusionCry = globalScene.playSound(fusionCryKey, { + seek: Math.max(fusionCry.totalDuration * 0.4, 0), + rate: rate, + }); SoundFade.fadeIn( globalScene, fusionCry, diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index af03cc42b54..12d3b9dc6ce 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -44,7 +44,7 @@ export class SwitchSummonPhase extends SummonPhase { preSummon(): void { if (!this.player) { if (this.slotIndex === -1) { - //@ts-ignore + //@ts-expect-error this.slotIndex = globalScene.currentBattle.trainer?.getNextSummonIndex( !this.fieldIndex ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER, ); // TODO: what would be the default trainer-slot fallback? diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 0269b2f8f86..d5d4256f7d0 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1610,7 +1610,7 @@ export class GameData { } } - this.defaultDexData = Object.assign({}, data); + this.defaultDexData = { ...data }; this.dexData = data; } diff --git a/src/touch-controls.ts b/src/touch-controls.ts index 85854bc6a77..5319976648f 100644 --- a/src/touch-controls.ts +++ b/src/touch-controls.ts @@ -42,7 +42,7 @@ export default class TouchControl { document.querySelectorAll(".apad-button").forEach(element => this.preventElementZoom(element as HTMLElement)); // Select all elements with the 'data-key' attribute and bind keys to them for (const button of document.querySelectorAll("[data-key]")) { - // @ts-ignore - Bind the key to the button using the dataset key + // @ts-expect-error - Bind the key to the button using the dataset key this.bindKey(button, button.dataset.key); } } diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 32a88ab36b2..82e2f732b23 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -2321,7 +2321,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.showStats(); } else { this.statsContainer.setVisible(false); - //@ts-ignore + //@ts-expect-error this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. what. how? huh? } } @@ -2786,7 +2786,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.statsMode = false; this.statsContainer.setVisible(false); this.pokemonSprite.setVisible(true); - //@ts-ignore + //@ts-expect-error this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!? } } diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 0396ac07cc6..3cb6222cafa 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -2855,7 +2855,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } else { iconPath = globalScene.inputController?.getIconForLatestInputRecorded(iconSetting); } - // @ts-ignore: TODO can iconPath actually be undefined? + // @ts-expect-error: TODO can iconPath actually be undefined? iconElement.setTexture(gamepadType, iconPath); iconElement.setPosition(this.instructionRowX, this.instructionRowY); controlLabel.setPosition(this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY); @@ -3480,7 +3480,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.showStats(); } else { this.statsContainer.setVisible(false); - //@ts-ignore + //@ts-expect-error this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. what. how? huh? } } @@ -4488,7 +4488,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.statsMode = false; this.statsContainer.setVisible(false); this.pokemonSprite.setVisible(!!this.speciesStarterDexEntry?.caughtAttr); - //@ts-ignore + //@ts-expect-error this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!? this.teraIcon.setVisible(globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id)); const props = globalScene.gameData.getSpeciesDexAttrProps( diff --git a/test/abilities/wonder_skin.test.ts b/test/abilities/wonder_skin.test.ts index 886882ab6fd..177b97ae3b7 100644 --- a/test/abilities/wonder_skin.test.ts +++ b/test/abilities/wonder_skin.test.ts @@ -66,7 +66,7 @@ describe("Abilities - Wonder Skin", () => { it(`does not affect pokemon with ${ability[1]}`, async () => { const moveToCheck = allMoves[MoveId.CHARM]; - // @ts-ignore ts doesn't know that ability[0] is an ability and not a string... + // @ts-expect-error ts doesn't know that ability[0] is an ability and not a string... game.override.ability(ability[0]); vi.spyOn(moveToCheck, "calculateBattleAccuracy"); diff --git a/test/testUtils/inputsHandler.ts b/test/testUtils/inputsHandler.ts index 6e9dd453541..0d8c43e7616 100644 --- a/test/testUtils/inputsHandler.ts +++ b/test/testUtils/inputsHandler.ts @@ -89,7 +89,7 @@ class Fakepad extends Phaser.Input.Gamepad.Gamepad { public index: number; constructor(pad) { - //@ts-ignore + //@ts-expect-error super(undefined, { ...pad, buttons: pad.deviceMapping, axes: [] }); //TODO: resolve ts-ignore this.id = "xbox_360_fakepad"; this.index = 0; diff --git a/test/testUtils/mocks/mocksContainer/mockSprite.ts b/test/testUtils/mocks/mocksContainer/mockSprite.ts index ed1f1df6609..bbcd421e1a7 100644 --- a/test/testUtils/mocks/mocksContainer/mockSprite.ts +++ b/test/testUtils/mocks/mocksContainer/mockSprite.ts @@ -19,13 +19,13 @@ export default class MockSprite implements MockGameObject { constructor(textureManager, x, y, texture) { this.textureManager = textureManager; this.scene = textureManager.scene; - // @ts-ignore + // @ts-expect-error Phaser.GameObjects.Sprite.prototype.setInteractive = this.setInteractive; - // @ts-ignore + // @ts-expect-error Phaser.GameObjects.Sprite.prototype.setTexture = this.setTexture; - // @ts-ignore + // @ts-expect-error Phaser.GameObjects.Sprite.prototype.setSizeToFrame = this.setSizeToFrame; - // @ts-ignore + // @ts-expect-error Phaser.GameObjects.Sprite.prototype.setFrame = this.setFrame; // Phaser.GameObjects.Sprite.prototype.disable = this.disable; diff --git a/test/testUtils/testFileInitialization.ts b/test/testUtils/testFileInitialization.ts index da390870300..578747b0529 100644 --- a/test/testUtils/testFileInitialization.ts +++ b/test/testUtils/testFileInitialization.ts @@ -47,7 +47,7 @@ export function initTestFile() { }); BBCodeText.prototype.destroy = () => null; - // @ts-ignore + // @ts-expect-error BBCodeText.prototype.resize = () => null; InputText.prototype.setElement = () => null as any; InputText.prototype.resize = () => null as any;