Skip to content

Commit

Permalink
prettier update
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtying committed Dec 3, 2024
1 parent 7956172 commit 207c84c
Show file tree
Hide file tree
Showing 39 changed files with 654 additions and 622 deletions.
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.3.0
8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"copy-webpack-plugin": "^6.0.3",
"css-loader": "^4.0.0",
"css-minimizer-webpack-plugin": "^3.0.1",
"eslint": "^7.3.0",
"eslint-config-prettier": "^6.11.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^18.0.2",
"eslint-plugin-import": "2",
"eslint-plugin-node": "11",
Expand All @@ -63,8 +63,8 @@
"hook-shell-script-webpack-plugin": "^0.1.4",
"html-webpack-plugin": "^5.3.2",
"mini-css-extract-plugin": "^1.6.0",
"prettier": "^2.0.2",
"prettier-eslint": "^11.0.0",
"prettier": "^3.4.1",
"prettier-eslint": "^16.3.0",
"react-color": "^2.18.1",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^5.1.3",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/AppStateProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const AppStateContext = React.createContext<Context>({
});

export const SettingsContext = React.createContext<Settings>(
appState.loadDefault().settings
appState.loadDefault().settings,
);

export const AppStateConsumer = AppStateContext.Consumer;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/AutoPlayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const AutoPlayButton = (props: IProps): JSX.Element => {
playDescription !== null ? " (" + playDescription + ")" : ""
}`
: autoplay !== null
? "Don't autoplay selected cards"
: "Autoplay selected cards"}
? "Don't autoplay selected cards"
: "Autoplay selected cards"}
</button>
);
};
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Card = (props: IProps): JSX.Element => {
suit={classNames(
"unknown",
settings.fourColor ? "four-color" : null,
settings.darkMode ? "dark-mode" : null
settings.darkMode ? "dark-mode" : null,
)}
backgroundColor={settings.darkMode ? "#000" : "#fff"}
/>
Expand Down Expand Up @@ -103,7 +103,7 @@ const Card = (props: IProps): JSX.Element => {
suit={classNames(
cardInfo.typ,
settings.fourColor ? "four-color" : null,
settings.darkMode ? "dark-mode" : null
settings.darkMode ? "dark-mode" : null,
)}
colorOverride={
settings.suitColorOverrides[cardInfo.typ as keyof ISuitOverrides]
Expand Down Expand Up @@ -178,7 +178,7 @@ interface ICardCanvasProps {
}

const getCardBounds = (
height: number
height: number,
): { metrics: TextMetrics; height: number; width: number } => {
const font = `${height}px solid`;
if (!(font in cardBoundsCache)) {
Expand All @@ -189,12 +189,12 @@ const getCardBounds = (
const effectiveHeight = Math.round(
textMetrics.actualBoundingBoxAscent +
textMetrics.actualBoundingBoxDescent +
2
2,
);
const effectiveWidth = Math.round(
textMetrics.actualBoundingBoxRight +
Math.min(textMetrics.actualBoundingBoxLeft, 0) +
2
2,
);
return {
metrics: textMetrics,
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/Cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface IProps {

const Cards = (props: IProps): JSX.Element => {
const [highlightedSuit, setHighlightedSuit] = React.useState<string | null>(
null
null,
);

const { hands, selectedCards, notifyEmpty } = props;
Expand Down Expand Up @@ -46,7 +46,7 @@ const Cards = (props: IProps): JSX.Element => {
const cardsInHand =
props.playerId in hands.hands
? Object.entries(hands.hands[props.playerId]).flatMap(([c, ct]) =>
Array(ct).fill(c)
Array(ct).fill(c),
)
: [];

Expand All @@ -64,7 +64,7 @@ const Cards = (props: IProps): JSX.Element => {
g.cards.map((c) => ({
card: c,
suit: g.suit,
}))
})),
)
: [];

Expand All @@ -75,7 +75,7 @@ const Cards = (props: IProps): JSX.Element => {
g.cards.map((c) => ({
card: c,
suit: g.suit,
}))
})),
);

if (!separateCardsBySuit) {
Expand Down Expand Up @@ -128,7 +128,7 @@ const Cards = (props: IProps): JSX.Element => {
className={classNames(
!disableSuitHighlights && highlightedSuit === c.suit
? "highlighted"
: null
: null,
)}
onClick={handleSelect(c.card)}
card={c.card}
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const renderScoringMessage = (message: Message): JSX.Element => {
changes.push(
<span key={changes.length}>
step size: {variant.parameters.step_size_per_deck}分 per deck
</span>
</span>,
);
}
if (
Expand All @@ -68,7 +68,7 @@ const renderScoringMessage = (message: Message): JSX.Element => {
changes.push(
<span key={changes.length}>
non-leveling steps: {variant.parameters.deadzone_size}{" "}
</span>
</span>,
);
}
if (
Expand All @@ -79,7 +79,7 @@ const renderScoringMessage = (message: Message): JSX.Element => {
<span key={changes.length}>
steps to turnover:{" "}
{variant.parameters.num_steps_to_non_landlord_turnover}{" "}
</span>
</span>,
);
}
for (const k in variant.parameters.step_adjustments) {
Expand All @@ -88,15 +88,15 @@ const renderScoringMessage = (message: Message): JSX.Element => {
changes.push(
<span key={changes.length}>
step size adjustment for {k} decks set to {adj}{" "}
</span>
</span>,
);
}
}
for (const k in variant.old_parameters.step_adjustments) {
const adj = variant.parameters.step_adjustments[k];
if (adj === undefined || adj === null || adj === 0) {
changes.push(
<span key={changes.length}>adjustment for {k} decks removed </span>
<span key={changes.length}>adjustment for {k} decks removed </span>,
);
}
}
Expand All @@ -109,11 +109,11 @@ const renderScoringMessage = (message: Message): JSX.Element => {
"BonusLevelForSmallerLandlordTeam"
) {
changes.push(
<span key={changes.length}>small-team bonus enabled</span>
<span key={changes.length}>small-team bonus enabled</span>,
);
} else {
changes.push(
<span key={changes.length}>small-team bonus disabled</span>
<span key={changes.length}>small-team bonus disabled</span>,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Confetti.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Confetti = (props: IProps): JSX.Element => {
angle: randomInRange(65, 115),
}).then(
() => {},
() => {}
() => {},
);
}
}, 500);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/DebugInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const DebugInfo = (_props: {}): JSX.Element => {
roomName: appState.state.roomName,
},
null,
2
2,
)}
</pre>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Draw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Draw extends React.Component<IDrawProps, IDrawState> {
if (this.props.playDrawCardSound) {
if (this.drawCardAudio === null) {
this.drawCardAudio = new Audio(
"434472_dersuperanton_taking-card.mp3"
"434472_dersuperanton_taking-card.mp3",
);
}
// eslint-disable-next-line
Expand Down Expand Up @@ -95,7 +95,7 @@ class Draw extends React.Component<IDrawProps, IDrawState> {
() => {
this.drawCard();
},
this.props.autodrawSpeedMs !== null ? this.props.autodrawSpeedMs : 250
this.props.autodrawSpeedMs !== null ? this.props.autodrawSpeedMs : 250,
);
}
this.could_draw = canDraw;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/FriendSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const FriendSelect = (props: IProps): JSX.Element => {
cardOptions.push({
label: `${c.number}${c.typ}`,
value: c.value,
})
}),
);

return (
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const Button = styled.button`
margin: 0;
border: 0;
background-color: transparent;
transition: opacity 100ms ease-in-out, color 150ms ease-in-out,
transition:
opacity 100ms ease-in-out,
color 150ms ease-in-out,
transform 100ms ease-in-out;
color: #111;
&:hover {
Expand All @@ -16,7 +18,7 @@ const Button = styled.button`
`;

const IconButton = (
props: React.ComponentProps<typeof Button>
props: React.ComponentProps<typeof Button>,
): JSX.Element => {
return <Button className="icon-button" {...props} />;
};
Expand Down
Loading

0 comments on commit 207c84c

Please sign in to comment.