Migrate Prettier/Eslint/Stylelint setup to Biome (#1772)

* Initial

* CSS lint

* Test CI

* Add 1v1, 2v2, and 3v3 Tags (#1771)

* Initial

* CSS lint

* Test CI

* Rename step

---------

Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
This commit is contained in:
Kalle
2024-06-24 13:07:17 +03:00
committed by GitHub
parent 73e9fca492
commit fd48bced91
1070 changed files with 219485 additions and 224310 deletions

View File

@@ -3,10 +3,10 @@
*-----------------------------------------------------------*/
import type {
GrandFinalType,
RoundRobinMode,
SeedOrdering,
StageType,
GrandFinalType,
RoundRobinMode,
SeedOrdering,
StageType,
} from "./unions";
/**
@@ -24,101 +24,101 @@ export type Seeding = (number | null)[];
* Used to create a stage.
*/
export interface InputStage {
/**
* ID of the parent tournament.
*
* Used to determine the `number` property of a stage related to a tournament.
*/
tournamentId: number;
/**
* ID of the parent tournament.
*
* Used to determine the `number` property of a stage related to a tournament.
*/
tournamentId: number;
/** Name of the stage. */
name: string;
/** Name of the stage. */
name: string;
/** Type of stage. */
type: StageType;
/** Type of stage. */
type: StageType;
/** The number of the stage in its tournament. Is determined if not given. */
number?: number;
/** The number of the stage in its tournament. Is determined if not given. */
number?: number;
/** Contains participants or `null` for BYEs. */
seeding?: Seeding;
/** Contains participants or `null` for BYEs. */
seeding?: Seeding;
/** Contains optional settings specific to each stage type. */
settings?: StageSettings;
/** Contains optional settings specific to each stage type. */
settings?: StageSettings;
}
/**
* The possible settings for a stage.
*/
export interface StageSettings {
/**
* The number of participants.
*/
size?: number;
/**
* The number of participants.
*/
size?: number;
/**
* A list of ordering methods to apply to the seeding.
*
* - For a round-robin stage: 1 item required (**with** `"groups."` prefix).
* - Used to distribute in groups.
* - For a simple elimination stage, 1 item required (**without** `"groups."` prefix).
* - Used to distribute in round 1.
* - For a double elimination stage, 1 item required, 3+ items supported (**without** `"groups."` prefix).
* - Item 1 (required) - Used to distribute in WB round 1.
* - Item 2 - Used to distribute WB losers in LB round 1.
* - Items 3+ - Used to distribute WB losers in LB minor rounds (1 per round).
*/
seedOrdering?: SeedOrdering[];
/**
* A list of ordering methods to apply to the seeding.
*
* - For a round-robin stage: 1 item required (**with** `"groups."` prefix).
* - Used to distribute in groups.
* - For a simple elimination stage, 1 item required (**without** `"groups."` prefix).
* - Used to distribute in round 1.
* - For a double elimination stage, 1 item required, 3+ items supported (**without** `"groups."` prefix).
* - Item 1 (required) - Used to distribute in WB round 1.
* - Item 2 - Used to distribute WB losers in LB round 1.
* - Items 3+ - Used to distribute WB losers in LB minor rounds (1 per round).
*/
seedOrdering?: SeedOrdering[];
/**
* Whether to balance BYEs in the seeding of an elimination stage.
*
* This prevents having BYE against BYE in matches.
*/
balanceByes?: boolean;
/**
* Whether to balance BYEs in the seeding of an elimination stage.
*
* This prevents having BYE against BYE in matches.
*/
balanceByes?: boolean;
/**
* Number of groups in a round-robin stage.
*/
groupCount?: number;
/**
* Number of groups in a round-robin stage.
*/
groupCount?: number;
/**
* The mode for the round-robin stage.
*
* - If `simple`, each participant plays each opponent once.
* - If `double`, each participant plays each opponent twice, once at home and once away.
*/
roundRobinMode?: RoundRobinMode;
/**
* The mode for the round-robin stage.
*
* - If `simple`, each participant plays each opponent once.
* - If `double`, each participant plays each opponent twice, once at home and once away.
*/
roundRobinMode?: RoundRobinMode;
/**
* A list of seeds per group for a round-robin stage to be manually ordered.
*
* Seed ordering is ignored if this property is given.
*/
manualOrdering?: number[][];
/**
* A list of seeds per group for a round-robin stage to be manually ordered.
*
* Seed ordering is ignored if this property is given.
*/
manualOrdering?: number[][];
/**
* Optional final between semi-final losers.
*/
consolationFinal?: boolean;
/**
* Optional final between semi-final losers.
*/
consolationFinal?: boolean;
/**
* Whether to skip the first round of the WB of a double elimination stage.
*/
skipFirstRound?: boolean;
/**
* Whether to skip the first round of the WB of a double elimination stage.
*/
skipFirstRound?: boolean;
/**
* Optional grand final between WB and LB winners.
*
* - If `none`, there is no grand final.
* - If `simple`, the final is a single match. The winner is the winner of the stage.
* - If `double`, if the WB winner wins, he's the winner of the stage. But if he loses, the final is reset and there is a very last match.
* It might be fairer since it gives the WB winner the right to lose once during the stage...
*/
grandFinal?: GrandFinalType;
/**
* Optional grand final between WB and LB winners.
*
* - If `none`, there is no grand final.
* - If `simple`, the final is a single match. The winner is the winner of the stage.
* - If `double`, if the WB winner wins, he's the winner of the stage. But if he loses, the final is reset and there is a very last match.
* It might be fairer since it gives the WB winner the right to lose once during the stage...
*/
grandFinal?: GrandFinalType;
swiss?: {
groupCount: number;
roundCount: number;
};
swiss?: {
groupCount: number;
roundCount: number;
};
}

View File

@@ -8,55 +8,55 @@ import type { Result } from "./unions";
* The possible status for a match.
*/
export enum Status {
/** The two matches leading to this one are not completed yet. */
Locked = 0,
/** The two matches leading to this one are not completed yet. */
Locked = 0,
/** One participant is ready and waiting for the other one. */
Waiting = 1,
/** One participant is ready and waiting for the other one. */
Waiting = 1,
/** Both participants are ready to start. */
Ready = 2,
/** Both participants are ready to start. */
Ready = 2,
/** The match is running. */
Running = 3,
/** The match is running. */
Running = 3,
/** The match is completed. */
Completed = 4,
/** The match is completed. */
Completed = 4,
}
/**
* The results of a participant in a match.
*/
export interface ParticipantResult {
/** If `null`, the participant is to be determined. */
id: number | null;
/** If `null`, the participant is to be determined. */
id: number | null;
/** Indicates where the participant comes from. */
position?: number;
/** Indicates where the participant comes from. */
position?: number;
/** If this participant forfeits, the other automatically wins. */
forfeit?: boolean;
/** If this participant forfeits, the other automatically wins. */
forfeit?: boolean;
/** The current score of the participant. */
score?: number;
/** The current score of the participant. */
score?: number;
/** How many points in total participant scored in total this set. KO = 100 points. Getting KO'd = 0 points. */
totalPoints?: number;
/** How many points in total participant scored in total this set. KO = 100 points. Getting KO'd = 0 points. */
totalPoints?: number;
/** Tells what is the result of a duel for this participant. */
result?: Result;
/** Tells what is the result of a duel for this participant. */
result?: Result;
}
/**
* Only contains information about match status and results.
*/
export interface MatchResults {
/** Status of the match. */
status: Status;
/** Status of the match. */
status: Status;
/** First opponent of the match. */
opponent1: ParticipantResult | null;
/** First opponent of the match. */
opponent1: ParticipantResult | null;
/** Second opponent of the match. */
opponent2: ParticipantResult | null;
/** Second opponent of the match. */
opponent2: ParticipantResult | null;
}

View File

@@ -15,39 +15,39 @@ import type { StageType } from "./unions";
* A stage, which can be a round-robin stage or a single/double elimination stage.
*/
export interface Stage {
/** ID of the stage. */
id: number;
/** ID of the stage. */
id: number;
/** ID of the tournament this stage belongs to. */
tournament_id: number;
/** ID of the tournament this stage belongs to. */
tournament_id: number;
/** Name of the stage. */
name: string;
/** Name of the stage. */
name: string;
/** Type of the stage. */
type: StageType;
/** Type of the stage. */
type: StageType;
/** Settings of the stage. */
settings: StageSettings;
/** Settings of the stage. */
settings: StageSettings;
/** The number of the stage in its tournament. */
number: number;
/** The number of the stage in its tournament. */
number: number;
createdAt?: number | null;
createdAt?: number | null;
}
/**
* A group of a stage.
*/
export interface Group {
/** ID of the group. */
id: number;
/** ID of the group. */
id: number;
/** ID of the parent stage. */
stage_id: number;
/** ID of the parent stage. */
stage_id: number;
/** The number of the group in its stage. */
number: number;
/** The number of the group in its stage. */
number: number;
}
// The next levels don't have a `name` property. They are automatically named with their `number` and their context (parent levels).
@@ -56,42 +56,42 @@ export interface Group {
* A round of a group.
*/
export interface Round {
/** ID of the round. */
id: number;
/** ID of the round. */
id: number;
/** ID of the parent stage. */
stage_id: number;
/** ID of the parent stage. */
stage_id: number;
/** ID of the parent group. */
group_id: number;
/** ID of the parent group. */
group_id: number;
/** The number of the round in its group. */
number: number;
/** The number of the round in its group. */
number: number;
/** Info about the maps count */
maps?: Pick<TournamentRoundMaps, "count" | "type" | "pickBan"> | null;
/** Info about the maps count */
maps?: Pick<TournamentRoundMaps, "count" | "type" | "pickBan"> | null;
}
/**
* A match of a round.
*/
export interface Match extends MatchResults {
/** ID of the match. */
id: number;
/** ID of the match. */
id: number;
/** ID of the parent stage. */
stage_id: number;
/** ID of the parent stage. */
stage_id: number;
/** ID of the parent group. */
group_id: number;
/** ID of the parent group. */
group_id: number;
/** ID of the parent round. */
round_id: number;
/** ID of the parent round. */
round_id: number;
/** The number of the match in its round. */
number: number;
/** The number of the match in its round. */
number: number;
lastGameFinishedAt?: number | null;
lastGameFinishedAt?: number | null;
createdAt?: number | null;
createdAt?: number | null;
}

View File

@@ -6,10 +6,10 @@
* The only supported types of stage.
*/
export type StageType =
| "round_robin"
| "single_elimination"
| "double_elimination"
| "swiss";
| "round_robin"
| "single_elimination"
| "double_elimination"
| "swiss";
/**
* All the possible types of group in an elimination stage.
@@ -19,10 +19,10 @@ export type StageType =
* - `final_group` for both single and double elimination.
*/
export type GroupType =
| "single_bracket"
| "winner_bracket"
| "loser_bracket"
| "final_group";
| "single_bracket"
| "winner_bracket"
| "loser_bracket"
| "final_group";
/**
* The possible types for a double elimination stage's grand final.
@@ -43,16 +43,16 @@ export type RoundRobinMode = "simple" | "double";
* Used to order seeds.
*/
export type SeedOrdering =
| "natural"
| "reverse"
| "half_shift"
| "reverse_half_shift"
| "pair_flip"
| "inner_outer"
| "space_between"
| "groups.effort_balanced"
| "groups.seed_optimized"
| "groups.bracket_optimized";
| "natural"
| "reverse"
| "half_shift"
| "reverse_half_shift"
| "pair_flip"
| "inner_outer"
| "space_between"
| "groups.effort_balanced"
| "groups.seed_optimized"
| "groups.bracket_optimized";
/**
* The possible results of a duel for a participant.