diff --git a/leaky-ships/.prettierrc.json b/leaky-ships/.prettierrc.json index 7e66ab7..1380ed3 100644 --- a/leaky-ships/.prettierrc.json +++ b/leaky-ships/.prettierrc.json @@ -1,5 +1,8 @@ { "semi": false, - "plugins": ["prettier-plugin-tailwindcss"], + "plugins": [ + "prettier-plugin-tailwindcss", + "@trivago/prettier-plugin-sort-imports" + ], "pluginSearchDirs": false } diff --git a/leaky-ships/components/Gamefield/BorderTiles.tsx b/leaky-ships/components/Gamefield/BorderTiles.tsx index 4a7e514..9038175 100644 --- a/leaky-ships/components/Gamefield/BorderTiles.tsx +++ b/leaky-ships/components/Gamefield/BorderTiles.tsx @@ -1,6 +1,6 @@ -import { CSSProperties, Dispatch, SetStateAction } from "react" -import { borderCN, cornerCN, fieldIndex } from "@lib/utils/helpers" import { Position, MouseCursor } from "../../interfaces/frontend" +import { borderCN, cornerCN, fieldIndex } from "@lib/utils/helpers" +import { CSSProperties, Dispatch, SetStateAction } from "react" type TilesType = { key: number diff --git a/leaky-ships/components/Gamefield/EventBar.tsx b/leaky-ships/components/Gamefield/EventBar.tsx index 897f2f6..cc5f092 100644 --- a/leaky-ships/components/Gamefield/EventBar.tsx +++ b/leaky-ships/components/Gamefield/EventBar.tsx @@ -1,6 +1,6 @@ -import React, { Dispatch, SetStateAction } from "react" import { Items, Target } from "../../interfaces/frontend" import Item from "./Item" +import React, { Dispatch, SetStateAction } from "react" function EventBar({ props: { setMode, setTarget }, diff --git a/leaky-ships/components/Gamefield/Gamefield.tsx b/leaky-ships/components/Gamefield/Gamefield.tsx index a65b0be..0a34c0c 100644 --- a/leaky-ships/components/Gamefield/Gamefield.tsx +++ b/leaky-ships/components/Gamefield/Gamefield.tsx @@ -1,4 +1,3 @@ -import { CSSProperties } from "react" // import Bluetooth from './Bluetooth' import BorderTiles from "./BorderTiles" import EventBar from "./EventBar" @@ -6,8 +5,9 @@ import EventBar from "./EventBar" import HitElems from "./HitElems" import Labeling from "./Labeling" import Ships from "./Ships" -import useGameEvent from "@lib/hooks/useGameEvent" import Targets from "./Targets" +import useGameEvent from "@lib/hooks/useGameEvent" +import { CSSProperties } from "react" function Gamefield() { const count = 12 diff --git a/leaky-ships/components/Gamefield/GamefieldPointer.tsx b/leaky-ships/components/Gamefield/GamefieldPointer.tsx index 89473b0..6957a17 100644 --- a/leaky-ships/components/Gamefield/GamefieldPointer.tsx +++ b/leaky-ships/components/Gamefield/GamefieldPointer.tsx @@ -1,9 +1,9 @@ -import { faCrosshairs } from "@fortawesome/pro-solid-svg-icons" -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" -import { CSSProperties } from "react" -import classNames from "classnames" -import { faRadar } from "@fortawesome/pro-thin-svg-icons" import { Target, TargetList } from "../../interfaces/frontend" +import { faCrosshairs } from "@fortawesome/pro-solid-svg-icons" +import { faRadar } from "@fortawesome/pro-thin-svg-icons" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import classNames from "classnames" +import { CSSProperties } from "react" export interface PointerProps extends Target, TargetList { imply: boolean diff --git a/leaky-ships/components/Gamefield/HitElems.tsx b/leaky-ships/components/Gamefield/HitElems.tsx index c94d832..12b81f6 100644 --- a/leaky-ships/components/Gamefield/HitElems.tsx +++ b/leaky-ships/components/Gamefield/HitElems.tsx @@ -1,7 +1,7 @@ +import { Hit } from "../../interfaces/frontend" import { faBurst, faXmark } from "@fortawesome/pro-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { CSSProperties } from "react" -import { Hit } from "../../interfaces/frontend" function HitElems({ hits }: { hits: Hit[] }) { return ( diff --git a/leaky-ships/components/Gamefield/Labeling.tsx b/leaky-ships/components/Gamefield/Labeling.tsx index fdd8b5e..5b33d21 100644 --- a/leaky-ships/components/Gamefield/Labeling.tsx +++ b/leaky-ships/components/Gamefield/Labeling.tsx @@ -1,7 +1,7 @@ +import { Field } from "../../interfaces/frontend" +import { fieldIndex } from "@lib/utils/helpers" import classNames from "classnames" import { CSSProperties } from "react" -import { fieldIndex } from "@lib/utils/helpers" -import { Field } from "../../interfaces/frontend" function Labeling({ count }: { count: number }) { let elems: (Field & { diff --git a/leaky-ships/components/Gamefield/Targets.tsx b/leaky-ships/components/Gamefield/Targets.tsx index 38c2f29..9bc34a4 100644 --- a/leaky-ships/components/Gamefield/Targets.tsx +++ b/leaky-ships/components/Gamefield/Targets.tsx @@ -1,6 +1,6 @@ -import React from "react" import { Target } from "../../interfaces/frontend" import GamefieldPointer, { PointerProps } from "./GamefieldPointer" +import React from "react" function Targets({ props: { composeTargetTiles, target, targetPreview }, diff --git a/leaky-ships/components/Lobby/LobbyFrame.tsx b/leaky-ships/components/Lobby/LobbyFrame.tsx index de412ae..2026426 100644 --- a/leaky-ships/components/Lobby/LobbyFrame.tsx +++ b/leaky-ships/components/Lobby/LobbyFrame.tsx @@ -1,6 +1,6 @@ -import { Fragment, useEffect, useState } from "react" import Icon from "./Icon" import Player from "./Player" +import { Fragment, useEffect, useState } from "react" function LobbyFrame({ openSettings }: { openSettings: () => void }) { const [enemy, setEnemy] = useState(false) diff --git a/leaky-ships/components/Lobby/SettingsFrame/Settings.tsx b/leaky-ships/components/Lobby/SettingsFrame/Settings.tsx index ae1c9fe..28e93ce 100644 --- a/leaky-ships/components/Lobby/SettingsFrame/Settings.tsx +++ b/leaky-ships/components/Lobby/SettingsFrame/Settings.tsx @@ -1,8 +1,8 @@ -import { faXmark } from "@fortawesome/pro-solid-svg-icons" +import Setting from "./Setting" import { faRotateLeft } from "@fortawesome/pro-regular-svg-icons" +import { faXmark } from "@fortawesome/pro-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { useState } from "react" -import Setting from "./Setting" const settingOptionsInit: { [key: string]: boolean } = { allowSpectators: false, diff --git a/leaky-ships/components/OptionButton.tsx b/leaky-ships/components/OptionButton.tsx index d1ea5dd..77bb853 100644 --- a/leaky-ships/components/OptionButton.tsx +++ b/leaky-ships/components/OptionButton.tsx @@ -15,7 +15,7 @@ function OptionButton({ }) { return (