diff --git a/biome.jsonc b/biome.jsonc index 6d3ad9240b4..98c6b847307 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -138,7 +138,6 @@ "useObjectSpread": "info", "useNumericSeparators": "off", // TODO: enable? "useIterableCallbackReturn": "warn", - "useSingleJsDocAsterisk": "warn", "noShadow": "warn" } } diff --git a/src/data/balance/egg-moves.ts b/src/data/balance/egg-moves.ts index 436e6bc6e76..fa89e558ba7 100644 --- a/src/data/balance/egg-moves.ts +++ b/src/data/balance/egg-moves.ts @@ -595,13 +595,13 @@ function parseEggMoves(content: string): void { const cols = line.split(",").slice(0, 5); const moveNames = allMoves.map(m => m.name.replace(/ \([A-Z]\)$/, "").toLowerCase()); const enumSpeciesName = cols[0].toUpperCase().replace(/[ -]/g, "_"); - const species = speciesValues[speciesNames.findIndex(s => s === enumSpeciesName)]; + const species = speciesValues[speciesNames.indexOf(enumSpeciesName)]; const eggMoves: MoveId[] = []; for (let m = 0; m < 4; m++) { const moveName = cols[m + 1].trim(); - const moveIndex = moveName !== "N/A" ? moveNames.findIndex(mn => mn === moveName.toLowerCase()) : -1; + const moveIndex = moveName !== "N/A" ? moveNames.indexOf(moveName.toLowerCase()) : -1; eggMoves.push(moveIndex > -1 ? moveIndex as MoveId : MoveId.NONE); if (moveIndex === -1) { diff --git a/src/data/egg.ts b/src/data/egg.ts index 0cb8a5f1745..1ef08a4f1da 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -524,7 +524,7 @@ export class Egg { /** * Rolls whether the egg is shiny or not. * @returns `true` if the egg is shiny - **/ + */ private rollShiny(): boolean { let shinyChance = GACHA_DEFAULT_SHINY_RATE; switch (this._sourceType) { diff --git a/src/data/moves/pokemon-move.ts b/src/data/moves/pokemon-move.ts index daad199fbbd..ab774c9fff9 100644 --- a/src/data/moves/pokemon-move.ts +++ b/src/data/moves/pokemon-move.ts @@ -16,7 +16,7 @@ import type Move from "./move"; * @see {@linkcode getMovePp} - returns amount of PP a move currently has. * @see {@linkcode getPpRatio} - returns the current PP amount / max PP amount. * @see {@linkcode getName} - returns name of {@linkcode Move}. - **/ + */ export class PokemonMove { public moveId: MoveId; public ppUsed: number; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 82d6c5f3a82..d2a48495195 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -569,7 +569,7 @@ export abstract class PokemonSpeciesForm { const rootSpeciesId = this.getRootSpeciesId(); for (const moveId of moveset) { if (speciesEggMoves.hasOwnProperty(rootSpeciesId)) { - const eggMoveIndex = speciesEggMoves[rootSpeciesId].findIndex(m => m === moveId); + const eggMoveIndex = speciesEggMoves[rootSpeciesId].indexOf(moveId); if (eggMoveIndex > -1 && eggMoves & (1 << eggMoveIndex)) { continue; } diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index a767b083538..7c8b5b29fcd 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -290,7 +290,7 @@ export class TrainerConfig { * @param {string} [nameFemale] The name of the female trainer. If 'Ivy', a localized name will be assigned. * @param {TrainerType | string} [femaleEncounterBgm] The encounter BGM for the female trainer, which can be a TrainerType or a string. * @returns {TrainerConfig} The updated TrainerConfig instance. - **/ + */ setHasGenders(nameFemale?: string, femaleEncounterBgm?: TrainerType | string): TrainerConfig { // If the female name is 'Ivy' (the rival), assign a localized name. if (nameFemale === "Ivy") { @@ -540,7 +540,7 @@ export class TrainerConfig { * @param {SpeciesId | SpeciesId[]} signatureSpecies The signature species for the evil team leader. * @param specialtyType The specialty Type of the admin, if they have one * @returns {TrainerConfig} The updated TrainerConfig instance. - * **/ + */ initForEvilTeamAdmin( title: string, poolName: EvilTeam, @@ -581,7 +581,7 @@ export class TrainerConfig { * Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter. * @param _isMale Whether the stat trainer is Male or Female (for localization of the title). * @returns {TrainerConfig} The updated TrainerConfig instance. - **/ + */ initForStatTrainer(_isMale = false): TrainerConfig { if (!getIsInitialized()) { initI18n(); @@ -608,7 +608,7 @@ export class TrainerConfig { * @param {PokemonType} specialtyType The specialty type for the evil team Leader. * @param boolean Whether or not this is the rematch fight * @returns {TrainerConfig} The updated TrainerConfig instance. - * **/ + */ initForEvilTeamLeader( title: string, signatureSpecies: (SpeciesId | SpeciesId[])[], @@ -651,7 +651,7 @@ export class TrainerConfig { * @param ignoreMinTeraWave Whether the Gym Leader always uses Tera (true), or only Teras after {@linkcode GYM_LEADER_TERA_WAVE} (false). Defaults to false. * @param teraSlot Optional, sets the party member in this slot to Terastallize. Wraps based on party size. * @returns {TrainerConfig} The updated TrainerConfig instance. - * **/ + */ initForGymLeader( signatureSpecies: (SpeciesId | SpeciesId[])[], isMale: boolean, @@ -709,7 +709,7 @@ export class TrainerConfig { * @param specialtyType - The specialty type for the Elite Four member. * @param teraSlot - Optional, sets the party member in this slot to Terastallize. * @returns The updated TrainerConfig instance. - **/ + */ initForEliteFour( signatureSpecies: (SpeciesId | SpeciesId[])[], isMale: boolean, @@ -765,7 +765,7 @@ export class TrainerConfig { * @param {SpeciesId | SpeciesId[]} signatureSpecies The signature species for the Champion. * @param isMale Whether the Champion is Male or Female (for localization of the title). * @returns {TrainerConfig} The updated TrainerConfig instance. - **/ + */ initForChampion(isMale: boolean): TrainerConfig { // Check if the internationalization (i18n) system is initialized. if (!getIsInitialized()) { @@ -815,7 +815,7 @@ export class TrainerConfig { * @param {TrainerSlot} trainerSlot - The slot to determine which title to use. Defaults to TrainerSlot.NONE. * @param {TrainerVariant} variant - The variant of the trainer to determine the specific title. * @returns {string} - The title of the trainer. - **/ + */ getTitle(trainerSlot: TrainerSlot = TrainerSlot.NONE, variant: TrainerVariant): string { const ret = this.name; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2e47c9e8de4..6a21e246223 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5314,10 +5314,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { for (let sc = 0; sc < spriteColors.length; sc++) { const delta = Math.min(...paletteDeltas[sc]); - const paletteIndex = Math.min( - paletteDeltas[sc].findIndex(pd => pd === delta), - fusionPalette.length - 1, - ); + const paletteIndex = Math.min(paletteDeltas[sc].indexOf(delta), fusionPalette.length - 1); if (delta < 255) { const ratio = easeFunc(delta / 255); const color = [0, 0, 0, fusionSpriteColors[sc][3]]; diff --git a/src/field/trainer.ts b/src/field/trainer.ts index b64821d259a..8ac896e2717 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -158,7 +158,7 @@ export default class Trainer extends Phaser.GameObjects.Container { * @param {TrainerSlot} trainerSlot - The slot to determine which name to use. Defaults to TrainerSlot.NONE. * @param {boolean} includeTitle - Whether to include the title in the returned name. Defaults to false. * @returns {string} - The formatted name of the trainer. - **/ + */ getName(trainerSlot: TrainerSlot = TrainerSlot.NONE, includeTitle = false): string { // Get the base title based on the trainer slot and variant. let name = this.config.getTitle(trainerSlot, this.variant); diff --git a/src/phase-manager.ts b/src/phase-manager.ts index 9390e6dd75d..a4256f110ef 100644 --- a/src/phase-manager.ts +++ b/src/phase-manager.ts @@ -100,7 +100,7 @@ import { UnlockPhase } from "#app/phases/unlock-phase"; import { VictoryPhase } from "#app/phases/victory-phase"; import { WeatherEffectPhase } from "#app/phases/weather-effect-phase"; -/** +/* * Manager for phases used by battle scene. * * *This file must not be imported or used directly. The manager is exclusively used by the battle scene and is not intended for external use.* diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index d7da1ab996c..2a163bd34aa 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -696,12 +696,9 @@ export class MoveEffectPhase extends PokemonPhase { * @param target - The {@linkcode Pokemon} to be removed */ protected removeTarget(target: Pokemon): void { - const targetIndex = this.targets.findIndex(ind => ind === target.getBattlerIndex()); + const targetIndex = this.targets.indexOf(target.getBattlerIndex()); if (targetIndex !== -1) { - this.targets.splice( - this.targets.findIndex(ind => ind === target.getBattlerIndex()), - 1, - ); + this.targets.splice(this.targets.indexOf(target.getBattlerIndex()), 1); } } diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 82e2f732b23..9ec74e70b23 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -2057,7 +2057,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } let newSpecies: PokemonSpecies; if (this.filteredIndices) { - const index = this.filteredIndices.findIndex(id => id === this.species.speciesId); + const index = this.filteredIndices.indexOf(this.species.speciesId); const newIndex = index <= 0 ? this.filteredIndices.length - 1 : index - 1; newSpecies = getPokemonSpecies(this.filteredIndices[newIndex]); } else { @@ -2096,7 +2096,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } let newSpecies: PokemonSpecies; if (this.filteredIndices) { - const index = this.filteredIndices.findIndex(id => id === this.species.speciesId); + const index = this.filteredIndices.indexOf(this.species.speciesId); const newIndex = index >= this.filteredIndices.length - 1 ? 0 : index + 1; newSpecies = getPokemonSpecies(this.filteredIndices[newIndex]); } else { diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 1732bb005d3..9169ca77999 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -1389,7 +1389,7 @@ export default class PokedexUiHandler extends MessageUiHandler { const fitsMoves = fitsMove1 && fitsMove2; if (fitsEggMove1 && !fitsLevelMove1) { - const em1 = eggMoves.findIndex(name => name === selectedMove1); + const em1 = eggMoves.indexOf(selectedMove1); if ((starterData.eggMoves & (1 << em1)) === 0) { data.eggMove1 = false; } else { @@ -1399,7 +1399,7 @@ export default class PokedexUiHandler extends MessageUiHandler { data.tmMove1 = true; } if (fitsEggMove2 && !fitsLevelMove2) { - const em2 = eggMoves.findIndex(name => name === selectedMove2); + const em2 = eggMoves.indexOf(selectedMove2); if ((starterData.eggMoves & (1 << em2)) === 0) { data.eggMove2 = false; } else { diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index d30322de293..f108faf1646 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -117,7 +117,7 @@ export default class SummaryUiHandler extends UiHandler { private pokemon: PlayerPokemon | null; private playerParty: boolean; - /**This is set to false when checking the summary of a freshly caught Pokemon as it is not part of a player's party yet but still needs to display its items**/ + /**This is set to false when checking the summary of a freshly caught Pokemon as it is not part of a player's party yet but still needs to display its items*/ private newMove: Move | null; private moveSelectFunction: Function | null; private transitioning: boolean; diff --git a/test/abilities/mycelium_might.test.ts b/test/abilities/mycelium_might.test.ts index 2cdda4353b5..56af51c00f7 100644 --- a/test/abilities/mycelium_might.test.ts +++ b/test/abilities/mycelium_might.test.ts @@ -40,7 +40,7 @@ describe("Abilities - Mycelium Might", () => { * https://bulbapedia.bulbagarden.net/wiki/Mycelium_Might_(Ability) * https://bulbapedia.bulbagarden.net/wiki/Priority * https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/page-24 - **/ + */ it("will move last in its priority bracket and ignore protective abilities", async () => { await game.classicMode.startBattle([SpeciesId.REGIELEKI]); diff --git a/test/abilities/stall.test.ts b/test/abilities/stall.test.ts index e8ee23fb972..04a29a4f284 100644 --- a/test/abilities/stall.test.ts +++ b/test/abilities/stall.test.ts @@ -35,7 +35,7 @@ describe("Abilities - Stall", () => { * References: * https://bulbapedia.bulbagarden.net/wiki/Stall_(Ability) * https://bulbapedia.bulbagarden.net/wiki/Priority - **/ + */ it("Pokemon with Stall should move last in its priority bracket regardless of speed", async () => { await game.classicMode.startBattle([SpeciesId.SHUCKLE]);