CODEBASE: Fix lint errors 4 (#1773)

Co-authored-by: Michael Ficocelli <ficocemt@gmail.com>
This commit is contained in:
catloversg
2024-11-14 22:47:35 +07:00
committed by GitHub
parent 4f84a894eb
commit 97ca8c5f5e
23 changed files with 123 additions and 99 deletions
+4 -6
View File
@@ -696,16 +696,14 @@ export function getPreviousMove(): [number, number] | null {
return null;
}
for (const rowIndexString in Go.currentGame.board) {
const row = Go.currentGame.board[+rowIndexString] ?? [];
for (const pointIndexString in row) {
const point = row[+pointIndexString];
const priorColor = point && priorBoard && getColorOnBoardString(priorBoard, point.x, point.y);
for (const [rowIndex, row] of Go.currentGame.board.entries()) {
for (const [pointIndex, point] of row.entries()) {
const priorColor = point && getColorOnBoardString(priorBoard, point.x, point.y);
const currentColor = point?.color;
const isPreviousPlayer = currentColor === Go.currentGame.previousPlayer;
const isChanged = priorColor !== currentColor;
if (priorColor && currentColor && isPreviousPlayer && isChanged) {
return [+rowIndexString, +pointIndexString];
return [rowIndex, pointIndex];
}
}
}