diff --git a/.eslintrc b/.eslintrc index fd4742bdd..92ffac8a8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -27,6 +27,9 @@ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", "@typescript-eslint/no-redundant-type-constituents": "off", "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/consistent-type-imports": "error" + "@typescript-eslint/consistent-type-imports": [ + "error", + { "prefer": "type-imports", "fixStyle": "inline-type-imports" } + ] } } diff --git a/apps/api/src/controllers/admin/admin-controller.ts b/apps/api/src/controllers/admin/admin-controller.ts index 5449e6673..1fc083f4b 100644 --- a/apps/api/src/controllers/admin/admin-controller.ts +++ b/apps/api/src/controllers/admin/admin-controller.ts @@ -6,7 +6,7 @@ import { join } from "node:path"; import { stat } from "node:fs/promises"; import { Res, UseBefore } from "@tsed/common"; import { IsAuth } from "middlewares/auth/is-auth"; -import { Prisma, WhitelistStatus } from "@prisma/client"; +import { type Prisma, WhitelistStatus } from "@prisma/client"; import { UsePermissions } from "middlewares/use-permissions"; import { defaultPermissions, Permissions } from "@snailycad/permissions"; import type { GetAdminDashboardData } from "@snailycad/types/api"; diff --git a/apps/api/src/controllers/admin/import/import-citizens-controller.ts b/apps/api/src/controllers/admin/import/import-citizens-controller.ts index 396e773eb..36c3cfcc4 100644 --- a/apps/api/src/controllers/admin/import/import-citizens-controller.ts +++ b/apps/api/src/controllers/admin/import/import-citizens-controller.ts @@ -6,7 +6,7 @@ import { QueryParams, BodyParams, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, UseBeforeEach, } from "@tsed/common"; import { IsAuth } from "middlewares/auth/is-auth"; diff --git a/apps/api/src/controllers/admin/import/import-vehicles-controller.ts b/apps/api/src/controllers/admin/import/import-vehicles-controller.ts index 2d2ef8885..d290b1996 100644 --- a/apps/api/src/controllers/admin/import/import-vehicles-controller.ts +++ b/apps/api/src/controllers/admin/import/import-vehicles-controller.ts @@ -6,7 +6,7 @@ import { BodyParams, MultipartFile, PathParams, - PlatformMulterFile, + type PlatformMulterFile, QueryParams, UseBeforeEach, } from "@tsed/common"; diff --git a/apps/api/src/controllers/admin/import/import-weapons-controller.ts b/apps/api/src/controllers/admin/import/import-weapons-controller.ts index bc9833291..0889fcb02 100644 --- a/apps/api/src/controllers/admin/import/import-weapons-controller.ts +++ b/apps/api/src/controllers/admin/import/import-weapons-controller.ts @@ -6,7 +6,7 @@ import { BodyParams, MultipartFile, PathParams, - PlatformMulterFile, + type PlatformMulterFile, QueryParams, UseBeforeEach, } from "@tsed/common"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-controller.ts b/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-controller.ts index 6b006645d..ddb70a511 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-controller.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-controller.ts @@ -12,11 +12,17 @@ import { ContentType, Delete, Description, Get, Post, Put } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { CAD_SELECT, IsAuth, setCADFeatures } from "middlewares/auth/is-auth"; import { BadRequest, NotFound } from "@tsed/exceptions"; -import { MultipartFile, PlatformMulterFile, Req, Res, UseBefore } from "@tsed/common"; -import { Socket } from "services/socket-service"; +import { MultipartFile, type PlatformMulterFile, Req, Res, UseBefore } from "@tsed/common"; +import { type Socket } from "services/socket-service"; import { nanoid } from "nanoid"; import { validateSchema } from "lib/data/validate-schema"; -import { ApiToken, cad, Feature, JailTimeScale, Prisma } from "@prisma/client"; +import { + type ApiToken, + type cad, + type Feature, + type JailTimeScale, + type Prisma, +} from "@prisma/client"; import { getCADVersion } from "@snailycad/utils/version"; import { getSessionUser, userProperties } from "lib/auth/getSessionUser"; import type * as APITypes from "@snailycad/types/api"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-images-controller.ts b/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-images-controller.ts index 27c5a580b..37aa137a8 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-images-controller.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/cad-settings-images-controller.ts @@ -4,10 +4,10 @@ import { ContentType, Post } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { CAD_SELECT, IsAuth } from "middlewares/auth/is-auth"; import { BadRequest } from "@tsed/exceptions"; -import { MultipartFile, PlatformMulterFile, UseBefore } from "@tsed/common"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { MultipartFile, type PlatformMulterFile, UseBefore } from "@tsed/common"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import fs from "node:fs/promises"; -import { cad, Feature, MiscCadSettings } from "@prisma/client"; +import { type cad, type Feature, type MiscCadSettings } from "@prisma/client"; import { Permissions, hasPermission } from "@snailycad/permissions"; import { UsePermissions } from "middlewares/use-permissions"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordSettingsController.ts b/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordSettingsController.ts index 30647dbd6..5728ba607 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordSettingsController.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordSettingsController.ts @@ -1,10 +1,10 @@ import process from "node:process"; import { BodyParams, Context, Controller, UseBeforeEach } from "@tsed/common"; import { ContentType, Get, Post } from "@tsed/schema"; -import { RESTGetAPIGuildRolesResult, Routes } from "discord-api-types/v10"; +import { type RESTGetAPIGuildRolesResult, Routes } from "discord-api-types/v10"; import { IsAuth } from "middlewares/auth/is-auth"; import { prisma } from "lib/data/prisma"; -import { cad, DiscordRole } from "@prisma/client"; +import { type cad, type DiscordRole } from "@prisma/client"; import { BadRequest } from "@tsed/exceptions"; import { DISCORD_SETTINGS_SCHEMA } from "@snailycad/schemas"; import { validateSchema } from "lib/data/validate-schema"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordWebhooksController.ts b/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordWebhooksController.ts index d7648907c..0e941f25c 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordWebhooksController.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/discord/DiscordWebhooksController.ts @@ -2,15 +2,20 @@ import process from "node:process"; import { BodyParams, Context, Controller, UseBeforeEach } from "@tsed/common"; import { ContentType, Get, Post } from "@tsed/schema"; import { - APITextChannel, + type APITextChannel, ChannelType, - RESTGetAPIGuildChannelsResult, - RESTGetAPIWebhookResult, + type RESTGetAPIGuildChannelsResult, + type RESTGetAPIWebhookResult, Routes, } from "discord-api-types/v10"; import { IsAuth } from "middlewares/auth/is-auth"; import { prisma } from "lib/data/prisma"; -import { cad, DiscordWebhook, DiscordWebhookType, MiscCadSettings } from "@prisma/client"; +import { + type cad, + type DiscordWebhook, + type DiscordWebhookType, + type MiscCadSettings, +} from "@prisma/client"; import { BadRequest } from "@tsed/exceptions"; import { DISCORD_WEBHOOKS_SCHEMA } from "@snailycad/schemas"; import { validateSchema } from "lib/data/validate-schema"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/live-map-controller.ts b/apps/api/src/controllers/admin/manage/cad-settings/live-map-controller.ts index e622f2533..10f18a469 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/live-map-controller.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/live-map-controller.ts @@ -4,9 +4,9 @@ import { BodyParams, Context } from "@tsed/platform-params"; import { ContentType, Put } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; -import { MultipartFile, PlatformMulterFile, UseBefore } from "@tsed/common"; +import { MultipartFile, type PlatformMulterFile, UseBefore } from "@tsed/common"; import { validateSchema } from "lib/data/validate-schema"; -import { cad } from "@prisma/client"; +import { type cad } from "@prisma/client"; import type * as APITypes from "@snailycad/types/api"; import { Permissions, UsePermissions } from "middlewares/use-permissions"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; diff --git a/apps/api/src/controllers/admin/manage/cad-settings/raw-webhooks-controller.ts b/apps/api/src/controllers/admin/manage/cad-settings/raw-webhooks-controller.ts index 851594578..00e23d34d 100644 --- a/apps/api/src/controllers/admin/manage/cad-settings/raw-webhooks-controller.ts +++ b/apps/api/src/controllers/admin/manage/cad-settings/raw-webhooks-controller.ts @@ -1,7 +1,7 @@ import type { DiscordWebhookType, RawWebhook } from "@prisma/client"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; import { RAW_WEBHOOKS_SCHEMA } from "@snailycad/schemas"; -import { cad } from "@snailycad/types"; +import { type cad } from "@snailycad/types"; import { BodyParams, Context, UseBeforeEach } from "@tsed/common"; import { Controller } from "@tsed/di"; import { ContentType, Get, Post } from "@tsed/schema"; diff --git a/apps/api/src/controllers/admin/manage/citizens/records-logs-controller.ts b/apps/api/src/controllers/admin/manage/citizens/records-logs-controller.ts index eb5f25b1f..eb369c837 100644 --- a/apps/api/src/controllers/admin/manage/citizens/records-logs-controller.ts +++ b/apps/api/src/controllers/admin/manage/citizens/records-logs-controller.ts @@ -11,7 +11,7 @@ import { Prisma, WhitelistStatus } from "@prisma/client"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import type * as APITypes from "@snailycad/types/api"; -import { AcceptDeclineType, ACCEPT_DECLINE_TYPES } from "../units/manage-units-controller"; +import { type AcceptDeclineType, ACCEPT_DECLINE_TYPES } from "../units/manage-units-controller"; import { BadRequest, NotFound } from "@tsed/exceptions"; export const recordsLogsInclude = { diff --git a/apps/api/src/controllers/admin/manage/courthouse/pending-warrants-controller.ts b/apps/api/src/controllers/admin/manage/courthouse/pending-warrants-controller.ts index ebe4dfe6e..d1a2844e3 100644 --- a/apps/api/src/controllers/admin/manage/courthouse/pending-warrants-controller.ts +++ b/apps/api/src/controllers/admin/manage/courthouse/pending-warrants-controller.ts @@ -1,4 +1,4 @@ -import { Warrant, WarrantStatus, WhitelistStatus } from "@prisma/client"; +import { type Warrant, WarrantStatus, WhitelistStatus } from "@prisma/client"; import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { UseBeforeEach } from "@tsed/platform-middlewares"; diff --git a/apps/api/src/controllers/admin/manage/manage-businesses-controller.ts b/apps/api/src/controllers/admin/manage/manage-businesses-controller.ts index 98bc0ebc0..e49732fe7 100644 --- a/apps/api/src/controllers/admin/manage/manage-businesses-controller.ts +++ b/apps/api/src/controllers/admin/manage/manage-businesses-controller.ts @@ -1,4 +1,4 @@ -import { Prisma, WhitelistStatus } from "@prisma/client"; +import { type Prisma, WhitelistStatus } from "@prisma/client"; import { Controller } from "@tsed/di"; import { NotFound } from "@tsed/exceptions"; import { UseBeforeEach } from "@tsed/platform-middlewares"; diff --git a/apps/api/src/controllers/admin/manage/manage-custom-fields-controller.ts b/apps/api/src/controllers/admin/manage/manage-custom-fields-controller.ts index 761234b57..911ce4028 100644 --- a/apps/api/src/controllers/admin/manage/manage-custom-fields-controller.ts +++ b/apps/api/src/controllers/admin/manage/manage-custom-fields-controller.ts @@ -1,4 +1,4 @@ -import { CustomFieldCategory, Prisma } from "@prisma/client"; +import { type CustomFieldCategory, type Prisma } from "@prisma/client"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; import { CUSTOM_FIELDS_SCHEMA } from "@snailycad/schemas"; import { BodyParams, Context, PathParams, QueryParams, UseBeforeEach } from "@tsed/common"; diff --git a/apps/api/src/controllers/admin/manage/manage-custom-roles-controller.ts b/apps/api/src/controllers/admin/manage/manage-custom-roles-controller.ts index 6db1be60b..dbe73a7e1 100644 --- a/apps/api/src/controllers/admin/manage/manage-custom-roles-controller.ts +++ b/apps/api/src/controllers/admin/manage/manage-custom-roles-controller.ts @@ -1,12 +1,12 @@ -import { Prisma } from "@prisma/client"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type Prisma } from "@prisma/client"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { CUSTOM_ROLE_SCHEMA } from "@snailycad/schemas"; import { BodyParams, Context, MultipartFile, PathParams, - PlatformMulterFile, + type PlatformMulterFile, QueryParams, UseBeforeEach, } from "@tsed/common"; diff --git a/apps/api/src/controllers/admin/manage/manage-users-controller.ts b/apps/api/src/controllers/admin/manage/manage-users-controller.ts index 7b98c792f..8d6aac6a1 100644 --- a/apps/api/src/controllers/admin/manage/manage-users-controller.ts +++ b/apps/api/src/controllers/admin/manage/manage-users-controller.ts @@ -2,9 +2,9 @@ import { Rank, WhitelistStatus, - User, + type User, Prisma, - CustomRole, + type CustomRole, DiscordWebhookType, } from "@prisma/client"; import { PathParams, BodyParams, Context, QueryParams } from "@tsed/common"; @@ -21,7 +21,7 @@ import { PERMISSIONS_SCHEMA, ROLES_SCHEMA, } from "@snailycad/schemas"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { nanoid } from "nanoid"; import { genSaltSync, hashSync } from "bcrypt"; import { citizenInclude } from "controllers/citizen/CitizenController"; @@ -34,7 +34,7 @@ import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger import { isDiscordIdInUse } from "lib/discord/utils"; import { getTranslator } from "~/utils/get-translator"; import { sendRawWebhook, sendDiscordWebhook } from "~/lib/discord/webhooks"; -import { APIEmbed } from "discord-api-types/v10"; +import { type APIEmbed } from "discord-api-types/v10"; const manageUsersSelect = (selectCitizens: boolean) => ({ diff --git a/apps/api/src/controllers/admin/manage/units/manage-units-controller.ts b/apps/api/src/controllers/admin/manage/units/manage-units-controller.ts index bea49fad7..e6b28014d 100644 --- a/apps/api/src/controllers/admin/manage/units/manage-units-controller.ts +++ b/apps/api/src/controllers/admin/manage/units/manage-units-controller.ts @@ -2,10 +2,10 @@ import { Feature, WhitelistStatus, - cad, - MiscCadSettings, + type cad, + type MiscCadSettings, DiscordWebhookType, - Officer, + type Officer, } from "@prisma/client"; import { UPDATE_UNIT_SCHEMA, UPDATE_UNIT_CALLSIGN_SCHEMA } from "@snailycad/schemas"; import { @@ -14,7 +14,7 @@ import { Context, QueryParams, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, } from "@tsed/common"; import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; @@ -28,12 +28,12 @@ import { prisma } from "lib/data/prisma"; import { validateSchema } from "lib/data/validate-schema"; import { IsAuth } from "middlewares/auth/is-auth"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; import { manyToManyHelper } from "lib/data/many-to-many"; import type * as APITypes from "@snailycad/types/api"; import { isFeatureEnabled } from "lib/upsert-cad"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { validateImageURL } from "lib/images/validate-image-url"; import generateBlurPlaceholder from "lib/images/generate-image-blur-data"; import fs from "node:fs/promises"; @@ -48,9 +48,9 @@ import { combinedEmsFdUnitProperties, } from "utils/leo/includes"; import { getTranslator } from "~/utils/get-translator"; -import { APIEmbed } from "discord-api-types/v10"; +import { type APIEmbed } from "discord-api-types/v10"; import { sendRawWebhook, sendDiscordWebhook } from "~/lib/discord/webhooks"; -import { Citizen, EmsFdDeputy, LeoWhitelistStatus } from "@snailycad/types"; +import { type Citizen, type EmsFdDeputy, type LeoWhitelistStatus } from "@snailycad/types"; import { generateCallsign } from "@snailycad/utils"; const ACTIONS = ["SET_DEPARTMENT_DEFAULT", "SET_DEPARTMENT_NULL", "DELETE_UNIT"] as const; diff --git a/apps/api/src/controllers/admin/values/import-values-controller.ts b/apps/api/src/controllers/admin/values/import-values-controller.ts index e11bc4367..35606388a 100644 --- a/apps/api/src/controllers/admin/values/import-values-controller.ts +++ b/apps/api/src/controllers/admin/values/import-values-controller.ts @@ -3,7 +3,7 @@ import { PathParams, UseBeforeEach, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, Context, } from "@tsed/common"; import { ContentType, Post } from "@tsed/schema"; @@ -36,10 +36,10 @@ import { type QualificationValueType, WhatPages, ValueType, - Value, - cad, - PenalCodeType, - Feature, + type Value, + type cad, + type PenalCodeType, + type Feature, } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; import { upsertWarningApplicable } from "~/lib/leo/records/penal-code"; diff --git a/apps/api/src/controllers/admin/values/values-controller.ts b/apps/api/src/controllers/admin/values/values-controller.ts index 55cab2be0..5ec6dc5b0 100644 --- a/apps/api/src/controllers/admin/values/values-controller.ts +++ b/apps/api/src/controllers/admin/values/values-controller.ts @@ -6,7 +6,7 @@ import { BodyParams, QueryParams, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, Context, } from "@tsed/common"; import fs from "node:fs/promises"; @@ -17,10 +17,14 @@ import { BadRequest, NotFound } from "@tsed/exceptions"; import { IsAuth } from "middlewares/auth/is-auth"; import { typeHandlers } from "./import-values-controller"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; -import { ValuesSelect, getTypeFromPath, getPermissionsForValuesRequest } from "lib/values/utils"; +import { + type ValuesSelect, + getTypeFromPath, + getPermissionsForValuesRequest, +} from "lib/values/utils"; import { ValueType } from "@prisma/client"; import { UsePermissions } from "middlewares/use-permissions"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import type * as APITypes from "@snailycad/types/api"; import { getImageWebPPath } from "lib/images/get-image-webp-path"; import { BULK_DELETE_SCHEMA } from "@snailycad/schemas"; diff --git a/apps/api/src/controllers/auth/auth-controller.ts b/apps/api/src/controllers/auth/auth-controller.ts index d725bc830..f8b7d102d 100644 --- a/apps/api/src/controllers/auth/auth-controller.ts +++ b/apps/api/src/controllers/auth/auth-controller.ts @@ -1,4 +1,4 @@ -import { Controller, BodyParams, Post, Res, Response } from "@tsed/common"; +import { Controller, BodyParams, Post, Res, type Response } from "@tsed/common"; import { hashSync, genSaltSync, compareSync } from "bcrypt"; import { BadRequest } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; @@ -9,7 +9,14 @@ import { ExtendedNotFound } from "src/exceptions/extended-not-found"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; import { validateUser2FA } from "lib/auth/2fa"; import { ContentType, Description, Returns } from "@tsed/schema"; -import { User, WhitelistStatus, Rank, AutoSetUserProperties, cad, Feature } from "@prisma/client"; +import { + type User, + WhitelistStatus, + Rank, + type AutoSetUserProperties, + type cad, + Feature, +} from "@prisma/client"; import { defaultPermissions, Permissions } from "@snailycad/permissions"; import { setUserPreferencesCookies } from "lib/auth/setUserPreferencesCookies"; import type * as APITypes from "@snailycad/types/api"; diff --git a/apps/api/src/controllers/auth/discord-auth-controller.ts b/apps/api/src/controllers/auth/discord-auth-controller.ts index f497602b4..130b615c3 100644 --- a/apps/api/src/controllers/auth/discord-auth-controller.ts +++ b/apps/api/src/controllers/auth/discord-auth-controller.ts @@ -7,7 +7,7 @@ import { request } from "undici"; import type { RESTPostOAuth2AccessTokenResult, APIUser } from "discord-api-types/v10"; import { prisma } from "lib/data/prisma"; import { getSessionUser } from "lib/auth/getSessionUser"; -import { cad, Feature, Rank, WhitelistStatus, type User } from "@prisma/client"; +import { type cad, Feature, Rank, WhitelistStatus, type User } from "@prisma/client"; import { getDefaultPermissionsForNewUser } from "./auth-controller"; import { IsAuth } from "middlewares/auth/is-auth"; import { DISCORD_API_URL } from "lib/discord/config"; diff --git a/apps/api/src/controllers/auth/steam-auth-controller.ts b/apps/api/src/controllers/auth/steam-auth-controller.ts index f82e71c8c..387257c6b 100644 --- a/apps/api/src/controllers/auth/steam-auth-controller.ts +++ b/apps/api/src/controllers/auth/steam-auth-controller.ts @@ -4,7 +4,7 @@ import { BadRequest } from "@tsed/exceptions"; import { Controller } from "@tsed/di"; import { URL } from "node:url"; import { prisma } from "lib/data/prisma"; -import { Rank, User, WhitelistStatus } from "@prisma/client"; +import { Rank, type User, WhitelistStatus } from "@prisma/client"; import { IsAuth } from "middlewares/auth/is-auth"; import { ContentType, Description } from "@tsed/schema"; import { request } from "undici"; diff --git a/apps/api/src/controllers/auth/user/user-api-token-controller.ts b/apps/api/src/controllers/auth/user/user-api-token-controller.ts index 7f325d314..aff9054b0 100644 --- a/apps/api/src/controllers/auth/user/user-api-token-controller.ts +++ b/apps/api/src/controllers/auth/user/user-api-token-controller.ts @@ -1,4 +1,4 @@ -import { ApiToken, User } from "@snailycad/types"; +import { type ApiToken, type User } from "@snailycad/types"; import { BodyParams, Context } from "@tsed/common"; import { Controller } from "@tsed/di"; import { BadRequest } from "@tsed/exceptions"; diff --git a/apps/api/src/controllers/auth/user/user-controller.ts b/apps/api/src/controllers/auth/user/user-controller.ts index aaa945c09..15db03560 100644 --- a/apps/api/src/controllers/auth/user/user-controller.ts +++ b/apps/api/src/controllers/auth/user/user-controller.ts @@ -6,7 +6,13 @@ import { Cookie } from "@snailycad/config"; import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { setCookie } from "utils/set-cookie"; -import { cad, Rank, ShouldDoType, StatusViewMode, TableActionsAlignment } from "@prisma/client"; +import { + type cad, + Rank, + ShouldDoType, + type StatusViewMode, + type TableActionsAlignment, +} from "@prisma/client"; import { NotFound } from "@tsed/exceptions"; import { CHANGE_PASSWORD_SCHEMA, @@ -17,7 +23,7 @@ import { compareSync, genSaltSync, hashSync } from "bcrypt"; import { userProperties } from "lib/auth/getSessionUser"; import { validateSchema } from "lib/data/validate-schema"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { handleStartEndOfficerLog } from "lib/leo/handleStartEndOfficerLog"; import { setUserPreferencesCookies } from "lib/auth/setUserPreferencesCookies"; import type * as APITypes from "@snailycad/types/api"; diff --git a/apps/api/src/controllers/bleeter/bleeter-controller.ts b/apps/api/src/controllers/bleeter/bleeter-controller.ts index 1daf7b04d..a0255f794 100644 --- a/apps/api/src/controllers/bleeter/bleeter-controller.ts +++ b/apps/api/src/controllers/bleeter/bleeter-controller.ts @@ -1,5 +1,5 @@ import fs from "node:fs/promises"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { BLEETER_PROFILE_SCHEMA, BLEETER_SCHEMA } from "@snailycad/schemas"; import { Controller, @@ -9,7 +9,7 @@ import { Post, BodyParams, Context, - PlatformMulterFile, + type PlatformMulterFile, MultipartFile, } from "@tsed/common"; import { BadRequest, NotFound } from "@tsed/exceptions"; @@ -23,8 +23,8 @@ import type * as APITypes from "@snailycad/types/api"; import { getImageWebPPath } from "lib/images/get-image-webp-path"; import { Feature, IsFeatureEnabled } from "middlewares/is-enabled"; import generateBlurPlaceholder from "lib/images/generate-image-blur-data"; -import { BleeterPost, BleeterProfile } from "@snailycad/types"; -import { Descendant, slateDataToString } from "@snailycad/utils/editor"; +import { type BleeterPost, type BleeterProfile } from "@snailycad/types"; +import { type Descendant, slateDataToString } from "@snailycad/utils/editor"; import { getAPIUrl } from "@snailycad/utils/api-url"; import { sendDiscordWebhook } from "~/lib/discord/webhooks"; diff --git a/apps/api/src/controllers/business/BusinessController.ts b/apps/api/src/controllers/business/BusinessController.ts index 230386228..0d5318b5e 100644 --- a/apps/api/src/controllers/business/BusinessController.ts +++ b/apps/api/src/controllers/business/BusinessController.ts @@ -14,10 +14,10 @@ import { prisma } from "lib/data/prisma"; import { type User, EmployeeAsEnum, - MiscCadSettings, + type MiscCadSettings, WhitelistStatus, - cad, - Prisma, + type cad, + type Prisma, } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; diff --git a/apps/api/src/controllers/business/EmployeeController.ts b/apps/api/src/controllers/business/EmployeeController.ts index ac07c1128..e6bfe7f6d 100644 --- a/apps/api/src/controllers/business/EmployeeController.ts +++ b/apps/api/src/controllers/business/EmployeeController.ts @@ -6,7 +6,7 @@ import { IsAuth } from "middlewares/auth/is-auth"; import { UPDATE_EMPLOYEE_SCHEMA, FIRE_EMPLOYEE_SCHEMA } from "@snailycad/schemas"; import { NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; -import { cad, EmployeeAsEnum, User, WhitelistStatus } from "@prisma/client"; +import { type cad, EmployeeAsEnum, type User, WhitelistStatus } from "@prisma/client"; import { validateBusinessAcceptance } from "utils/businesses"; import { validateSchema } from "lib/data/validate-schema"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; diff --git a/apps/api/src/controllers/calls/taxi-controller.ts b/apps/api/src/controllers/calls/taxi-controller.ts index 7d4386f39..05559cd75 100644 --- a/apps/api/src/controllers/calls/taxi-controller.ts +++ b/apps/api/src/controllers/calls/taxi-controller.ts @@ -12,9 +12,9 @@ import { prisma } from "lib/data/prisma"; import { TOW_SCHEMA, UPDATE_TOW_SCHEMA } from "@snailycad/schemas"; import { NotFound } from "@tsed/exceptions"; import { IsAuth } from "middlewares/auth/is-auth"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { validateSchema } from "lib/data/validate-schema"; -import { Feature, Prisma, User } from "@prisma/client"; +import { Feature, type Prisma, type User } from "@prisma/client"; import { canManageInvariant } from "lib/auth/getSessionUser"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { towIncludes } from "./tow-controller"; diff --git a/apps/api/src/controllers/calls/tow-controller.ts b/apps/api/src/controllers/calls/tow-controller.ts index a731b7ec1..533272677 100644 --- a/apps/api/src/controllers/calls/tow-controller.ts +++ b/apps/api/src/controllers/calls/tow-controller.ts @@ -12,17 +12,17 @@ import { prisma } from "lib/data/prisma"; import { TOW_SCHEMA, UPDATE_TOW_SCHEMA } from "@snailycad/schemas"; import { NotFound } from "@tsed/exceptions"; import { IsAuth } from "middlewares/auth/is-auth"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { validateSchema } from "lib/data/validate-schema"; import { - Citizen, + type Citizen, DiscordWebhookType, Feature, - Prisma, - RegisteredVehicle, - User, - Value, - VehicleValue, + type Prisma, + type RegisteredVehicle, + type User, + type Value, + type VehicleValue, } from "@prisma/client"; import { canManageInvariant } from "lib/auth/getSessionUser"; import { Permissions, UsePermissions } from "middlewares/use-permissions"; diff --git a/apps/api/src/controllers/citizen/CitizenController.ts b/apps/api/src/controllers/citizen/CitizenController.ts index c403fe49f..f67f99890 100644 --- a/apps/api/src/controllers/citizen/CitizenController.ts +++ b/apps/api/src/controllers/citizen/CitizenController.ts @@ -1,4 +1,4 @@ -import { UseBeforeEach, Context, MultipartFile, PlatformMulterFile } from "@tsed/common"; +import { UseBeforeEach, Context, MultipartFile, type PlatformMulterFile } from "@tsed/common"; import { Controller } from "@tsed/di"; import { ContentType, Delete, Description, Get, Post, Put } from "@tsed/schema"; import { QueryParams, BodyParams, PathParams } from "@tsed/platform-params"; @@ -7,9 +7,16 @@ import { IsAuth } from "middlewares/auth/is-auth"; import { BadRequest, Forbidden, NotFound } from "@tsed/exceptions"; import { CREATE_CITIZEN_SCHEMA, CREATE_OFFICER_SCHEMA } from "@snailycad/schemas"; import fs from "node:fs/promises"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { generateString } from "utils/generate-string"; -import { User, ValueType, Feature, cad, MiscCadSettings, Prisma } from "@prisma/client"; +import { + type User, + ValueType, + Feature, + type cad, + type MiscCadSettings, + Prisma, +} from "@prisma/client"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; import { canManageInvariant, userProperties } from "lib/auth/getSessionUser"; import { validateSchema } from "lib/data/validate-schema"; diff --git a/apps/api/src/controllers/citizen/LicenseController.ts b/apps/api/src/controllers/citizen/LicenseController.ts index 99df45d25..ea355f4fa 100644 --- a/apps/api/src/controllers/citizen/LicenseController.ts +++ b/apps/api/src/controllers/citizen/LicenseController.ts @@ -1,4 +1,4 @@ -import { cad, Feature, User } from "@prisma/client"; +import { type cad, Feature, type User } from "@prisma/client"; import { LICENSE_SCHEMA } from "@snailycad/schemas"; import { UseBeforeEach, Context, BodyParams, PathParams } from "@tsed/common"; import { Controller } from "@tsed/di"; diff --git a/apps/api/src/controllers/citizen/pets-controller.ts b/apps/api/src/controllers/citizen/pets-controller.ts index f5bcb40f1..f2fdf6189 100644 --- a/apps/api/src/controllers/citizen/pets-controller.ts +++ b/apps/api/src/controllers/citizen/pets-controller.ts @@ -1,4 +1,4 @@ -import { Feature, User } from "@prisma/client"; +import { Feature, type User } from "@prisma/client"; import { PET_NOTE_SCHEMA, PET_MEDICAL_RECORD_SCHEMA, PET_SCHEMA } from "@snailycad/schemas"; import { UseBeforeEach, @@ -6,7 +6,7 @@ import { BodyParams, PathParams, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, } from "@tsed/common"; import { Controller } from "@tsed/di"; import { NotFound } from "@tsed/exceptions"; @@ -17,7 +17,7 @@ import type * as APITypes from "@snailycad/types/api"; import { validateSchema } from "lib/data/validate-schema"; import { IsFeatureEnabled } from "middlewares/is-enabled"; import { ExtendedBadRequest } from "~/exceptions/extended-bad-request"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { getImageWebPPath } from "~/lib/images/get-image-webp-path"; import fs from "node:fs/promises"; import { validateImageURL } from "~/lib/images/validate-image-url"; diff --git a/apps/api/src/controllers/citizen/vehicles-controller.ts b/apps/api/src/controllers/citizen/vehicles-controller.ts index 3b78a27ef..fd8085688 100644 --- a/apps/api/src/controllers/citizen/vehicles-controller.ts +++ b/apps/api/src/controllers/citizen/vehicles-controller.ts @@ -1,14 +1,14 @@ import { - MiscCadSettings, - User, + type MiscCadSettings, + type User, Feature, - VehicleInspectionStatus, - VehicleTaxStatus, + type VehicleInspectionStatus, + type VehicleTaxStatus, WhitelistStatus, ValueType, - cad, - Prisma, - Value, + type cad, + type Prisma, + type Value, EmployeeAsEnum, } from "@prisma/client"; import { VEHICLE_SCHEMA, DELETE_VEHICLE_SCHEMA, TRANSFER_VEHICLE_SCHEMA } from "@snailycad/schemas"; @@ -19,7 +19,7 @@ import { PathParams, QueryParams, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, } from "@tsed/common"; import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; @@ -36,7 +36,7 @@ import { citizenInclude } from "./CitizenController"; import type * as APITypes from "@snailycad/types/api"; import type { RegisteredVehicle } from "@snailycad/types"; import { getLastOfArray, manyToManyHelper } from "lib/data/many-to-many"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { getImageWebPPath } from "~/lib/images/get-image-webp-path"; import fs from "node:fs/promises"; import { ExtendedNotFound } from "~/exceptions/extended-not-found"; diff --git a/apps/api/src/controllers/citizen/weapon-controller.ts b/apps/api/src/controllers/citizen/weapon-controller.ts index 8fcf74f52..62f27f755 100644 --- a/apps/api/src/controllers/citizen/weapon-controller.ts +++ b/apps/api/src/controllers/citizen/weapon-controller.ts @@ -1,4 +1,4 @@ -import { User, Feature, cad, Prisma, WhitelistStatus } from "@prisma/client"; +import { type User, Feature, type cad, type Prisma, WhitelistStatus } from "@prisma/client"; import { WEAPON_SCHEMA } from "@snailycad/schemas"; import { UseBeforeEach, Context, BodyParams, PathParams, QueryParams } from "@tsed/common"; import { Controller } from "@tsed/di"; diff --git a/apps/api/src/controllers/court/ExpungementRequestsController.ts b/apps/api/src/controllers/court/ExpungementRequestsController.ts index a1ff8228e..47a0c87cc 100644 --- a/apps/api/src/controllers/court/ExpungementRequestsController.ts +++ b/apps/api/src/controllers/court/ExpungementRequestsController.ts @@ -1,4 +1,4 @@ -import { ExpungementRequestStatus, Feature, User, WhitelistStatus } from "@prisma/client"; +import { ExpungementRequestStatus, Feature, type User, WhitelistStatus } from "@prisma/client"; import { BodyParams, Context, PathParams, UseBeforeEach } from "@tsed/common"; import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; diff --git a/apps/api/src/controllers/court/courthouse-posts-controller.ts b/apps/api/src/controllers/court/courthouse-posts-controller.ts index 3e2c13ab6..8f6338e6b 100644 --- a/apps/api/src/controllers/court/courthouse-posts-controller.ts +++ b/apps/api/src/controllers/court/courthouse-posts-controller.ts @@ -1,4 +1,4 @@ -import { Feature, User } from "@prisma/client"; +import { Feature, type User } from "@prisma/client"; import { BodyParams, Context, diff --git a/apps/api/src/controllers/dispatch/911-calls/0calls-911-events-controller.ts b/apps/api/src/controllers/dispatch/911-calls/0calls-911-events-controller.ts index 912c3a948..c5bbb2e96 100644 --- a/apps/api/src/controllers/dispatch/911-calls/0calls-911-events-controller.ts +++ b/apps/api/src/controllers/dispatch/911-calls/0calls-911-events-controller.ts @@ -4,7 +4,7 @@ import { CALL_911_EVENT_SCHEMA } from "@snailycad/schemas"; import { BodyParams, PathParams } from "@tsed/platform-params"; import { NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UseBeforeEach } from "@tsed/platform-middlewares"; import { IsAuth } from "middlewares/auth/is-auth"; import { validateSchema } from "lib/data/validate-schema"; diff --git a/apps/api/src/controllers/dispatch/911-calls/calls-911-controller.ts b/apps/api/src/controllers/dispatch/911-calls/calls-911-controller.ts index 84e335228..fcb5fd474 100644 --- a/apps/api/src/controllers/dispatch/911-calls/calls-911-controller.ts +++ b/apps/api/src/controllers/dispatch/911-calls/calls-911-controller.ts @@ -4,23 +4,23 @@ import { UPDATE_ASSIGNED_UNIT_SCHEMA, CALL_911_SCHEMA, LINK_INCIDENT_TO_CALL_SCHEMA, - ASSIGNED_UNIT, + type ASSIGNED_UNIT, } from "@snailycad/schemas"; import { HeaderParams, BodyParams, Context, PathParams, QueryParams } from "@tsed/platform-params"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UseAfter, UseBeforeEach } from "@tsed/platform-middlewares"; import { IsAuth } from "middlewares/auth/is-auth"; import { validateSchema } from "lib/data/validate-schema"; import { type cad, - User, - MiscCadSettings, - Call911, + type User, + type MiscCadSettings, + type Call911, DiscordWebhookType, ShouldDoType, - Prisma, + type Prisma, WhitelistStatus, WhatPages, } from "@prisma/client"; diff --git a/apps/api/src/controllers/dispatch/bolo-controller.ts b/apps/api/src/controllers/dispatch/bolo-controller.ts index 9259151b0..29a997058 100644 --- a/apps/api/src/controllers/dispatch/bolo-controller.ts +++ b/apps/api/src/controllers/dispatch/bolo-controller.ts @@ -7,17 +7,17 @@ import { prisma } from "lib/data/prisma"; import { Use, UseAfter, UseBeforeEach } from "@tsed/platform-middlewares"; import { IsAuth } from "middlewares/auth/is-auth"; import { ActiveOfficer } from "middlewares/active-officer"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { leoProperties } from "utils/leo/includes"; import { validateSchema } from "lib/data/validate-schema"; import { - Bolo, + type Bolo, BoloType, - CombinedLeoUnit, + type CombinedLeoUnit, DiscordWebhookType, - Officer, - Prisma, + type Officer, + type Prisma, } from "@prisma/client"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import type { APIEmbed } from "discord-api-types/v10"; diff --git a/apps/api/src/controllers/dispatch/combined-units-controller.ts b/apps/api/src/controllers/dispatch/combined-units-controller.ts index 325770e17..b89fd142f 100644 --- a/apps/api/src/controllers/dispatch/combined-units-controller.ts +++ b/apps/api/src/controllers/dispatch/combined-units-controller.ts @@ -4,13 +4,13 @@ import { ContentType, Description, Post } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { - CombinedEmsFdUnit, - CombinedLeoUnit, + type CombinedEmsFdUnit, + type CombinedLeoUnit, Feature, ShouldDoType, WhatPages, } from "@prisma/client"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { IsAuth } from "middlewares/auth/is-auth"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { findNextAvailableIncremental } from "lib/leo/findNextAvailableIncremental"; diff --git a/apps/api/src/controllers/dispatch/dispatch-controller.ts b/apps/api/src/controllers/dispatch/dispatch-controller.ts index 844f12b9f..2a90accf5 100644 --- a/apps/api/src/controllers/dispatch/dispatch-controller.ts +++ b/apps/api/src/controllers/dispatch/dispatch-controller.ts @@ -3,10 +3,10 @@ import { ContentType, Delete, Description, Get, Post, Put } from "@tsed/schema"; import { BodyParams, PathParams, Context } from "@tsed/platform-params"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UseAfter, UseBeforeEach } from "@tsed/platform-middlewares"; import { IsAuth } from "middlewares/auth/is-auth"; -import { cad, Feature, MiscCadSettings, ShouldDoType, User } from "@snailycad/types"; +import { type cad, Feature, type MiscCadSettings, ShouldDoType, type User } from "@snailycad/types"; import { validateSchema } from "lib/data/validate-schema"; import { TONES_SCHEMA, UPDATE_AOP_SCHEMA, UPDATE_RADIO_CHANNEL_SCHEMA } from "@snailycad/schemas"; import { getActiveOfficer } from "lib/leo/activeOfficer"; diff --git a/apps/api/src/controllers/dispatch/private-messages-controller.ts b/apps/api/src/controllers/dispatch/private-messages-controller.ts index 0bb2a71c7..33e69ea35 100644 --- a/apps/api/src/controllers/dispatch/private-messages-controller.ts +++ b/apps/api/src/controllers/dispatch/private-messages-controller.ts @@ -3,11 +3,11 @@ import { Controller } from "@tsed/di"; import { ContentType, Get, Post } from "@tsed/schema"; import { BodyParams, PathParams } from "@tsed/platform-params"; import { prisma } from "lib/data/prisma"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UseBeforeEach } from "@tsed/platform-middlewares"; import { IsAuth } from "middlewares/auth/is-auth"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; -import { DispatchChat, Prisma } from "@prisma/client"; +import { type DispatchChat, Prisma } from "@prisma/client"; import { leoProperties, unitProperties, @@ -17,7 +17,7 @@ import { } from "utils/leo/includes"; import { findUnit } from "lib/leo/findUnit"; import { hasPermission } from "@snailycad/permissions"; -import { User } from "@snailycad/types"; +import { type User } from "@snailycad/types"; import { getActiveOfficer } from "lib/leo/activeOfficer"; import { getActiveDeputy } from "lib/get-active-ems-fd-deputy"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; diff --git a/apps/api/src/controllers/dispatch/status-controller.ts b/apps/api/src/controllers/dispatch/status-controller.ts index 2a2a9e21e..51264857b 100644 --- a/apps/api/src/controllers/dispatch/status-controller.ts +++ b/apps/api/src/controllers/dispatch/status-controller.ts @@ -1,15 +1,15 @@ import { - User, + type User, ShouldDoType, - MiscCadSettings, - cad, - Officer, - CombinedLeoUnit, - EmsFdDeputy, + type MiscCadSettings, + type cad, + type Officer, + type CombinedLeoUnit, + type EmsFdDeputy, WhitelistStatus, DiscordWebhookType, Feature, - DivisionValue, + type DivisionValue, } from "@prisma/client"; import { UPDATE_OFFICER_STATUS_SCHEMA } from "@snailycad/schemas"; import { Req, UseBeforeEach } from "@tsed/common"; @@ -19,7 +19,7 @@ import { BodyParams, Context, PathParams } from "@tsed/platform-params"; import { ContentType, Description, Put } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { sendDiscordWebhook, sendRawWebhook } from "lib/discord/webhooks"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { IsAuth } from "middlewares/auth/is-auth"; import { validateSchema } from "lib/data/validate-schema"; import { handleStartEndOfficerLog } from "lib/leo/handleStartEndOfficerLog"; diff --git a/apps/api/src/controllers/dispatch/temporary-units-controller.ts b/apps/api/src/controllers/dispatch/temporary-units-controller.ts index 75f4c399f..5de82a61e 100644 --- a/apps/api/src/controllers/dispatch/temporary-units-controller.ts +++ b/apps/api/src/controllers/dispatch/temporary-units-controller.ts @@ -1,7 +1,7 @@ import { Controller } from "@tsed/di"; import { BodyParams, Context, UseBeforeEach } from "@tsed/common"; import { ContentType, Description, Post } from "@tsed/schema"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { IsAuth } from "middlewares/auth/is-auth"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { upsertOfficer } from "controllers/leo/my-officers/upsert-officer"; diff --git a/apps/api/src/controllers/ems-fd/ems-fd-controller.ts b/apps/api/src/controllers/ems-fd/ems-fd-controller.ts index de03aa6d9..2366275df 100644 --- a/apps/api/src/controllers/ems-fd/ems-fd-controller.ts +++ b/apps/api/src/controllers/ems-fd/ems-fd-controller.ts @@ -3,7 +3,7 @@ import { UseBeforeEach, Use, MultipartFile, - PlatformMulterFile, + type PlatformMulterFile, UseAfter, } from "@tsed/common"; import { ContentType, Delete, Description, Get, Post, Put } from "@tsed/schema"; @@ -17,11 +17,11 @@ import { ShouldDoType, type User, Feature, - Prisma, + type Prisma, WhatPages, } from "@prisma/client"; import type { EmsFdDeputy } from "@snailycad/types"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { IsAuth } from "middlewares/auth/is-auth"; import { ActiveDeputy } from "middlewares/active-deputy"; import fs from "node:fs/promises"; @@ -29,7 +29,7 @@ import { validateSchema } from "lib/data/validate-schema"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { getInactivityFilter } from "lib/leo/utils"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import type * as APITypes from "@snailycad/types/api"; import { isFeatureEnabled } from "lib/upsert-cad"; import { IsFeatureEnabled } from "middlewares/is-enabled"; diff --git a/apps/api/src/controllers/ems-fd/incidents/ems-fd-incidents-controller.ts b/apps/api/src/controllers/ems-fd/incidents/ems-fd-incidents-controller.ts index 10b455426..e72af7032 100644 --- a/apps/api/src/controllers/ems-fd/incidents/ems-fd-incidents-controller.ts +++ b/apps/api/src/controllers/ems-fd/incidents/ems-fd-incidents-controller.ts @@ -5,9 +5,9 @@ import { QueryParams, BodyParams, Context, PathParams } from "@tsed/platform-par import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { EMS_FD_INCIDENT_SCHEMA } from "@snailycad/schemas"; -import { Officer, MiscCadSettings, CombinedLeoUnit } from "@prisma/client"; +import { type Officer, type MiscCadSettings, type CombinedLeoUnit } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { officerOrDeputyToUnit } from "lib/leo/officerOrDeputyToUnit"; import { findUnit } from "lib/leo/findUnit"; diff --git a/apps/api/src/controllers/leo/DmvController.ts b/apps/api/src/controllers/leo/DmvController.ts index 755300f24..a05606532 100644 --- a/apps/api/src/controllers/leo/DmvController.ts +++ b/apps/api/src/controllers/leo/DmvController.ts @@ -4,7 +4,7 @@ import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { ContentType, Description, Get, Post } from "@tsed/schema"; import { - AcceptDeclineType, + type AcceptDeclineType, ACCEPT_DECLINE_TYPES, } from "controllers/admin/manage/units/manage-units-controller"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/controllers/leo/JailController.ts b/apps/api/src/controllers/leo/JailController.ts index c11c1c7b5..ecdbdf7bc 100644 --- a/apps/api/src/controllers/leo/JailController.ts +++ b/apps/api/src/controllers/leo/JailController.ts @@ -6,7 +6,7 @@ import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { leoProperties } from "utils/leo/includes"; -import { MiscCadSettings, ReleaseType } from "@prisma/client"; +import { type MiscCadSettings, ReleaseType } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; import { RELEASE_CITIZEN_SCHEMA } from "@snailycad/schemas"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; diff --git a/apps/api/src/controllers/leo/LeoController.ts b/apps/api/src/controllers/leo/LeoController.ts index cc1b5254e..a0029c0b9 100644 --- a/apps/api/src/controllers/leo/LeoController.ts +++ b/apps/api/src/controllers/leo/LeoController.ts @@ -6,14 +6,19 @@ import { BadRequest, NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { ActiveOfficer } from "middlewares/active-officer"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { combinedUnitProperties, leoProperties } from "utils/leo/includes"; -import { cad, Prisma, ShouldDoType, User, WhatPages } from "@prisma/client"; +import { type cad, type Prisma, ShouldDoType, type User, WhatPages } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; import { Permissions, UsePermissions } from "middlewares/use-permissions"; import { getInactivityFilter } from "lib/leo/utils"; import { findUnit } from "lib/leo/findUnit"; -import { CombinedLeoUnit, Officer, MiscCadSettings, Feature } from "@snailycad/types"; +import { + type CombinedLeoUnit, + type Officer, + type MiscCadSettings, + Feature, +} from "@snailycad/types"; import type * as APITypes from "@snailycad/types/api"; import { IsFeatureEnabled } from "middlewares/is-enabled"; import { handlePanicButtonPressed } from "lib/leo/send-panic-button-webhook"; diff --git a/apps/api/src/controllers/leo/LicenseExamsController.ts b/apps/api/src/controllers/leo/LicenseExamsController.ts index b9d1dcde0..d9e000d39 100644 --- a/apps/api/src/controllers/leo/LicenseExamsController.ts +++ b/apps/api/src/controllers/leo/LicenseExamsController.ts @@ -1,8 +1,8 @@ import { - Prisma, - LicenseExam, - DriversLicenseCategoryValue, - LicenseExamType, + type Prisma, + type LicenseExam, + type DriversLicenseCategoryValue, + type LicenseExamType, Feature, } from "@prisma/client"; import { LicenseExamPassType, LicenseExamStatus } from "@snailycad/types"; diff --git a/apps/api/src/controllers/leo/bureau-of-firearms-controller.ts b/apps/api/src/controllers/leo/bureau-of-firearms-controller.ts index 135f3d833..4bedfe05e 100644 --- a/apps/api/src/controllers/leo/bureau-of-firearms-controller.ts +++ b/apps/api/src/controllers/leo/bureau-of-firearms-controller.ts @@ -4,7 +4,7 @@ import { Controller } from "@tsed/di"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { ContentType, Description, Get, Post } from "@tsed/schema"; import { - AcceptDeclineType, + type AcceptDeclineType, ACCEPT_DECLINE_TYPES, } from "controllers/admin/manage/units/manage-units-controller"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/controllers/leo/create-where-obj.ts b/apps/api/src/controllers/leo/create-where-obj.ts index 16cceb61e..0237cbd17 100644 --- a/apps/api/src/controllers/leo/create-where-obj.ts +++ b/apps/api/src/controllers/leo/create-where-obj.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import { type Prisma } from "@prisma/client"; import { WhitelistStatus } from "@snailycad/types"; interface CreateWhereObjOptions { diff --git a/apps/api/src/controllers/leo/incidents/0IncidentEventsController.ts b/apps/api/src/controllers/leo/incidents/0IncidentEventsController.ts index b07e11562..f9dda9af1 100644 --- a/apps/api/src/controllers/leo/incidents/0IncidentEventsController.ts +++ b/apps/api/src/controllers/leo/incidents/0IncidentEventsController.ts @@ -6,7 +6,7 @@ import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { CALL_911_EVENT_SCHEMA } from "@snailycad/schemas"; import { validateSchema } from "lib/data/validate-schema"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { incidentInclude } from "./IncidentController"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { officerOrDeputyToUnit } from "lib/leo/officerOrDeputyToUnit"; diff --git a/apps/api/src/controllers/leo/incidents/IncidentController.ts b/apps/api/src/controllers/leo/incidents/IncidentController.ts index 281821295..44a0eb909 100644 --- a/apps/api/src/controllers/leo/incidents/IncidentController.ts +++ b/apps/api/src/controllers/leo/incidents/IncidentController.ts @@ -9,7 +9,7 @@ import { LEO_INCIDENT_SCHEMA } from "@snailycad/schemas"; import { ActiveOfficer } from "middlewares/active-officer"; import type { Officer, MiscCadSettings, CombinedLeoUnit } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { officerOrDeputyToUnit } from "lib/leo/officerOrDeputyToUnit"; import { findUnit } from "lib/leo/findUnit"; @@ -17,7 +17,7 @@ import { getUserOfficerFromActiveOfficer, getInactivityFilter } from "lib/leo/ut import type * as APITypes from "@snailycad/types/api"; import { getNextIncidentId } from "lib/incidents/get-next-incident-id"; import { assignUnitsInvolvedToIncident } from "lib/incidents/handle-involved-units"; -import { cad } from "@snailycad/types"; +import { type cad } from "@snailycad/types"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; export const incidentInclude = { diff --git a/apps/api/src/controllers/leo/my-officers/MyOfficersController.ts b/apps/api/src/controllers/leo/my-officers/MyOfficersController.ts index 56afafa8d..556ac7b12 100644 --- a/apps/api/src/controllers/leo/my-officers/MyOfficersController.ts +++ b/apps/api/src/controllers/leo/my-officers/MyOfficersController.ts @@ -1,15 +1,15 @@ import fs from "node:fs/promises"; -import { Controller, UseBeforeEach, PlatformMulterFile, MultipartFile } from "@tsed/common"; +import { Controller, UseBeforeEach, type PlatformMulterFile, MultipartFile } from "@tsed/common"; import { ContentType, Delete, Description, Get, Post, Put } from "@tsed/schema"; import { QueryParams, BodyParams, Context, PathParams } from "@tsed/platform-params"; import { BadRequest, NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; -import { Feature, cad, User, MiscCadSettings } from "@prisma/client"; +import { type Feature, type cad, type User, type MiscCadSettings } from "@prisma/client"; import { Permissions, UsePermissions } from "middlewares/use-permissions"; import { leoProperties } from "utils/leo/includes"; -import { AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions } from "@snailycad/config"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; import type * as APITypes from "@snailycad/types/api"; import { upsertOfficer } from "./upsert-officer"; diff --git a/apps/api/src/controllers/leo/my-officers/upsert-officer.ts b/apps/api/src/controllers/leo/my-officers/upsert-officer.ts index 43d11ac09..bdf56ae65 100644 --- a/apps/api/src/controllers/leo/my-officers/upsert-officer.ts +++ b/apps/api/src/controllers/leo/my-officers/upsert-officer.ts @@ -1,14 +1,14 @@ import { CREATE_OFFICER_SCHEMA } from "@snailycad/schemas"; import { - cad, - Citizen, - DivisionValue, + type cad, + type Citizen, + type DivisionValue, Feature, - LeoWhitelistStatus, - MiscCadSettings, - Officer, + type LeoWhitelistStatus, + type MiscCadSettings, + type Officer, ShouldDoType, - User, + type User, WhatPages, } from "@prisma/client"; import { shouldCheckCitizenUserId } from "lib/citizen/has-citizen-access"; diff --git a/apps/api/src/controllers/leo/search/SearchActionsController.ts b/apps/api/src/controllers/leo/search/SearchActionsController.ts index 98dbb89a1..f23950c0c 100644 --- a/apps/api/src/controllers/leo/search/SearchActionsController.ts +++ b/apps/api/src/controllers/leo/search/SearchActionsController.ts @@ -14,19 +14,19 @@ import { IsAuth } from "middlewares/auth/is-auth"; import { citizenInclude } from "controllers/citizen/CitizenController"; import { updateCitizenLicenseCategories } from "lib/citizen/licenses/update-citizen-license-categories"; import { - cad, + type cad, Feature, - MiscCadSettings, + type MiscCadSettings, ValueType, - VehicleInspectionStatus, - VehicleTaxStatus, + type VehicleInspectionStatus, + type VehicleTaxStatus, WhitelistStatus, - User, + type User, CustomFieldCategory, - SuspendedCitizenLicenses, + type SuspendedCitizenLicenses, DiscordWebhookType, - Officer, - CombinedLeoUnit, + type Officer, + type CombinedLeoUnit, } from "@prisma/client"; import { UseBeforeEach, Context, UseBefore } from "@tsed/common"; import { ContentType, Description, Post, Put } from "@tsed/schema"; diff --git a/apps/api/src/controllers/leo/search/SearchController.ts b/apps/api/src/controllers/leo/search/SearchController.ts index ace76265f..186f80c37 100644 --- a/apps/api/src/controllers/leo/search/SearchController.ts +++ b/apps/api/src/controllers/leo/search/SearchController.ts @@ -9,14 +9,14 @@ import { callInclude, leoProperties } from "utils/leo/includes"; import { citizenInclude } from "controllers/citizen/CitizenController"; import { UsePermissions, Permissions } from "middlewares/use-permissions"; import { - cad, - Citizen, + type cad, + type Citizen, CustomFieldCategory, - DepartmentValue, + type DepartmentValue, Feature, - Officer, + type Officer, WhitelistStatus, - User, + type User, } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; import { CUSTOM_FIELD_SEARCH_SCHEMA } from "@snailycad/schemas"; diff --git a/apps/api/src/controllers/nav-controller.ts b/apps/api/src/controllers/nav-controller.ts index 91caa2bdb..2c515c09f 100644 --- a/apps/api/src/controllers/nav-controller.ts +++ b/apps/api/src/controllers/nav-controller.ts @@ -1,6 +1,6 @@ -import { Feature, WhitelistStatus } from "@prisma/client"; +import { type Feature, WhitelistStatus } from "@prisma/client"; import { Permissions, defaultPermissions, hasPermission } from "@snailycad/permissions"; -import { User } from "@snailycad/types"; +import { type User } from "@snailycad/types"; import { Context, UseBeforeEach } from "@tsed/common"; import { Controller } from "@tsed/di"; import { Description, Get } from "@tsed/schema"; diff --git a/apps/api/src/controllers/record/records-controller.ts b/apps/api/src/controllers/record/records-controller.ts index 98717510f..60f53cfff 100644 --- a/apps/api/src/controllers/record/records-controller.ts +++ b/apps/api/src/controllers/record/records-controller.ts @@ -13,18 +13,18 @@ import { ActiveOfficer } from "middlewares/active-officer"; import { Controller } from "@tsed/di"; import { IsAuth } from "middlewares/auth/is-auth"; import { - Citizen, + type Citizen, Feature, - Record as CADRecord, - Violation, - Warrant, + type Record as CADRecord, + type Violation, + type Warrant, WarrantStatus, WhitelistStatus, DiscordWebhookType, - CombinedLeoUnit, - Officer, - User, - Business, + type CombinedLeoUnit, + type Officer, + type User, + type Business, PaymentStatus, } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; @@ -35,7 +35,7 @@ import { sendDiscordWebhook, sendRawWebhook } from "lib/discord/webhooks"; import { getUserOfficerFromActiveOfficer, getInactivityFilter } from "lib/leo/utils"; import type * as APITypes from "@snailycad/types/api"; import { officerOrDeputyToUnit } from "lib/leo/officerOrDeputyToUnit"; -import { Socket } from "services/socket-service"; +import { type Socket } from "services/socket-service"; import { assignUnitsToWarrant } from "~/lib/leo/records/assign-units-to-warrant"; import type { MiscCadSettings, cad } from "@snailycad/types"; import { userProperties } from "lib/auth/getSessionUser"; @@ -49,7 +49,7 @@ import differenceInYears from "date-fns/differenceInYears"; import { recordsInclude } from "../leo/search/SearchController"; import { citizenInclude } from "../citizen/CitizenController"; import { generateCallsign } from "@snailycad/utils"; -import { Descendant, slateDataToString } from "@snailycad/utils/editor"; +import { type Descendant, slateDataToString } from "@snailycad/utils/editor"; import puppeteer from "puppeteer"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; import { captureException } from "@sentry/node"; diff --git a/apps/api/src/lib/auth/getSessionUser.ts b/apps/api/src/lib/auth/getSessionUser.ts index f6d859fa4..a0283055a 100644 --- a/apps/api/src/lib/auth/getSessionUser.ts +++ b/apps/api/src/lib/auth/getSessionUser.ts @@ -170,7 +170,6 @@ export async function getSessionUser( } function createUserData(user: User & { password: string; hasPassword?: boolean }) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!user) return user as GetUserData; const { tempPassword, password = "", ...rest } = user; diff --git a/apps/api/src/lib/auth/validateUser.ts b/apps/api/src/lib/auth/validateUser.ts index 9d20b94d0..10f694db4 100644 --- a/apps/api/src/lib/auth/validateUser.ts +++ b/apps/api/src/lib/auth/validateUser.ts @@ -1,4 +1,4 @@ -import { Rank, WhitelistStatus, User } from "@snailycad/types"; +import { Rank, WhitelistStatus, type User } from "@snailycad/types"; import type { GetUserData } from "@snailycad/types/api"; import type { Req } from "@tsed/common"; import { NotFound, Unauthorized } from "@tsed/exceptions"; diff --git a/apps/api/src/lib/citizen/citizen-create-data-obj.ts b/apps/api/src/lib/citizen/citizen-create-data-obj.ts index c2e6f5e32..bb818d958 100644 --- a/apps/api/src/lib/citizen/citizen-create-data-obj.ts +++ b/apps/api/src/lib/citizen/citizen-create-data-obj.ts @@ -1,4 +1,4 @@ -import { Prisma, cad, Feature, MiscCadSettings } from "@prisma/client"; +import { type Prisma, type cad, Feature, type MiscCadSettings } from "@prisma/client"; import type { CREATE_CITIZEN_SCHEMA } from "@snailycad/schemas"; import { generateString } from "utils/generate-string"; import generateBlurPlaceholder from "lib/images/generate-image-blur-data"; diff --git a/apps/api/src/lib/citizen/has-citizen-access.ts b/apps/api/src/lib/citizen/has-citizen-access.ts index c3a23e607..bdfff251a 100644 --- a/apps/api/src/lib/citizen/has-citizen-access.ts +++ b/apps/api/src/lib/citizen/has-citizen-access.ts @@ -1,4 +1,4 @@ -import { Feature, User } from "@prisma/client"; +import { Feature, type User } from "@prisma/client"; import { defaultPermissions, hasPermission } from "@snailycad/permissions"; import { isFeatureEnabled } from "lib/upsert-cad"; diff --git a/apps/api/src/lib/data/validate-schema.ts b/apps/api/src/lib/data/validate-schema.ts index a915fc46a..a5ab2031a 100644 --- a/apps/api/src/lib/data/validate-schema.ts +++ b/apps/api/src/lib/data/validate-schema.ts @@ -1,6 +1,6 @@ import { BadRequest } from "@tsed/exceptions"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; -import { z } from "zod"; +import { type z } from "zod"; export function validateSchema( schema: Schema, diff --git a/apps/api/src/lib/discord/auth.ts b/apps/api/src/lib/discord/auth.ts index 26d2985c1..b8522a9cb 100644 --- a/apps/api/src/lib/discord/auth.ts +++ b/apps/api/src/lib/discord/auth.ts @@ -1,5 +1,9 @@ -import { DiscordRole, Rank, User, WhitelistStatus } from "@snailycad/types"; -import { APIGuildMember, Routes, type RESTGetAPIGuildMemberResult } from "discord-api-types/v10"; +import { type DiscordRole, Rank, type User, WhitelistStatus } from "@snailycad/types"; +import { + type APIGuildMember, + Routes, + type RESTGetAPIGuildMemberResult, +} from "discord-api-types/v10"; import { GUILD_ID } from "lib/discord/config"; import { prisma } from "lib/data/prisma"; import { manyToManyHelper } from "lib/data/many-to-many"; diff --git a/apps/api/src/lib/discord/register-metadata.ts b/apps/api/src/lib/discord/register-metadata.ts index dd2ae44ba..3514bac59 100644 --- a/apps/api/src/lib/discord/register-metadata.ts +++ b/apps/api/src/lib/discord/register-metadata.ts @@ -5,8 +5,8 @@ import { ApplicationRoleConnectionMetadataType, - RESTPutAPIApplicationRoleConnectionMetadataJSONBody, - RESTPutAPIApplicationRoleConnectionMetadataResult, + type RESTPutAPIApplicationRoleConnectionMetadataJSONBody, + type RESTPutAPIApplicationRoleConnectionMetadataResult, Routes, } from "discord-api-types/v10"; import { performDiscordRequest } from "lib/discord/performDiscordRequest"; diff --git a/apps/api/src/lib/dispatch/911-calls/assign-units-to-911-call.ts b/apps/api/src/lib/dispatch/911-calls/assign-units-to-911-call.ts index 5d1401d22..ce27f8852 100644 --- a/apps/api/src/lib/dispatch/911-calls/assign-units-to-911-call.ts +++ b/apps/api/src/lib/dispatch/911-calls/assign-units-to-911-call.ts @@ -1,4 +1,4 @@ -import { AssignedUnit, ShouldDoType } from "@prisma/client"; +import { type AssignedUnit, ShouldDoType } from "@prisma/client"; import type { Call911 } from "@prisma/client"; import { findUnit } from "~/lib/leo/findUnit"; import { prisma } from "~/lib/data/prisma"; diff --git a/apps/api/src/lib/dispatch/webhooks.ts b/apps/api/src/lib/dispatch/webhooks.ts index 0da4b3f5c..aff1d0e02 100644 --- a/apps/api/src/lib/dispatch/webhooks.ts +++ b/apps/api/src/lib/dispatch/webhooks.ts @@ -1,11 +1,11 @@ import { - Officer, - EmsFdDeputy, - Citizen, - CombinedLeoUnit, - MiscCadSettings, - StatusValue, - Value, + type Officer, + type EmsFdDeputy, + type Citizen, + type CombinedLeoUnit, + type MiscCadSettings, + type StatusValue, + type Value, Feature, } from "@prisma/client"; import { generateCallsign } from "@snailycad/utils"; diff --git a/apps/api/src/lib/ems-fd/upsert-ems-fd-deputy.ts b/apps/api/src/lib/ems-fd/upsert-ems-fd-deputy.ts index fa6348efa..66d5d636f 100644 --- a/apps/api/src/lib/ems-fd/upsert-ems-fd-deputy.ts +++ b/apps/api/src/lib/ems-fd/upsert-ems-fd-deputy.ts @@ -1,13 +1,13 @@ import type { ZodSchema } from "zod"; import { - cad, - Citizen, - EmsFdDeputy, + type cad, + type Citizen, + type EmsFdDeputy, Feature, - LeoWhitelistStatus, - MiscCadSettings, + type LeoWhitelistStatus, + type MiscCadSettings, ShouldDoType, - User, + type User, WhatPages, } from "@prisma/client"; import { validateSchema } from "lib/data/validate-schema"; diff --git a/apps/api/src/lib/get-active-ems-fd-deputy.ts b/apps/api/src/lib/get-active-ems-fd-deputy.ts index 1687c4260..a3d6d9d66 100644 --- a/apps/api/src/lib/get-active-ems-fd-deputy.ts +++ b/apps/api/src/lib/get-active-ems-fd-deputy.ts @@ -1,4 +1,4 @@ -import { Prisma, ShouldDoType, User } from "@prisma/client"; +import { type Prisma, ShouldDoType, type User } from "@prisma/client"; import { defaultPermissions, hasPermission } from "@snailycad/permissions"; import type { Req, Context } from "@tsed/common"; import { BadRequest, Forbidden } from "@tsed/exceptions"; diff --git a/apps/api/src/lib/incidents/handle-involved-units.ts b/apps/api/src/lib/incidents/handle-involved-units.ts index 47141637b..52302d160 100644 --- a/apps/api/src/lib/incidents/handle-involved-units.ts +++ b/apps/api/src/lib/incidents/handle-involved-units.ts @@ -1,4 +1,9 @@ -import { EmsFdIncident, IncidentInvolvedUnit, LeoIncident, ShouldDoType } from "@prisma/client"; +import { + type EmsFdIncident, + type IncidentInvolvedUnit, + type LeoIncident, + ShouldDoType, +} from "@prisma/client"; import { findUnit } from "lib/leo/findUnit"; import { prisma } from "lib/data/prisma"; import type { Socket } from "services/socket-service"; diff --git a/apps/api/src/lib/leo/activeOfficer.ts b/apps/api/src/lib/leo/activeOfficer.ts index bbee3d235..5635104c9 100644 --- a/apps/api/src/lib/leo/activeOfficer.ts +++ b/apps/api/src/lib/leo/activeOfficer.ts @@ -1,4 +1,4 @@ -import { User, Prisma } from "@prisma/client"; +import { type User, type Prisma } from "@prisma/client"; import { defaultPermissions, hasPermission } from "@snailycad/permissions"; import type { Req, Context } from "@tsed/common"; import { BadRequest, Forbidden } from "@tsed/exceptions"; diff --git a/apps/api/src/lib/leo/handleStartEndOfficerLog.ts b/apps/api/src/lib/leo/handleStartEndOfficerLog.ts index 66316e4ed..0ae9f3f4b 100644 --- a/apps/api/src/lib/leo/handleStartEndOfficerLog.ts +++ b/apps/api/src/lib/leo/handleStartEndOfficerLog.ts @@ -1,4 +1,4 @@ -import { EmsFdDeputy, Officer, ShouldDoType } from "@prisma/client"; +import { type EmsFdDeputy, type Officer, ShouldDoType } from "@prisma/client"; import { incidentInclude } from "controllers/leo/incidents/IncidentController"; import { prisma } from "lib/data/prisma"; import type { Socket } from "services/socket-service"; diff --git a/apps/api/src/lib/leo/handleWhitelistStatus.ts b/apps/api/src/lib/leo/handleWhitelistStatus.ts index ad5ac2a41..b1e71fc75 100644 --- a/apps/api/src/lib/leo/handleWhitelistStatus.ts +++ b/apps/api/src/lib/leo/handleWhitelistStatus.ts @@ -1,9 +1,9 @@ import { - EmsFdDeputy, - Officer, - LeoWhitelistStatus, + type EmsFdDeputy, + type Officer, + type LeoWhitelistStatus, WhitelistStatus, - DepartmentValue, + type DepartmentValue, } from "@prisma/client"; import { prisma } from "lib/data/prisma"; import { ExtendedNotFound } from "src/exceptions/extended-not-found"; diff --git a/apps/api/src/lib/leo/officerOrDeputyToUnit.ts b/apps/api/src/lib/leo/officerOrDeputyToUnit.ts index 43b9b3dc1..934866ac7 100644 --- a/apps/api/src/lib/leo/officerOrDeputyToUnit.ts +++ b/apps/api/src/lib/leo/officerOrDeputyToUnit.ts @@ -1,5 +1,5 @@ import type { Call911, LeoIncident, Warrant } from "@prisma/client"; -import { DispatchChat } from "@snailycad/types"; +import { type DispatchChat } from "@snailycad/types"; type _Call911 = Call911 & { assignedUnits?: any[] }; type _Incident = LeoIncident & { unitsInvolved?: any[] }; diff --git a/apps/api/src/lib/leo/records/penal-code.ts b/apps/api/src/lib/leo/records/penal-code.ts index 10fd9b44f..317a64731 100644 --- a/apps/api/src/lib/leo/records/penal-code.ts +++ b/apps/api/src/lib/leo/records/penal-code.ts @@ -1,4 +1,4 @@ -import { cad, Feature, PenalCode } from "@prisma/client"; +import { type cad, Feature, type PenalCode } from "@prisma/client"; import type { PENAL_CODE_SCHEMA } from "@snailycad/schemas"; import { prisma } from "lib/data/prisma"; import type { z } from "zod"; diff --git a/apps/api/src/lib/leo/records/upsert-record.ts b/apps/api/src/lib/leo/records/upsert-record.ts index 88ad02be8..4418809a0 100644 --- a/apps/api/src/lib/leo/records/upsert-record.ts +++ b/apps/api/src/lib/leo/records/upsert-record.ts @@ -1,6 +1,12 @@ -import { Feature, CourtDate, CourtEntry, SeizedItem, Violation } from "@prisma/client"; +import { + Feature, + type CourtDate, + type CourtEntry, + type SeizedItem, + type Violation, +} from "@prisma/client"; import type { CREATE_TICKET_SCHEMA, CREATE_TICKET_SCHEMA_BUSINESS } from "@snailycad/schemas"; -import { PaymentStatus, RecordType, WhitelistStatus } from "@snailycad/types"; +import { type PaymentStatus, type RecordType, WhitelistStatus } from "@snailycad/types"; import { NotFound } from "@tsed/exceptions"; import { isFeatureEnabled } from "lib/upsert-cad"; import { leoProperties } from "utils/leo/includes"; diff --git a/apps/api/src/lib/leo/records/validate-record-data.ts b/apps/api/src/lib/leo/records/validate-record-data.ts index f66392a69..3a69df5f2 100644 --- a/apps/api/src/lib/leo/records/validate-record-data.ts +++ b/apps/api/src/lib/leo/records/validate-record-data.ts @@ -1,4 +1,9 @@ -import { Feature, PenalCode, WarningApplicable, WarningNotApplicable } from "@prisma/client"; +import { + Feature, + type PenalCode, + type WarningApplicable, + type WarningNotApplicable, +} from "@prisma/client"; import { isFeatureEnabled } from "lib/upsert-cad"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/lib/leo/send-panic-button-webhook.ts b/apps/api/src/lib/leo/send-panic-button-webhook.ts index 6dbebfad0..0f1aac6b4 100644 --- a/apps/api/src/lib/leo/send-panic-button-webhook.ts +++ b/apps/api/src/lib/leo/send-panic-button-webhook.ts @@ -1,12 +1,12 @@ import { ShouldDoType, - StatusValue, - Officer, - EmsFdDeputy, - Citizen, - CombinedLeoUnit, - MiscCadSettings, - cad, + type StatusValue, + type Officer, + type EmsFdDeputy, + type Citizen, + type CombinedLeoUnit, + type MiscCadSettings, + type cad, DiscordWebhookType, } from "@prisma/client"; import { sendDiscordWebhook, sendRawWebhook } from "lib/discord/webhooks"; diff --git a/apps/api/src/lib/leo/utils.ts b/apps/api/src/lib/leo/utils.ts index 520c7149a..59925b79e 100644 --- a/apps/api/src/lib/leo/utils.ts +++ b/apps/api/src/lib/leo/utils.ts @@ -1,12 +1,12 @@ import { - MiscCadSettings, + type MiscCadSettings, JailTimeScale, - CombinedLeoUnit, - Officer, - AssignedUnit, - IncidentInvolvedUnit, - Feature, - cad, + type CombinedLeoUnit, + type Officer, + type AssignedUnit, + type IncidentInvolvedUnit, + type Feature, + type cad, } from "@prisma/client"; import type { INDIVIDUAL_CALLSIGN_SCHEMA } from "@snailycad/schemas"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/lib/leo/validateDuplicateCallsigns.ts b/apps/api/src/lib/leo/validateDuplicateCallsigns.ts index e141338ab..7e45733cc 100644 --- a/apps/api/src/lib/leo/validateDuplicateCallsigns.ts +++ b/apps/api/src/lib/leo/validateDuplicateCallsigns.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import { type Prisma } from "@prisma/client"; import { BadRequest } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/lib/values/create-where-object.ts b/apps/api/src/lib/values/create-where-object.ts index 55c5b9fff..bda3b7fa8 100644 --- a/apps/api/src/lib/values/create-where-object.ts +++ b/apps/api/src/lib/values/create-where-object.ts @@ -1,4 +1,4 @@ -import { Prisma, ValueType } from "@prisma/client"; +import { type Prisma, ValueType } from "@prisma/client"; import { GET_VALUES } from "controllers/admin/values/values-controller"; import { getTypeFromPath } from "./utils"; diff --git a/apps/api/src/lib/values/utils.ts b/apps/api/src/lib/values/utils.ts index 049e8b2c3..f90021eb0 100644 --- a/apps/api/src/lib/values/utils.ts +++ b/apps/api/src/lib/values/utils.ts @@ -1,4 +1,4 @@ -import { Prisma, PrismaClient, Rank, ValueType, User } from "@prisma/client"; +import { type Prisma, type PrismaClient, Rank, type ValueType, type User } from "@prisma/client"; import { Permissions } from "@snailycad/permissions"; import type { Req } from "@tsed/common"; import { BadRequest } from "@tsed/exceptions"; diff --git a/apps/api/src/middlewares/active-deputy.ts b/apps/api/src/middlewares/active-deputy.ts index 8d52923df..eba7d6249 100644 --- a/apps/api/src/middlewares/active-deputy.ts +++ b/apps/api/src/middlewares/active-deputy.ts @@ -1,4 +1,4 @@ -import { Context, Middleware, Req, MiddlewareMethods, Res, Next } from "@tsed/common"; +import { Context, Middleware, Req, type MiddlewareMethods, Res, Next } from "@tsed/common"; import { getSessionUser } from "lib/auth/getSessionUser"; import { getActiveDeputy } from "lib/get-active-ems-fd-deputy"; diff --git a/apps/api/src/middlewares/active-officer.ts b/apps/api/src/middlewares/active-officer.ts index dcf9f6c5a..b4866e42c 100644 --- a/apps/api/src/middlewares/active-officer.ts +++ b/apps/api/src/middlewares/active-officer.ts @@ -1,4 +1,4 @@ -import { Context, Middleware, Req, MiddlewareMethods, Res, Next } from "@tsed/common"; +import { Context, Middleware, Req, type MiddlewareMethods, Res, Next } from "@tsed/common"; import { Unauthorized } from "@tsed/exceptions"; import { getSessionUser } from "lib/auth/getSessionUser"; import { getActiveOfficer } from "lib/leo/activeOfficer"; diff --git a/apps/api/src/middlewares/auth/is-auth.ts b/apps/api/src/middlewares/auth/is-auth.ts index 0d4dcc834..b10be268a 100644 --- a/apps/api/src/middlewares/auth/is-auth.ts +++ b/apps/api/src/middlewares/auth/is-auth.ts @@ -1,7 +1,7 @@ import process from "node:process"; -import { Feature, CadFeature, cad, Prisma } from "@prisma/client"; +import { type Feature, type CadFeature, type cad, Prisma } from "@prisma/client"; import { API_TOKEN_HEADER } from "@snailycad/config"; -import { Context, Middleware, Req, MiddlewareMethods, Res } from "@tsed/common"; +import { Context, Middleware, Req, type MiddlewareMethods, Res } from "@tsed/common"; import { Unauthorized } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; import { getCADVersion } from "@snailycad/utils/version"; @@ -11,7 +11,7 @@ import { setErrorMap } from "zod"; import { getErrorMap } from "../../utils/zod-error-map"; import { createFeaturesObject, overwriteFeatures } from "../is-enabled"; import { getUserFromSession, setGlobalUserFromCADAPIToken } from "./utils/get-user"; -import { CadFeatureOptions } from "@snailycad/types"; +import { type CadFeatureOptions } from "@snailycad/types"; @Middleware() export class IsAuth implements MiddlewareMethods { diff --git a/apps/api/src/middlewares/auth/utils/utils.ts b/apps/api/src/middlewares/auth/utils/utils.ts index f8180fd6d..7beb4b2e8 100644 --- a/apps/api/src/middlewares/auth/utils/utils.ts +++ b/apps/api/src/middlewares/auth/utils/utils.ts @@ -1,5 +1,5 @@ import type { cad, User } from "@prisma/client"; -import { DISABLED_API_TOKEN_ROUTES, Method } from "@snailycad/config"; +import { DISABLED_API_TOKEN_ROUTES, type Method } from "@snailycad/config"; import type { GetUserData } from "@snailycad/types/api"; import type { Req } from "@tsed/common"; import { userProperties } from "lib/auth/getSessionUser"; diff --git a/apps/api/src/middlewares/handle-inactivity.ts b/apps/api/src/middlewares/handle-inactivity.ts index f2820e9ee..1c02d4797 100644 --- a/apps/api/src/middlewares/handle-inactivity.ts +++ b/apps/api/src/middlewares/handle-inactivity.ts @@ -1,7 +1,14 @@ -import { Feature, IncidentInvolvedUnit, MiscCadSettings } from "@prisma/client"; +import { Feature, type IncidentInvolvedUnit, type MiscCadSettings } from "@prisma/client"; import { captureException } from "@sentry/node"; import type { cad } from "@prisma/client"; -import { Context, Inject, Injectable, Middleware, MiddlewareMethods, Next } from "@tsed/common"; +import { + Context, + Inject, + Injectable, + Middleware, + type MiddlewareMethods, + Next, +} from "@tsed/common"; import { isFeatureEnabled } from "lib/upsert-cad"; import { handleEndCall } from "lib/dispatch/911-calls/handle-end-911-call"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/middlewares/is-enabled.ts b/apps/api/src/middlewares/is-enabled.ts index 8aaec468e..5360a07b5 100644 --- a/apps/api/src/middlewares/is-enabled.ts +++ b/apps/api/src/middlewares/is-enabled.ts @@ -1,7 +1,7 @@ -import { Middleware, MiddlewareMethods, Context, Next } from "@tsed/common"; +import { Middleware, type MiddlewareMethods, Context, Next } from "@tsed/common"; import { UseBefore } from "@tsed/platform-middlewares"; import { StoreSet, useDecorators } from "@tsed/core"; -import { CadFeature, Feature as DatabaseFeature, Feature } from "@prisma/client"; +import { type CadFeature, Feature as DatabaseFeature, Feature } from "@prisma/client"; import type { CadFeatureOptions, Feature as TypesFeature } from "@snailycad/types"; import { setCADFeatures } from "./auth/is-auth"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/middlewares/use-permissions.ts b/apps/api/src/middlewares/use-permissions.ts index 6ee12c6ff..8da010df5 100644 --- a/apps/api/src/middlewares/use-permissions.ts +++ b/apps/api/src/middlewares/use-permissions.ts @@ -1,4 +1,4 @@ -import { Middleware, MiddlewareMethods, Context, Req, Next } from "@tsed/common"; +import { Middleware, type MiddlewareMethods, Context, Req, Next } from "@tsed/common"; import { UseBefore } from "@tsed/platform-middlewares"; import { StoreSet, useDecorators } from "@tsed/core"; import type { User } from "@prisma/client"; diff --git a/apps/api/src/middlewares/valid-path.ts b/apps/api/src/middlewares/valid-path.ts index 8cfc72c6c..7d1246419 100644 --- a/apps/api/src/middlewares/valid-path.ts +++ b/apps/api/src/middlewares/valid-path.ts @@ -1,4 +1,4 @@ -import { PathParams, QueryParams, Middleware, MiddlewareMethods, Next } from "@tsed/common"; +import { PathParams, QueryParams, Middleware, type MiddlewareMethods, Next } from "@tsed/common"; import { BadRequest } from "@tsed/exceptions"; // penal_code_group is only allowed for /position diff --git a/apps/api/src/server.ts b/apps/api/src/server.ts index dc74ec777..74d918639 100644 --- a/apps/api/src/server.ts +++ b/apps/api/src/server.ts @@ -7,13 +7,13 @@ import process from "node:process"; import { Configuration, Inject, - PlatformApplication, - PlatformContext, - Request, - Response, - ResponseErrorObject, + type PlatformApplication, + type PlatformContext, + type Request, + type Response, + type ResponseErrorObject, } from "@tsed/common"; -import { Catch, ExceptionFilterMethods } from "@tsed/platform-exceptions"; +import { Catch, type ExceptionFilterMethods } from "@tsed/platform-exceptions"; import type { Exception } from "@tsed/exceptions"; import { json } from "express"; import compress from "compression"; diff --git a/apps/api/src/services/socket-service.ts b/apps/api/src/services/socket-service.ts index 1d40ae36e..c1f2b5ca2 100644 --- a/apps/api/src/services/socket-service.ts +++ b/apps/api/src/services/socket-service.ts @@ -1,21 +1,21 @@ -import * as SocketIO from "socket.io"; +import type * as SocketIO from "socket.io"; import { Nsp, SocketService } from "@tsed/socketio"; import { SocketEvents } from "@snailycad/config"; import { - LeoIncident, - Call911, - TowCall, - Bolo, - TaxiCall, + type LeoIncident, + type Call911, + type TowCall, + type Bolo, + type TaxiCall, ShouldDoType, - Officer, - CombinedLeoUnit, - IncidentEvent, - EmsFdDeputy, - Warrant, - ActiveTone, - DispatchChat, - Citizen, + type Officer, + type CombinedLeoUnit, + type IncidentEvent, + type EmsFdDeputy, + type Warrant, + type ActiveTone, + type DispatchChat, + type Citizen, } from "@prisma/client"; import { prisma } from "lib/data/prisma"; import { @@ -26,7 +26,7 @@ import { } from "utils/leo/includes"; import { Injectable } from "@tsed/di"; import { generateCallsign } from "@snailycad/utils"; -import { MiscCadSettings } from "@snailycad/types"; +import { type MiscCadSettings } from "@snailycad/types"; type FullIncident = LeoIncident & { unitsInvolved: any[]; events?: IncidentEvent[] }; diff --git a/apps/api/src/utils/businesses.ts b/apps/api/src/utils/businesses.ts index 57abb8c73..86b06c88a 100644 --- a/apps/api/src/utils/businesses.ts +++ b/apps/api/src/utils/businesses.ts @@ -1,4 +1,4 @@ -import { cad, WhitelistStatus } from "@prisma/client"; +import { type cad, WhitelistStatus } from "@prisma/client"; import { BadRequest } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; diff --git a/apps/api/src/utils/leo/includes.ts b/apps/api/src/utils/leo/includes.ts index fa570f173..0b7bee015 100644 --- a/apps/api/src/utils/leo/includes.ts +++ b/apps/api/src/utils/leo/includes.ts @@ -1,5 +1,5 @@ import { Prisma } from "@prisma/client"; -import { LimitedUserPicks } from "@snailycad/types"; +import { type LimitedUserPicks } from "@snailycad/types"; export const limitedUserSelect: Record = { id: true, diff --git a/apps/api/src/utils/zod-error-map.ts b/apps/api/src/utils/zod-error-map.ts index c79cf53ce..3fd8d42b0 100644 --- a/apps/api/src/utils/zod-error-map.ts +++ b/apps/api/src/utils/zod-error-map.ts @@ -1,5 +1,11 @@ import { getTranslator } from "utils/get-translator"; -import { ErrorMapCtx, util, ZodIssueCode, ZodIssueOptionalMessage, ZodParsedType } from "zod"; +import { + type ErrorMapCtx, + util, + ZodIssueCode, + type ZodIssueOptionalMessage, + ZodParsedType, +} from "zod"; export async function getErrorMap(locale?: string) { const t = await getTranslator({ diff --git a/apps/client/src/components/admin/AdminLayout.tsx b/apps/client/src/components/admin/AdminLayout.tsx index 3e57411f5..ad838c2f4 100644 --- a/apps/client/src/components/admin/AdminLayout.tsx +++ b/apps/client/src/components/admin/AdminLayout.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { Nav } from "components/shared/nav/Nav"; import { useRoleplayStopped } from "hooks/global/useRoleplayStopped"; import { classNames } from "lib/classNames"; diff --git a/apps/client/src/components/admin/Sidebar/SidebarSection.tsx b/apps/client/src/components/admin/Sidebar/SidebarSection.tsx index 10a4ed0c3..4a391c971 100644 --- a/apps/client/src/components/admin/Sidebar/SidebarSection.tsx +++ b/apps/client/src/components/admin/Sidebar/SidebarSection.tsx @@ -1,4 +1,4 @@ -import { usePermission, Permissions } from "hooks/usePermission"; +import { usePermission, type Permissions } from "hooks/usePermission"; import { classNames } from "lib/classNames"; import type { ReactNode } from "react"; diff --git a/apps/client/src/components/admin/Sidebar/routes.ts b/apps/client/src/components/admin/Sidebar/routes.ts index 6cf34c796..7a5e09145 100644 --- a/apps/client/src/components/admin/Sidebar/routes.ts +++ b/apps/client/src/components/admin/Sidebar/routes.ts @@ -1,5 +1,5 @@ import { defaultPermissions, Permissions } from "@snailycad/permissions"; -import { Feature, ValueType } from "@snailycad/types"; +import { type Feature, ValueType } from "@snailycad/types"; export interface SidebarRoute { permissions: Permissions[]; diff --git a/apps/client/src/components/admin/manage/cad-settings/api-token-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/api-token-tab.tsx index 3d482cb7d..aa1f74100 100644 --- a/apps/client/src/components/admin/manage/cad-settings/api-token-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/api-token-tab.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { Button, Loader, SwitchField, TextField } from "@snailycad/ui"; import { useAuth } from "context/AuthContext"; import { Form, Formik, type FormikHelpers } from "formik"; diff --git a/apps/client/src/components/admin/manage/cad-settings/discord-roles-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/discord-roles-tab.tsx index 30983e98b..e986df6c5 100644 --- a/apps/client/src/components/admin/manage/cad-settings/discord-roles-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/discord-roles-tab.tsx @@ -8,7 +8,7 @@ import { useAuth } from "context/AuthContext"; import type { DiscordRole, DiscordRoles } from "@snailycad/types"; import { SettingsFormField } from "components/form/SettingsFormField"; import { FormField } from "components/form/FormField"; -import { defaultPermissions, Permissions } from "@snailycad/permissions"; +import { defaultPermissions, type Permissions } from "@snailycad/permissions"; import { toastMessage } from "lib/toastMessage"; import type { GetCADDiscordRolesData, PostCADDiscordRolesData } from "@snailycad/types/api"; import Link from "next/link"; diff --git a/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/WebhookSettingsField.tsx b/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/WebhookSettingsField.tsx index 2d829f5c9..6dad5cc8c 100644 --- a/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/WebhookSettingsField.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/WebhookSettingsField.tsx @@ -5,7 +5,7 @@ import { FormField } from "components/form/FormField"; import { useFormikContext } from "formik"; import type { GetCADDiscordWebhooksData } from "@snailycad/types/api"; import { useTranslations } from "use-intl"; -import { DiscordWebhookType } from "@snailycad/types"; +import { type DiscordWebhookType } from "@snailycad/types"; interface FieldProps { description?: string; diff --git a/apps/client/src/components/admin/manage/cad-settings/general/cad-features-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/general/cad-features-tab.tsx index dd59e5867..f7db8aa65 100644 --- a/apps/client/src/components/admin/manage/cad-settings/general/cad-features-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/general/cad-features-tab.tsx @@ -95,7 +95,6 @@ export function CADFeaturesTab() { async function onSubmit(values: typeof INITIAL_VALUES) { if (!cad) return; const featuresArr = Object.entries(values.features).map(([key, value]) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition const extraFields = values.options[key as keyof CadFeatureOptions] ?? undefined; return { diff --git a/apps/client/src/components/admin/manage/units/QualificationsTable.tsx b/apps/client/src/components/admin/manage/units/QualificationsTable.tsx index 7788e0a5e..3cf5584e9 100644 --- a/apps/client/src/components/admin/manage/units/QualificationsTable.tsx +++ b/apps/client/src/components/admin/manage/units/QualificationsTable.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { QualificationValueType, type UnitQualification } from "@snailycad/types"; import { Button, FullDate } from "@snailycad/ui"; import { AlertModal } from "components/modal/AlertModal"; @@ -33,13 +33,11 @@ export function QualificationsTable({ const modalState = useModal(); const awards = - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition unit.qualifications?.filter( (v) => v.qualification.qualificationType === QualificationValueType.AWARD, ) ?? []; const qualifications = - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition unit.qualifications?.filter( (v) => v.qualification.qualificationType === QualificationValueType.QUALIFICATION, ) ?? []; diff --git a/apps/client/src/components/admin/values/ManageValueModal.tsx b/apps/client/src/components/admin/values/ManageValueModal.tsx index 402b31dbc..7d1964924 100644 --- a/apps/client/src/components/admin/values/ManageValueModal.tsx +++ b/apps/client/src/components/admin/values/ManageValueModal.tsx @@ -19,7 +19,7 @@ import { type AnyValue, DriversLicenseCategoryType, EmployeeAsEnum, - Feature, + type Feature, QualificationValueType, ValueType, } from "@snailycad/types"; diff --git a/apps/client/src/components/admin/values/penal-codes/manage-penal-code-modal.tsx b/apps/client/src/components/admin/values/penal-codes/manage-penal-code-modal.tsx index b6dbcb44d..7d488e74e 100644 --- a/apps/client/src/components/admin/values/penal-codes/manage-penal-code-modal.tsx +++ b/apps/client/src/components/admin/values/penal-codes/manage-penal-code-modal.tsx @@ -6,7 +6,7 @@ import { Form, Formik, useFormikContext } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; -import { type PenalCode, ValueType, PenalCodeType } from "@snailycad/types"; +import { type PenalCode, type ValueType, PenalCodeType } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { dataToSlate, Editor } from "components/editor/editor"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/bleeter/manage-bleet-modal.tsx b/apps/client/src/components/bleeter/manage-bleet-modal.tsx index f6a4ebb7d..e9a771b43 100644 --- a/apps/client/src/components/bleeter/manage-bleet-modal.tsx +++ b/apps/client/src/components/bleeter/manage-bleet-modal.tsx @@ -73,7 +73,6 @@ export function ManageBleetModal({ post, onCreate, onUpdate }: Props) { } } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (json.id && values.image) { const fd = new FormData(); diff --git a/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-call-popover.tsx b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-call-popover.tsx index 272169a42..05f0a2e6f 100644 --- a/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-call-popover.tsx +++ b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-call-popover.tsx @@ -51,7 +51,6 @@ export function AddCallPopover() { name="call911Id" selectedKey={values.call911Id} onSelectionChange={(key) => { - // eslint-disable-next-line if (key === null) { // key can be null setValues({ ...values, call911: null, call911Id: null }); diff --git a/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-incident-popover.tsx b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-incident-popover.tsx index acb175252..93deeb7ee 100644 --- a/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-incident-popover.tsx +++ b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/add-incident-popover.tsx @@ -51,7 +51,6 @@ export function AddIncidentPopover() { name="incidentId" selectedKey={values.incidentId} onSelectionChange={(key) => { - // eslint-disable-next-line if (key === null) { // key can be null setValues({ ...values, incident: null, incidentId: null }); diff --git a/apps/client/src/components/dispatch/map/calls/active-map-calls.tsx b/apps/client/src/components/dispatch/map/calls/active-map-calls.tsx index 26ff560be..153ab9eca 100644 --- a/apps/client/src/components/dispatch/map/calls/active-map-calls.tsx +++ b/apps/client/src/components/dispatch/map/calls/active-map-calls.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { createPortal } from "react-dom"; import { useTranslations } from "next-intl"; import type { Full911Call } from "state/dispatch/dispatch-state"; diff --git a/apps/client/src/components/dispatch/map/units/unit-item.tsx b/apps/client/src/components/dispatch/map/units/unit-item.tsx index e6aaffe09..2620bdd52 100644 --- a/apps/client/src/components/dispatch/map/units/unit-item.tsx +++ b/apps/client/src/components/dispatch/map/units/unit-item.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { makeUnitName } from "lib/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import type { MapPlayer } from "types/map"; diff --git a/apps/client/src/components/form/Select.tsx b/apps/client/src/components/form/Select.tsx index 4ab4471a5..8ab73f195 100644 --- a/apps/client/src/components/form/Select.tsx +++ b/apps/client/src/components/form/Select.tsx @@ -79,7 +79,6 @@ export function Select({ name, onChange, ...rest }: Props) { onChange={(v: any, meta) => handleChange(v, meta)} noOptionsMessage={() => common("noOptions")} styles={styles({ ...theme, hasError: Boolean(rest.errorMessage) })} - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain, @typescript-eslint/no-unnecessary-condition menuPortalTarget={(typeof document !== "undefined" && document.body) || undefined} components={ rest.extra?.showPenalCodeDescriptions diff --git a/apps/client/src/components/leo/logs/OfficerLogsTable.tsx b/apps/client/src/components/leo/logs/OfficerLogsTable.tsx index a85b32838..8c4c0db84 100644 --- a/apps/client/src/components/leo/logs/OfficerLogsTable.tsx +++ b/apps/client/src/components/leo/logs/OfficerLogsTable.tsx @@ -1,4 +1,4 @@ -import { Table, useAsyncTable, useTableState } from "components/shared/Table"; +import { Table, type useAsyncTable, useTableState } from "components/shared/Table"; import formatDistance from "date-fns/formatDistance"; import { useImageUrl } from "hooks/useImageUrl"; import { makeUnitName } from "lib/utils"; diff --git a/apps/client/src/components/leo/manage-officer/manage-officer-fields.tsx b/apps/client/src/components/leo/manage-officer/manage-officer-fields.tsx index 623a133f0..c8dce142d 100644 --- a/apps/client/src/components/leo/manage-officer/manage-officer-fields.tsx +++ b/apps/client/src/components/leo/manage-officer/manage-officer-fields.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { TextField, FormRow } from "@snailycad/ui"; import { FormField } from "components/form/FormField"; import { Select } from "components/form/Select"; diff --git a/apps/client/src/components/leo/modals/manage-record/penal-codes-table.tsx b/apps/client/src/components/leo/modals/manage-record/penal-codes-table.tsx index c42c3602d..1541599e4 100644 --- a/apps/client/src/components/leo/modals/manage-record/penal-codes-table.tsx +++ b/apps/client/src/components/leo/modals/manage-record/penal-codes-table.tsx @@ -4,7 +4,7 @@ import { useTranslations } from "next-intl"; import type { PenalCode } from "@snailycad/types"; import { TableItemForm } from "./table-item-form"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; -import { createInitialRecordValues } from "./manage-record-modal"; +import { type createInitialRecordValues } from "./manage-record-modal"; interface Props { penalCodes: PenalCode[]; diff --git a/apps/client/src/components/leo/modals/manage-record/table-item-form.tsx b/apps/client/src/components/leo/modals/manage-record/table-item-form.tsx index bac94e36a..b89b4a6f3 100644 --- a/apps/client/src/components/leo/modals/manage-record/table-item-form.tsx +++ b/apps/client/src/components/leo/modals/manage-record/table-item-form.tsx @@ -4,9 +4,9 @@ import type { SelectValue } from "components/form/Select"; import { useFormikContext } from "formik"; import { useTranslations } from "next-intl"; import type { PenalCode } from "@snailycad/types"; -import type React from "react"; +import React from "react"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; -import { createInitialRecordValues } from "./manage-record-modal"; +import { type createInitialRecordValues } from "./manage-record-modal"; type PenalCodeValueName = "counts" | "fine" | "jailTime" | "bail" | "communityService"; interface PenalCodeValue { diff --git a/apps/client/src/components/modal/AlertModal.tsx b/apps/client/src/components/modal/AlertModal.tsx index e4a1a20bc..4729e121f 100644 --- a/apps/client/src/components/modal/AlertModal.tsx +++ b/apps/client/src/components/modal/AlertModal.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { Loader, Button } from "@snailycad/ui"; import { classNames } from "lib/classNames"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/hooks/useGenerateCallsign.ts b/apps/client/src/hooks/useGenerateCallsign.ts index 1a1b216de..fffdf434d 100644 --- a/apps/client/src/hooks/useGenerateCallsign.ts +++ b/apps/client/src/hooks/useGenerateCallsign.ts @@ -27,7 +27,6 @@ export function useGenerateCallsign() { const miscCadSettings = cad?.miscCadSettings; function _generateCallsign(unit: Unit, templateId: TemplateId = "callsignTemplate") { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!unit) return ""; const activeDivisionCallsign = diff --git a/apps/client/src/lib/fetch.ts b/apps/client/src/lib/fetch.ts index 9540ac05f..a81669d47 100644 --- a/apps/client/src/lib/fetch.ts +++ b/apps/client/src/lib/fetch.ts @@ -30,7 +30,6 @@ export async function handleRequest( let contentType = options?.headers?.["content-type"] ?? "application/json"; const formData = data as unknown as FormData | undefined; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if ((formData?.get?.("file") || formData?.get?.("image")) && contentType === "application/json") { contentType = "multipart/form-data"; } diff --git a/apps/client/src/lib/fetch/errors.ts b/apps/client/src/lib/fetch/errors.ts index d8e9d9366..a22993a6b 100644 --- a/apps/client/src/lib/fetch/errors.ts +++ b/apps/client/src/lib/fetch/errors.ts @@ -1,6 +1,7 @@ import { AxiosError } from "axios"; import type { TranslationValues } from "use-intl"; +// eslint-disable-next-line @typescript-eslint/consistent-type-imports export type ErrorMessages = (typeof import("../../../locales/en/common.json"))["Errors"]; export type ErrorMessage = keyof ErrorMessages; diff --git a/apps/client/src/lib/table/create-table-dnd-column.tsx b/apps/client/src/lib/table/create-table-dnd-column.tsx index 080276adb..62ff01fed 100644 --- a/apps/client/src/lib/table/create-table-dnd-column.tsx +++ b/apps/client/src/lib/table/create-table-dnd-column.tsx @@ -1,5 +1,5 @@ import { classNames } from "lib/classNames"; -import { DRAGGABLE_TABLE_HANDLE, useTableState } from "components/shared/Table"; +import { DRAGGABLE_TABLE_HANDLE, type useTableState } from "components/shared/Table"; import { ArrowDownUp, ArrowsExpand } from "react-bootstrap-icons"; import type { ColumnDef, RowData } from "@tanstack/react-table"; diff --git a/apps/client/src/lib/useFetch.tsx b/apps/client/src/lib/useFetch.tsx index 612245d1a..2a7f8e500 100644 --- a/apps/client/src/lib/useFetch.tsx +++ b/apps/client/src/lib/useFetch.tsx @@ -39,6 +39,7 @@ interface Return { } let config: Awaited> | undefined; +// eslint-disable-next-line @typescript-eslint/consistent-type-imports let handleRequest: typeof import("./fetch").handleRequest | undefined; export default function useFetch({ overwriteState }: UseFetchOptions = { overwriteState: null }) { diff --git a/apps/client/src/lib/utils.ts b/apps/client/src/lib/utils.ts index f133be140..be12bbbb4 100644 --- a/apps/client/src/lib/utils.ts +++ b/apps/client/src/lib/utils.ts @@ -48,7 +48,7 @@ export function makeUnitName( if (!unit) return "UNKNOWN"; const isCombined = isUnitCombined(unit) || isUnitCombinedEmsFd(unit); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (isCombined || !unit.citizen) return ""; return `${unit.citizen.name} ${unit.citizen.surname}`; diff --git a/apps/client/src/state/mapState.ts b/apps/client/src/state/mapState.ts index 1896e9925..c0b13089e 100644 --- a/apps/client/src/state/mapState.ts +++ b/apps/client/src/state/mapState.ts @@ -1,5 +1,5 @@ -import { ConnectionStatus } from "@snailycad/ui"; -import { Socket } from "socket.io-client"; +import { type ConnectionStatus } from "@snailycad/ui"; +import { type Socket } from "socket.io-client"; import type { SmartMotorwaySignMarker, SmartSignMarker } from "types/map"; import { persist, createJSONStorage } from "zustand/middleware"; import { shallow } from "zustand/shallow"; diff --git a/packages/types/src/lib/cad-feature.ts b/packages/types/src/lib/cad-feature.ts index db42b1c72..7b60bb1a7 100644 --- a/packages/types/src/lib/cad-feature.ts +++ b/packages/types/src/lib/cad-feature.ts @@ -1,4 +1,4 @@ -import * as Enums from "../enums"; +import type * as Enums from "../enums"; export interface CadFeatureOptions { [Enums.Feature.LICENSE_EXAMS]: LicenseExamFeatureOption; diff --git a/packages/ui/src/components/alert/alert.tsx b/packages/ui/src/components/alert/alert.tsx index 93fda638b..bd18e529a 100644 --- a/packages/ui/src/components/alert/alert.tsx +++ b/packages/ui/src/components/alert/alert.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { ExclamationCircleFill } from "react-bootstrap-icons"; import { type VariantProps, cva } from "class-variance-authority"; diff --git a/packages/ui/src/components/dnd/dnd-provider.tsx b/packages/ui/src/components/dnd/dnd-provider.tsx index a99b23bf7..83478128f 100644 --- a/packages/ui/src/components/dnd/dnd-provider.tsx +++ b/packages/ui/src/components/dnd/dnd-provider.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { DndProvider as ReactDndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; diff --git a/packages/ui/src/components/form-row.tsx b/packages/ui/src/components/form-row.tsx index 989da1d3a..f7e6d2695 100644 --- a/packages/ui/src/components/form-row.tsx +++ b/packages/ui/src/components/form-row.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { cn } from "mxcn"; type Props = React.PropsWithoutRef & { diff --git a/packages/ui/src/components/infofield.tsx b/packages/ui/src/components/infofield.tsx index 8d43b9359..40725833e 100644 --- a/packages/ui/src/components/infofield.tsx +++ b/packages/ui/src/components/infofield.tsx @@ -1,4 +1,4 @@ -import type * as React from "react"; +import * as React from "react"; import { cn } from "mxcn"; type ParagraphProps = React.PropsWithoutRef; diff --git a/packages/utils/src/editor/slate-data-to-string.ts b/packages/utils/src/editor/slate-data-to-string.ts index ee1aec52f..ec7ec891c 100644 --- a/packages/utils/src/editor/slate-data-to-string.ts +++ b/packages/utils/src/editor/slate-data-to-string.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ - import { Editor, Element as SlateElement, type Descendant } from "slate"; export function slateDataToString(data: Descendant[] | null) {