From 70dc0271dacceb5a8573b33b53d283037bc757fd Mon Sep 17 00:00:00 2001 From: JensForstmann Date: Tue, 8 Oct 2024 09:38:31 +0200 Subject: [PATCH] Reconfigure prettier --- .github/workflows/docker.yml | 2 +- .prettierignore | 12 - backend/swagger.json | 429 +++++++---------------------------- package.json | 4 +- 4 files changed, 83 insertions(+), 364 deletions(-) delete mode 100644 .prettierignore diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 08b21f9..3394fc0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -22,7 +22,7 @@ jobs: run: npm ci - name: Check syntax (prettier) - run: npx prettier --check . + run: npm run prettier-check build: runs-on: ubuntu-latest diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 5ff6e90..0000000 --- a/.prettierignore +++ /dev/null @@ -1,12 +0,0 @@ -lib -dist -doc -coverage -.yarn -.pnp.js -node_modules -.nyc_output -public -**/*.md -src/routes.ts -swagger.json diff --git a/backend/swagger.json b/backend/swagger.json index 1219c69..bb1becc 100644 --- a/backend/swagger.json +++ b/backend/swagger.json @@ -9,11 +9,7 @@ "schemas": { "TMatchState": { "type": "string", - "enum": [ - "ELECTION", - "MATCH_MAP", - "FINISHED" - ], + "enum": ["ELECTION", "MATCH_MAP", "FINISHED"], "description": "Possible match states." }, "ITeam": { @@ -33,10 +29,7 @@ "description": "Advantage in map wins, useful for double elemination tournament finals." } }, - "required": [ - "name", - "advantage" - ], + "required": ["name", "advantage"], "type": "object", "additionalProperties": false }, @@ -45,9 +38,7 @@ "properties": { "mode": { "type": "string", - "enum": [ - "FIXED" - ], + "enum": ["FIXED"], "nullable": false }, "fixed": { @@ -55,40 +46,27 @@ "description": "The name of the map, e.g. de_anubis." } }, - "required": [ - "mode", - "fixed" - ], + "required": ["mode", "fixed"], "type": "object", "additionalProperties": false }, "TWho": { "type": "string", - "enum": [ - "TEAM_A", - "TEAM_B", - "TEAM_X", - "TEAM_Y" - ] + "enum": ["TEAM_A", "TEAM_B", "TEAM_X", "TEAM_Y"] }, "IPickMap": { "description": "Pick a map from the map pool.", "properties": { "mode": { "type": "string", - "enum": [ - "PICK" - ], + "enum": ["PICK"], "nullable": false }, "who": { "$ref": "#/components/schemas/TWho" } }, - "required": [ - "mode", - "who" - ], + "required": ["mode", "who"], "type": "object", "additionalProperties": false }, @@ -97,15 +75,10 @@ "properties": { "mode": { "type": "string", - "enum": [ - "RANDOM_PICK", - "AGREE" - ] + "enum": ["RANDOM_PICK", "AGREE"] } }, - "required": [ - "mode" - ], + "required": ["mode"], "type": "object", "additionalProperties": false }, @@ -127,19 +100,14 @@ "properties": { "mode": { "type": "string", - "enum": [ - "FIXED" - ], + "enum": ["FIXED"], "nullable": false }, "fixed": { "$ref": "#/components/schemas/TSideFixed" } }, - "required": [ - "mode", - "fixed" - ], + "required": ["mode", "fixed"], "type": "object", "additionalProperties": false }, @@ -148,19 +116,14 @@ "properties": { "mode": { "type": "string", - "enum": [ - "PICK" - ], + "enum": ["PICK"], "nullable": false }, "who": { "$ref": "#/components/schemas/TWho" } }, - "required": [ - "mode", - "who" - ], + "required": ["mode", "who"], "type": "object", "additionalProperties": false }, @@ -169,15 +132,10 @@ "properties": { "mode": { "type": "string", - "enum": [ - "RANDOM", - "KNIFE" - ] + "enum": ["RANDOM", "KNIFE"] } }, - "required": [ - "mode" - ], + "required": ["mode"], "type": "object", "additionalProperties": false }, @@ -211,10 +169,7 @@ ] } }, - "required": [ - "map", - "side" - ], + "required": ["map", "side"], "type": "object", "additionalProperties": false }, @@ -223,15 +178,11 @@ "properties": { "mode": { "type": "string", - "enum": [ - "RANDOM_BAN" - ], + "enum": ["RANDOM_BAN"], "nullable": false } }, - "required": [ - "mode" - ], + "required": ["mode"], "type": "object", "additionalProperties": false }, @@ -240,19 +191,14 @@ "properties": { "mode": { "type": "string", - "enum": [ - "BAN" - ], + "enum": ["BAN"], "nullable": false }, "who": { "$ref": "#/components/schemas/TWho" } }, - "required": [ - "mode", - "who" - ], + "required": ["mode", "who"], "type": "object", "additionalProperties": false }, @@ -270,9 +216,7 @@ ] } }, - "required": [ - "map" - ], + "required": ["map"], "type": "object", "additionalProperties": false }, @@ -289,25 +233,15 @@ }, "TElectionState": { "type": "string", - "enum": [ - "NOT_STARTED", - "IN_PROGRESS", - "FINISHED" - ] + "enum": ["NOT_STARTED", "IN_PROGRESS", "FINISHED"] }, "TTeamAB": { "type": "string", - "enum": [ - "TEAM_A", - "TEAM_B" - ] + "enum": ["TEAM_A", "TEAM_B"] }, "TStep": { "type": "string", - "enum": [ - "MAP", - "SIDE" - ] + "enum": ["MAP", "SIDE"] }, "IElection": { "properties": { @@ -351,10 +285,7 @@ "nullable": true } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object", "description": "Holds the wanted maps of each team." }, @@ -367,10 +298,7 @@ "type": "boolean" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object", "description": "The election process can be restarted if both teams vote for it." } @@ -403,11 +331,7 @@ "description": "If plebs (client without an admin token) create a match the hideRconPassword attribute is set to true.\nThis will prevent executing rcon commands from the frontend by the (unauthorized) user." } }, - "required": [ - "ip", - "port", - "rconPassword" - ], + "required": ["ip", "port", "rconPassword"], "type": "object", "additionalProperties": false }, @@ -454,10 +378,7 @@ "type": "boolean" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object" }, "knifeRestart": { @@ -469,10 +390,7 @@ "type": "boolean" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object" }, "score": { @@ -486,10 +404,7 @@ "format": "double" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object", "description": "Current score of both teams." }, @@ -525,26 +440,17 @@ }, "TMatchEndAction": { "type": "string", - "enum": [ - "KICK_ALL", - "QUIT_SERVER", - "NONE" - ] + "enum": ["KICK_ALL", "QUIT_SERVER", "NONE"] }, "TLogType": { "type": "string", - "enum": [ - "CHAT", - "SYSTEM" - ] + "enum": ["CHAT", "SYSTEM"] }, "ILogChat": { "properties": { "type": { "type": "string", - "enum": [ - "CHAT" - ], + "enum": ["CHAT"], "nullable": false }, "timestamp": { @@ -561,32 +467,19 @@ "type": "string" } }, - "required": [ - "type", - "timestamp", - "isTeamChat", - "steamId64", - "message" - ], + "required": ["type", "timestamp", "isTeamChat", "steamId64", "message"], "type": "object", "additionalProperties": false }, "TSystemLogCategory": { "type": "string", - "enum": [ - "ERROR", - "WARN", - "INFO", - "DEBUG" - ] + "enum": ["ERROR", "WARN", "INFO", "DEBUG"] }, "ILogSystem": { "properties": { "type": { "type": "string", - "enum": [ - "SYSTEM" - ], + "enum": ["SYSTEM"], "nullable": false }, "timestamp": { @@ -600,12 +493,7 @@ "type": "string" } }, - "required": [ - "type", - "timestamp", - "category", - "message" - ], + "required": ["type", "timestamp", "category", "message"], "type": "object", "additionalProperties": false }, @@ -621,10 +509,7 @@ }, "TTeamSides": { "type": "string", - "enum": [ - "CT", - "T" - ] + "enum": ["CT", "T"] }, "IPlayer": { "description": "Player.", @@ -655,19 +540,13 @@ "description": "Player currently on the game server (online)?" } }, - "required": [ - "steamId64", - "name" - ], + "required": ["steamId64", "name"], "type": "object", "additionalProperties": false }, "TMatchMode": { "type": "string", - "enum": [ - "SINGLE", - "LOOP" - ], + "enum": ["SINGLE", "LOOP"], "description": "Possible match modes." }, "IMatch": { @@ -777,12 +656,7 @@ "description": "executed exactly once on match init" } }, - "required": [ - "end", - "match", - "knife", - "init" - ], + "required": ["end", "match", "knife", "init"], "type": "object" }, "canClinch": { @@ -881,9 +755,7 @@ "description": "Advantage in map wins, useful for double elemination tournament finals." } }, - "required": [ - "name" - ], + "required": ["name"], "type": "object", "additionalProperties": false }, @@ -991,13 +863,7 @@ "description": "Match mode (single: stops when match is finished, loop: starts again after match is finished)" } }, - "required": [ - "mapPool", - "teamA", - "teamB", - "electionSteps", - "gameServer" - ], + "required": ["mapPool", "teamA", "teamB", "electionSteps", "gameServer"], "type": "object", "additionalProperties": false }, @@ -1108,12 +974,7 @@ "description": "executed exactly once on match init" } }, - "required": [ - "end", - "match", - "knife", - "init" - ], + "required": ["end", "match", "knife", "init"], "type": "object" }, "canClinch": { @@ -1203,13 +1064,7 @@ }, "TTeamString": { "type": "string", - "enum": [ - "Unassigned", - "CT", - "TERRORIST", - "", - "Spectator" - ], + "enum": ["Unassigned", "CT", "TERRORIST", "", "Spectator"], "description": "Possible ingame sides of a player." }, "EventType": { @@ -1245,9 +1100,7 @@ }, "type": { "type": "string", - "enum": [ - "CHAT" - ], + "enum": ["CHAT"], "nullable": false }, "player": { @@ -1306,9 +1159,7 @@ }, "type": { "type": "string", - "enum": [ - "MAP_ELECTION_END" - ], + "enum": ["MAP_ELECTION_END"], "nullable": false }, "mapNames": { @@ -1318,13 +1169,7 @@ "type": "array" } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "mapNames" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "mapNames"], "type": "object", "additionalProperties": false }, @@ -1343,9 +1188,7 @@ }, "type": { "type": "string", - "enum": [ - "ROUND_END" - ], + "enum": ["ROUND_END"], "nullable": false }, "mapIndex": { @@ -1402,9 +1245,7 @@ }, "type": { "type": "string", - "enum": [ - "MAP_END" - ], + "enum": ["MAP_END"], "nullable": false }, "mapIndex": { @@ -1467,9 +1308,7 @@ }, "type": { "type": "string", - "enum": [ - "MATCH_END" - ], + "enum": ["MATCH_END"], "nullable": false }, "wonMapsTeamA": { @@ -1515,12 +1354,7 @@ "type": "string" } }, - "required": [ - "winnerTeam", - "scoreTeamB", - "scoreTeamA", - "mapName" - ], + "required": ["winnerTeam", "scoreTeamB", "scoreTeamA", "mapName"], "type": "object" }, "type": "array", @@ -1561,9 +1395,7 @@ }, "type": { "type": "string", - "enum": [ - "KNIFE_END" - ], + "enum": ["KNIFE_END"], "nullable": false }, "mapIndex": { @@ -1610,9 +1442,7 @@ }, "type": { "type": "string", - "enum": [ - "MAP_START" - ], + "enum": ["MAP_START"], "nullable": false }, "mapIndex": { @@ -1655,35 +1485,20 @@ }, "type": { "type": "string", - "enum": [ - "LOG" - ], + "enum": ["LOG"], "nullable": false }, "message": { "type": "string" } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "message" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "message"], "type": "object", "additionalProperties": false }, "TMapMode": { "type": "string", - "enum": [ - "FIXED", - "PICK", - "RANDOM_PICK", - "AGREE", - "BAN", - "RANDOM_BAN" - ], + "enum": ["FIXED", "PICK", "RANDOM_PICK", "AGREE", "BAN", "RANDOM_BAN"], "description": "Possible map modes for a election step." }, "ElectionMapStep": { @@ -1701,9 +1516,7 @@ }, "type": { "type": "string", - "enum": [ - "ELECTION_MAP_STEP" - ], + "enum": ["ELECTION_MAP_STEP"], "nullable": false }, "mode": { @@ -1716,25 +1529,13 @@ "$ref": "#/components/schemas/ITeam" } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "mode", - "mapName" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "mode", "mapName"], "type": "object", "additionalProperties": false }, "TSideMode": { "type": "string", - "enum": [ - "KNIFE", - "FIXED", - "PICK", - "RANDOM" - ], + "enum": ["KNIFE", "FIXED", "PICK", "RANDOM"], "description": "Possible side modes to determine the starting sides of each team." }, "ElectionSideStep": { @@ -1752,9 +1553,7 @@ }, "type": { "type": "string", - "enum": [ - "ELECTION_SIDE_STEP" - ], + "enum": ["ELECTION_SIDE_STEP"], "nullable": false }, "mode": { @@ -1773,13 +1572,7 @@ "$ref": "#/components/schemas/ITeam" } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "mode" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "mode"], "type": "object", "additionalProperties": false }, @@ -1798,22 +1591,14 @@ }, "type": { "type": "string", - "enum": [ - "MATCH_CREATE" - ], + "enum": ["MATCH_CREATE"], "nullable": false }, "match": { "$ref": "#/components/schemas/IMatchResponse" } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "match" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "match"], "type": "object", "additionalProperties": false }, @@ -1832,9 +1617,7 @@ }, "type": { "type": "string", - "enum": [ - "MATCH_UPDATE" - ], + "enum": ["MATCH_UPDATE"], "nullable": false }, "path": { @@ -1853,14 +1636,7 @@ }, "value": {} }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type", - "path", - "value" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type", "path", "value"], "type": "object", "additionalProperties": false }, @@ -1879,18 +1655,11 @@ }, "type": { "type": "string", - "enum": [ - "MATCH_STOP" - ], + "enum": ["MATCH_STOP"], "nullable": false } }, - "required": [ - "timestamp", - "matchId", - "matchPassthrough", - "type" - ], + "required": ["timestamp", "matchId", "matchPassthrough", "type"], "type": "object", "additionalProperties": false }, @@ -2019,11 +1788,7 @@ }, "matchEndAction": { "type": "string", - "enum": [ - "KICK_ALL", - "QUIT_SERVER", - "NONE" - ], + "enum": ["KICK_ALL", "QUIT_SERVER", "NONE"], "description": "defaults to NONE" }, "tmtLogAddress": { @@ -2094,10 +1859,7 @@ "type": "boolean" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object" }, "knifeRestart": { @@ -2109,10 +1871,7 @@ "type": "boolean" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object" }, "score": { @@ -2126,10 +1885,7 @@ "format": "double" } }, - "required": [ - "teamB", - "teamA" - ], + "required": ["teamB", "teamA"], "type": "object", "description": "Current score of both teams." }, @@ -2185,13 +1941,7 @@ "description": "Match id which is currently using this managed game server." } }, - "required": [ - "ip", - "port", - "rconPassword", - "canBeUsed", - "usedBy" - ], + "required": ["ip", "port", "rconPassword", "canBeUsed", "usedBy"], "type": "object", "additionalProperties": false }, @@ -2216,11 +1966,7 @@ "description": "Can the server be used for new matches?" } }, - "required": [ - "ip", - "port", - "rconPassword" - ], + "required": ["ip", "port", "rconPassword"], "type": "object", "additionalProperties": false }, @@ -2246,10 +1992,7 @@ "description": "Set or delete the link to a match. If it's null and `canBeUsed` is true, the game server is available." } }, - "required": [ - "ip", - "port" - ], + "required": ["ip", "port"], "type": "object", "additionalProperties": false }, @@ -2303,9 +2046,7 @@ "nullable": true } }, - "required": [ - "tmtLogAddress" - ], + "required": ["tmtLogAddress"], "type": "object", "additionalProperties": false }, @@ -2324,11 +2065,7 @@ "type": "string" } }, - "required": [ - "name", - "data", - "id" - ], + "required": ["name", "data", "id"], "type": "object", "additionalProperties": false }, @@ -2344,10 +2081,7 @@ "$ref": "#/components/schemas/IMatchCreateDto" } }, - "required": [ - "name", - "data" - ], + "required": ["name", "data"], "type": "object", "additionalProperties": false } @@ -2684,10 +2418,7 @@ "type": "array" } }, - "required": [ - "total", - "latestFiles" - ], + "required": ["total", "latestFiles"], "type": "object" }, {} @@ -3324,4 +3055,4 @@ "url": "/" } ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index 1dd2610..d86cb66 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "scripts": { "build": "cd backend && npm run build && cd ../frontend && npm run build", "dev": "cd backend && npm run dev & cd frontend && npm run dev", - "clean": "prettier --write .", - "prettier-check": "prettier --check ." + "clean": "prettier '!**/*md' . --write", + "prettier-check": "prettier '!**/*md' . --check" }, "devDependencies": { "prettier": "^3.3.3",