mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Upgrade Biome
This commit is contained in:
parent
a2d8cb2936
commit
c50d4248c0
|
|
@ -1450,6 +1450,7 @@ function tournamentSubs() {
|
|||
bestWeapons: nullFilledArray(
|
||||
faker.helpers.arrayElement([1, 1, 1, 2, 2, 3, 4, 5]),
|
||||
)
|
||||
// biome-ignore lint/suspicious/useIterableCallbackReturn: Biome 2.3.1 upgrade
|
||||
.map(() => {
|
||||
while (true) {
|
||||
const weaponId = R.sample(mainWeaponIds, 1)[0]!;
|
||||
|
|
@ -1466,6 +1467,7 @@ function tournamentSubs() {
|
|||
: nullFilledArray(
|
||||
faker.helpers.arrayElement([1, 1, 1, 2, 2, 3, 4, 5]),
|
||||
)
|
||||
// biome-ignore lint/suspicious/useIterableCallbackReturn: Biome 2.3.1 upgrade
|
||||
.map(() => {
|
||||
while (true) {
|
||||
const weaponId = R.sample(mainWeaponIds, 1)[0]!;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ export function smallStrToFilter(s: string): LFGFilter | null {
|
|||
case "w": {
|
||||
const weaponIds = val
|
||||
.split(",")
|
||||
.map((x) => Number.parseInt(x) as MainWeaponId)
|
||||
.map((x) => Number.parseInt(x, 10) as MainWeaponId)
|
||||
.filter((x) => x !== null && x !== undefined);
|
||||
if (weaponIds.length === 0) return null;
|
||||
return {
|
||||
|
|
@ -112,7 +112,7 @@ export function smallStrToFilter(s: string): LFGFilter | null {
|
|||
};
|
||||
}
|
||||
case "tz": {
|
||||
const n = Number.parseInt(val);
|
||||
const n = Number.parseInt(val, 10);
|
||||
if (Number.isNaN(n)) return null;
|
||||
return {
|
||||
_tag: "Timezone",
|
||||
|
|
@ -127,7 +127,7 @@ export function smallStrToFilter(s: string): LFGFilter | null {
|
|||
};
|
||||
}
|
||||
case "pt": {
|
||||
const n = Number.parseInt(val);
|
||||
const n = Number.parseInt(val, 10);
|
||||
if (Number.isNaN(n)) return null;
|
||||
return {
|
||||
_tag: "PlusTier",
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ describe("calculateDamage()", () => {
|
|||
const hpWithoutBRU = withoutBRU.find(
|
||||
(d) => d.receiver === "Wsb_Shield",
|
||||
)?.hitPoints;
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
const hpWithBRU = withBRU.find((d) => d.receiver === "Wsb_Shield")
|
||||
?.hitPoints!;
|
||||
|
||||
|
|
@ -124,6 +125,7 @@ describe("calculateDamage()", () => {
|
|||
const hpWithoutSPU = withoutSPU.find(
|
||||
(d) => d.receiver === "GreatBarrier_Barrier",
|
||||
)?.hitPoints;
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
const hpWithSPU = withSPU.find((d) => d.receiver === "GreatBarrier_Barrier")
|
||||
?.hitPoints!;
|
||||
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ describe("PreparedMaps - trimPreparedEliminationMaps", () => {
|
|||
});
|
||||
|
||||
expect(trimmed?.maps[0].list?.[0].stageId).toBe(
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
EIGHT_TEAM_SE_PREPARED.maps[1].list?.[0].stageId!,
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -393,15 +393,11 @@ function generateWeightedPairs({
|
|||
continue;
|
||||
}
|
||||
let wt =
|
||||
75 -
|
||||
75 /
|
||||
(scoreGroups.findIndex((s) => s === Math.min(curr.score, opp.score)) +
|
||||
2);
|
||||
75 - 75 / (scoreGroups.indexOf(Math.min(curr.score, opp.score)) + 2);
|
||||
wt +=
|
||||
5 - 5 / (scoreSums.findIndex((s) => s === curr.score + opp.score) + 1);
|
||||
const scoreGroupDiff = Math.abs(
|
||||
scoreGroups.findIndex((s) => s === curr.score) -
|
||||
scoreGroups.findIndex((s) => s === opp.score),
|
||||
scoreGroups.indexOf(curr.score) - scoreGroups.indexOf(opp.score),
|
||||
);
|
||||
|
||||
// TODO: consider "pairedUpDown"
|
||||
|
|
|
|||
|
|
@ -470,10 +470,7 @@ export class Tournament {
|
|||
const [oneId, twoId] = replays[0];
|
||||
|
||||
const lowerSeedId =
|
||||
newOrder.findIndex((t) => t === oneId) <
|
||||
newOrder.findIndex((t) => t === twoId)
|
||||
? twoId
|
||||
: oneId;
|
||||
newOrder.indexOf(oneId) < newOrder.indexOf(twoId) ? twoId : oneId;
|
||||
|
||||
if (!potentialSwitchCandidates.some((t) => t === lowerSeedId)) {
|
||||
logger.warn(
|
||||
|
|
@ -487,8 +484,8 @@ export class Tournament {
|
|||
// can't switch place with itself
|
||||
if (candidate === lowerSeedId) continue;
|
||||
|
||||
const candidateIdx = newOrder.findIndex((t) => t === candidate);
|
||||
const otherIdx = newOrder.findIndex((t) => t === lowerSeedId);
|
||||
const candidateIdx = newOrder.indexOf(candidate);
|
||||
const otherIdx = newOrder.indexOf(lowerSeedId);
|
||||
|
||||
const temp = newOrder[candidateIdx];
|
||||
newOrder[candidateIdx] = newOrder[otherIdx];
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ export const loader = async ({ params, request }: LoaderFunctionArgs) => {
|
|||
const subs = findSubsByTournamentId({
|
||||
tournamentId,
|
||||
userId: user?.id,
|
||||
// biome-ignore lint/suspicious/useIterableCallbackReturn: Biome 2.3.1 upgrade
|
||||
}).filter((sub) => {
|
||||
if (sub.visibility === "ALL") return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ export function TournamentLayout() {
|
|||
window.tourney = tournament;
|
||||
}, [tournament]);
|
||||
}
|
||||
|
||||
const subsCount = () =>
|
||||
// biome-ignore lint/suspicious/useIterableCallbackReturn: Biome 2.3.1 upgrade
|
||||
tournament.ctx.subCounts.reduce((acc, cur) => {
|
||||
if (cur.visibility === "ALL") return acc + cur.count;
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ export class Create {
|
|||
directInWb,
|
||||
);
|
||||
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
if (helpers.isDoubleEliminationNecessary(this.stage.settings?.size!)) {
|
||||
const winnerLb = this.createLowerBracket(stageId, 2, [
|
||||
directInLb,
|
||||
|
|
@ -214,6 +215,7 @@ export class Create {
|
|||
slots,
|
||||
);
|
||||
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
if (helpers.isDoubleEliminationNecessary(this.stage.settings?.size!)) {
|
||||
const winnerLb = this.createLowerBracket(stageId, 2, losersWb);
|
||||
this.createGrandFinal(stageId, winnerWb, winnerLb);
|
||||
|
|
@ -302,6 +304,7 @@ export class Create {
|
|||
number: number,
|
||||
losers: ParticipantSlot[][],
|
||||
): ParticipantSlot {
|
||||
// biome-ignore lint/suspicious/noNonNullAssertedOptionalChain: Biome 2.3.1 upgrade
|
||||
const participantCount = this.stage.settings?.size!;
|
||||
const roundPairCount = helpers.getRoundPairCount(participantCount);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,10 +51,8 @@
|
|||
"useLiteralKeys": {
|
||||
"fix": "safe",
|
||||
"level": "error"
|
||||
}
|
||||
},
|
||||
"nursery": {
|
||||
"useUniqueElementIds": "off"
|
||||
},
|
||||
"noImportantStyles": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
72
package-lock.json
generated
72
package-lock.json
generated
|
|
@ -65,7 +65,7 @@
|
|||
"zod": "^3.25.61"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.0.6",
|
||||
"@biomejs/biome": "2.3.1",
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@remix-run/dev": "^2.16.8",
|
||||
"@remix-run/route-config": "^2.16.8",
|
||||
|
|
@ -1473,9 +1473,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.6.tgz",
|
||||
"integrity": "sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.3.1.tgz",
|
||||
"integrity": "sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"bin": {
|
||||
|
|
@ -1489,20 +1489,20 @@
|
|||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "2.0.6",
|
||||
"@biomejs/cli-darwin-x64": "2.0.6",
|
||||
"@biomejs/cli-linux-arm64": "2.0.6",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.0.6",
|
||||
"@biomejs/cli-linux-x64": "2.0.6",
|
||||
"@biomejs/cli-linux-x64-musl": "2.0.6",
|
||||
"@biomejs/cli-win32-arm64": "2.0.6",
|
||||
"@biomejs/cli-win32-x64": "2.0.6"
|
||||
"@biomejs/cli-darwin-arm64": "2.3.1",
|
||||
"@biomejs/cli-darwin-x64": "2.3.1",
|
||||
"@biomejs/cli-linux-arm64": "2.3.1",
|
||||
"@biomejs/cli-linux-arm64-musl": "2.3.1",
|
||||
"@biomejs/cli-linux-x64": "2.3.1",
|
||||
"@biomejs/cli-linux-x64-musl": "2.3.1",
|
||||
"@biomejs/cli-win32-arm64": "2.3.1",
|
||||
"@biomejs/cli-win32-x64": "2.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.6.tgz",
|
||||
"integrity": "sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz",
|
||||
"integrity": "sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1517,9 +1517,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.6.tgz",
|
||||
"integrity": "sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz",
|
||||
"integrity": "sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1534,9 +1534,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.6.tgz",
|
||||
"integrity": "sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz",
|
||||
"integrity": "sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1551,9 +1551,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.6.tgz",
|
||||
"integrity": "sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz",
|
||||
"integrity": "sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1568,9 +1568,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.6.tgz",
|
||||
"integrity": "sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz",
|
||||
"integrity": "sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1585,9 +1585,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.6.tgz",
|
||||
"integrity": "sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz",
|
||||
"integrity": "sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1602,9 +1602,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.6.tgz",
|
||||
"integrity": "sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz",
|
||||
"integrity": "sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1619,9 +1619,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.6.tgz",
|
||||
"integrity": "sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz",
|
||||
"integrity": "sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
"zod": "^3.25.61"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.0.6",
|
||||
"@biomejs/biome": "2.3.1",
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@remix-run/dev": "^2.16.8",
|
||||
"@remix-run/route-config": "^2.16.8",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user