From 395f31aae3eb81be1c95f4666b480d2ebbdd6aa0 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Tue, 8 Mar 2022 16:27:59 -0800 Subject: [PATCH] Remove all linter reported errors Signed-off-by: James Ketrenos --- client/src/Chat.js | 2 +- client/src/ChooseCard.js | 5 ++++- client/src/PlayersStatus.js | 2 -- client/src/Table.js | 6 ++---- client/src/ViewCard.js | 11 +++++------ 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/client/src/Chat.js b/client/src/Chat.js index 12b0e15..14b61c5 100644 --- a/client/src/Chat.js +++ b/client/src/Chat.js @@ -84,7 +84,7 @@ const Chat = ({ table }) => { let lines = item.message.split('.'); const message = lines.map((line, index) => { if (line.trim() === '') { - return; + return <>; } /* If the date is in the future, set it to now */ const dice = line.match(/^(.*rolled )([1-6])(, ([1-6]))?(.*)$/); diff --git a/client/src/ChooseCard.js b/client/src/ChooseCard.js index 51304ce..29a4867 100644 --- a/client/src/ChooseCard.js +++ b/client/src/ChooseCard.js @@ -25,7 +25,7 @@ const ChooseCard = ({table, type}) => { tmp.push(selected[i].getAttribute('data-type')); } setCards(tmp); - }, [ setCards ]); + }, [ setCards, count ]); if (!table.game) { return <>; @@ -55,6 +55,9 @@ const ChooseCard = ({table, type}) => { case 'year-of-plenty': title = <>Year of Plenty! Tap the two resources you want to receive from the bank!; break; + default: + title = <>Unknown card type {type}.; + break; } return ( diff --git a/client/src/PlayersStatus.js b/client/src/PlayersStatus.js index 4b47915..ca0edb8 100644 --- a/client/src/PlayersStatus.js +++ b/client/src/PlayersStatus.js @@ -87,7 +87,6 @@ const PlayersStatus = ({ table, onClick, color, active }) => { const game = table.game; let players; if (color) { - const player = game.players[color]; players = { .filter(color => game.players[color].status === 'Active' && game.color !== color) .map(color => { - const player = game.players[color]; return { const passClick = (event) => { return table.passTurn(); } - +/* const quitClick = (event) => { table.setSelected(""); } - +*/ if (!table.game) { console.log("Why no game?"); return (); diff --git a/client/src/ViewCard.js b/client/src/ViewCard.js index 33bb0ef..1593c1e 100644 --- a/client/src/ViewCard.js +++ b/client/src/ViewCard.js @@ -1,4 +1,4 @@ -import React, { useState, useCallback } from "react"; +import React from "react"; import "./ViewCard.css"; import Paper from '@material-ui/core/Paper'; import Button from '@material-ui/core/Button'; @@ -28,7 +28,7 @@ const ViewCard = ({table, card}) => { }; let description, lookup; - if (card.type == 'progress') { + if (card.type === 'progress') { lookup = `${card.type}-${card.card}`; } else { lookup = card.type; @@ -71,12 +71,11 @@ const ViewCard = ({table, card}) => { 2 of the same resource or 1 of two differ resources. ; break; + default: + description = <>Unknown card type {lookup}; + break; }; - if (description === undefined) { - console.log(`No description for ${card.type}-${card.card}`); - } - let canPlay = false; if (card.type === 'vp') { let points = table.game.player.points;