From 91a8b9518c706b7c08101473bed531e47c778df7 Mon Sep 17 00:00:00 2001 From: Casper Iversen <53900565+casperiv0@users.noreply.github.com> Date: Sun, 15 Oct 2023 12:37:23 +0200 Subject: [PATCH] chore: improved tsconfig (#1842) --- .eslintrc | 7 ++++- .../src/controllers/admin/admin-controller.ts | 2 +- .../import/import-citizens-controller.ts | 2 +- .../import/import-vehicles-controller.ts | 2 +- .../admin/import/import-weapons-controller.ts | 2 +- .../cad-settings/cad-settings-controller.ts | 10 +++++-- .../cad-settings-images-controller.ts | 8 +++--- .../discord/DiscordSettingsController.ts | 4 +-- .../discord/DiscordWebhooksController.ts | 13 ++++++--- .../cad-settings/live-map-controller.ts | 4 +-- .../cad-settings/raw-webhooks-controller.ts | 2 +- .../citizens/records-logs-controller.ts | 2 +- .../courthouse/pending-warrants-controller.ts | 2 +- .../manage/manage-businesses-controller.ts | 2 +- .../manage/manage-custom-fields-controller.ts | 2 +- .../manage/manage-custom-roles-controller.ts | 6 ++-- .../admin/manage/manage-users-controller.ts | 6 ++-- .../manage/units/manage-units-controller.ts | 14 +++++----- .../admin/values/import-values-controller.ts | 10 +++---- .../admin/values/values-controller.ts | 10 +++++-- .../src/controllers/auth/2fa-controller.ts | 2 +- .../src/controllers/auth/auth-controller.ts | 11 ++++++-- .../auth/discord-auth-controller.ts | 2 +- .../controllers/auth/steam-auth-controller.ts | 2 +- .../auth/user/user-api-token-controller.ts | 2 +- .../controllers/auth/user/user-controller.ts | 10 +++++-- .../controllers/bleeter/bleeter-controller.ts | 10 +++---- .../bleeter/bleeter-profile-controller.ts | 2 +- .../business/BusinessController.ts | 6 ++-- .../business/EmployeeController.ts | 2 +- .../controllers/business/PostsController.ts | 3 +- .../src/controllers/calls/taxi-controller.ts | 2 +- .../src/controllers/calls/tow-controller.ts | 12 ++++---- .../controllers/citizen/CitizenController.ts | 13 +++++++-- .../controllers/citizen/LicenseController.ts | 2 +- .../citizen/MedicalRecordController.ts | 3 +- .../controllers/citizen/pets-controller.ts | 6 ++-- .../citizen/truck-logs-controller.ts | 2 +- .../citizen/vehicles-controller.ts | 18 ++++++------ .../controllers/citizen/weapon-controller.ts | 2 +- .../court/ExpungementRequestsController.ts | 2 +- .../court/NameChangeRequestController.ts | 2 +- .../court/courthouse-posts-controller.ts | 2 +- .../911-calls/calls-911-controller.ts | 10 +++---- .../controllers/dispatch/bolo-controller.ts | 8 +++--- .../dispatch/combined-units-controller.ts | 4 +-- .../dispatch/dispatch-controller.ts | 2 +- .../dispatch/private-messages-controller.ts | 4 +-- .../controllers/dispatch/status-controller.ts | 14 +++++----- .../controllers/ems-fd/ems-fd-controller.ts | 8 +++--- .../incidents/ems-fd-incidents-controller.ts | 2 +- apps/api/src/controllers/leo/DmvController.ts | 2 +- .../api/src/controllers/leo/JailController.ts | 2 +- apps/api/src/controllers/leo/LeoController.ts | 9 ++++-- .../controllers/leo/LicenseExamsController.ts | 8 +++--- .../leo/bureau-of-firearms-controller.ts | 2 +- .../src/controllers/leo/create-where-obj.ts | 2 +- .../leo/incidents/IncidentController.ts | 2 +- .../leo/my-officers/MyOfficersController.ts | 6 ++-- .../leo/my-officers/upsert-officer.ts | 14 +++++----- .../leo/search/SearchActionsController.ts | 16 +++++------ .../leo/search/SearchController.ts | 10 +++---- apps/api/src/controllers/nav-controller.ts | 4 +-- .../controllers/record/records-controller.ts | 18 ++++++------ apps/api/src/lib/auth/getSessionUser.ts | 1 - apps/api/src/lib/auth/validateUser.ts | 2 +- .../lib/citizen/citizen-create-data-obj.ts | 2 +- .../api/src/lib/citizen/has-citizen-access.ts | 2 +- apps/api/src/lib/data/validate-schema.ts | 2 +- apps/api/src/lib/discord/auth.ts | 8 ++++-- apps/api/src/lib/discord/register-metadata.ts | 4 +-- .../911-calls/assign-units-to-911-call.ts | 2 +- apps/api/src/lib/dispatch/webhooks.ts | 14 +++++----- .../src/lib/ems-fd/upsert-ems-fd-deputy.ts | 12 ++++---- apps/api/src/lib/get-active-ems-fd-deputy.ts | 2 +- .../lib/incidents/handle-involved-units.ts | 7 ++++- apps/api/src/lib/leo/activeOfficer.ts | 2 +- .../src/lib/leo/handleStartEndOfficerLog.ts | 2 +- apps/api/src/lib/leo/handleWhitelistStatus.ts | 8 +++--- apps/api/src/lib/leo/officerOrDeputyToUnit.ts | 2 +- apps/api/src/lib/leo/records/penal-code.ts | 2 +- apps/api/src/lib/leo/records/upsert-record.ts | 10 +++++-- .../lib/leo/records/validate-record-data.ts | 7 ++++- .../src/lib/leo/send-panic-button-webhook.ts | 14 +++++----- apps/api/src/lib/leo/utils.ts | 14 +++++----- .../src/lib/leo/validateDuplicateCallsigns.ts | 2 +- .../api/src/lib/values/create-where-object.ts | 2 +- apps/api/src/lib/values/utils.ts | 2 +- apps/api/src/middlewares/active-deputy.ts | 2 +- apps/api/src/middlewares/active-officer.ts | 2 +- apps/api/src/middlewares/auth/is-auth.ts | 6 ++-- apps/api/src/middlewares/auth/utils/utils.ts | 2 +- apps/api/src/middlewares/handle-inactivity.ts | 11 ++++++-- apps/api/src/middlewares/is-enabled.ts | 4 +-- apps/api/src/middlewares/use-permissions.ts | 2 +- apps/api/src/middlewares/valid-path.ts | 2 +- apps/api/src/server.ts | 10 +++---- apps/api/src/services/socket-service.ts | 28 +++++++++---------- apps/api/src/utils/businesses.ts | 2 +- apps/api/src/utils/leo/includes.ts | 2 +- apps/api/src/utils/zod-error-map.ts | 8 +++++- apps/api/tsconfig.json | 10 ++----- .../account/2fa/manage-2fa-modal.tsx | 2 +- .../account/settings/account-settings-tab.tsx | 2 +- .../account/settings/change-password-area.tsx | 2 +- .../components/account/user-api-token-tab.tsx | 2 +- .../components/active-bolos/bolo-filters.tsx | 2 +- .../active-bolos/manage-bolo-modal.tsx | 2 +- .../src/components/admin/AdminLayout.tsx | 2 +- apps/client/src/components/admin/Sidebar.tsx | 2 +- .../admin/Sidebar/SidebarSection.tsx | 2 +- .../src/components/admin/Sidebar/routes.ts | 2 +- .../components/admin/import/ImportModal.tsx | 2 +- .../manage/cad-settings/api-token-tab.tsx | 4 +-- .../cad-settings/default-permissions-tab.tsx | 4 +-- .../manage/cad-settings/discord-roles-tab.tsx | 4 +-- .../discord-webhooks/WebhookSettingsField.tsx | 2 +- .../discord-webhooks/discord-webhooks-tab.tsx | 2 +- .../general/blacklisted-words-tab.tsx | 4 +-- .../cad-settings/general/cad-features-tab.tsx | 5 ++-- .../general/general-settings-tab.tsx | 2 +- .../import-blacklisted-words-modal.tsx | 2 +- .../cad-settings/general/whitelist-tab.tsx | 2 +- .../manage/cad-settings/live-map-tab.tsx | 4 +-- .../misc-features/inactivity-timeout-tab.tsx | 4 +-- .../misc-features/license-number-tab.tsx | 4 +-- .../cad-settings/misc-features/limits-tab.tsx | 4 +-- .../misc-features/max-license-points-tab.tsx | 4 +-- .../misc-features/other-misc-tab.tsx | 2 +- .../misc-features/template-tab.tsx | 4 +-- .../manage/citizens/all-citizens-tab.tsx | 2 +- .../courthouse/pending-warrants-tab.tsx | 2 +- .../custom-fields/ManageCustomFieldModal.tsx | 4 +-- .../manage-custom-roles-modal.tsx | 2 +- .../manage/units/QualificationsTable.tsx | 6 ++-- .../tabs/manage-unit-tab/manage-unit-tab.tsx | 2 +- .../users/modals/manage-permissions-modal.tsx | 2 +- .../admin/values/ManageValueModal.tsx | 6 ++-- .../values/import/import-values-modal.tsx | 2 +- .../values/manage-modal/address-fields.tsx | 2 +- .../values/manage-modal/department-fields.tsx | 2 +- .../manage-modal/department-links-section.tsx | 4 +-- .../values/manage-modal/division-fields.tsx | 2 +- .../manage-modal/emergency-vehicle-fields.tsx | 2 +- .../values/manage-modal/license-fields.tsx | 2 +- .../manage-modal/qualification-fields.tsx | 2 +- .../manage-modal/status-value-fields.tsx | 4 +-- .../values/manage-modal/vehicle-fields.tsx | 2 +- .../penal-codes/manage-penal-code-modal.tsx | 2 +- .../src/components/auth/api-verification.tsx | 2 +- .../src/components/auth/login/login-form.tsx | 2 +- .../components/bleeter/list/posts-list.tsx | 2 +- .../components/bleeter/manage-bleet-modal.tsx | 3 +- .../bleeter/modals/edit-profile-modal.tsx | 2 +- .../modals/followers-following-modal.tsx | 2 +- .../bleeter/new-bleeter-experience.tsx | 4 +-- .../business/join-business-modal.tsx | 2 +- .../tabs/employees-tab/employees-tab.tsx | 4 +-- .../employees-tab/manage-employee-modal.tsx | 4 +-- .../manage/tabs/pending-employees-tab.tsx | 2 +- .../roles-tab/manage-business-role-modal.tsx | 4 +-- .../components/citizen/ManageCitizenForm.tsx | 2 +- .../licenses/ManageLicensesFormFields.tsx | 7 ++++- .../citizen/licenses/licenses-card.tsx | 10 +++++-- .../create-previous-records-step.tsx | 2 +- .../manage-medical-records-modal.tsx | 2 +- .../citizen/pets/manage-pet-modal.tsx | 6 ++-- .../manage-pet-medical-record-modal.tsx | 2 +- .../pet-medical-records-card.tsx | 2 +- .../citizen/pets/notes/pet-notes-card.tsx | 2 +- .../citizen/records/citizen-records-card.tsx | 2 +- .../citizen/tow/assign-to-tow-taxi-call.tsx | 2 +- .../modals/register-vehicle-modal.tsx | 6 ++-- .../citizen/weapons/register-weapon-modal.tsx | 6 ++-- .../manage-court-entry-modal.tsx | 2 +- .../manage-courthouse-post-modal.tsx | 2 +- .../name-change/request-name-change-modal.tsx | 2 +- .../dispatch/active-calls/active-calls.tsx | 4 +-- .../dispatch/active-calls/call-filters.tsx | 2 +- .../columns/assigned-units-column.tsx | 2 +- .../modals/assigned-units-table.tsx | 2 +- .../modals/manage-911-call-modal.tsx | 4 +-- .../columns/actions-column.tsx | 2 +- .../active-units/deputies/active-deputies.tsx | 6 ++-- .../active-units/deputies/deputy-column.tsx | 2 +- .../active-units/modals/manage-unit-modal.tsx | 7 ++++- .../active-units/officers/active-officers.tsx | 6 ++-- .../officers/columns/active-call-column.tsx | 2 +- .../columns/active-incident-column.tsx | 2 +- .../officers/columns/officer-column.tsx | 2 +- .../private-messages/message-item.tsx | 4 +-- .../private-messages-modal.tsx | 6 ++-- .../send-message-form/add-call-popover.tsx | 3 +- .../add-incident-popover.tsx | 3 +- .../send-message-form/send-message-form.tsx | 4 +-- .../dispatch/events/UpdateEventForm.tsx | 2 +- .../dispatch/map/calls/active-map-calls.tsx | 2 +- .../map/calls/render-active-map-calls.tsx | 2 +- .../map/modals/select-map-server-modal.tsx | 4 +-- .../dispatch/map/render-map-blips.tsx | 2 +- .../map/smart-signs/use-smart-signs.tsx | 2 +- .../dispatch/map/units/active-map-units.tsx | 2 +- .../dispatch/map/units/unit-item.tsx | 2 +- .../dispatch/modals/tones-modal.tsx | 4 +-- apps/client/src/components/editor/editor.tsx | 13 ++++++--- .../editor/elements/checklist-item.tsx | 2 +- apps/client/src/components/editor/toolbar.tsx | 2 +- .../src/components/ems-fd/ModalButtons.tsx | 2 +- .../modals/deputy/manage-deputy-modal.tsx | 2 +- .../modals/deputy/select-deputy-modal.tsx | 4 +-- .../tabs/doctor-visits-tab.tsx | 2 +- .../tabs/medical-records-tab.tsx | 4 +-- apps/client/src/components/form/Select.tsx | 9 +++--- .../form/inputs/ImageSelectInput.tsx | 4 +-- .../form/inputs/value-select-field.tsx | 2 +- .../select/MultiValueContainerPenalCode.tsx | 2 +- .../components/form/select/PostalSelect.tsx | 2 +- .../src/components/leo/ModalButtons.tsx | 2 +- .../components/leo/UnitDepartmentStatus.tsx | 2 +- .../leo/active-warrants/active-warrants.tsx | 2 +- .../link-call-to-citizen-modal.tsx | 2 +- .../leo/citizen-logs/arrest-reports-tab.tsx | 2 +- .../leo/exams/manage-license-exam-modal.tsx | 2 +- .../involved-units/involved-units-table.tsx | 7 ++++- .../leo/incidents/manage-incident-modal.tsx | 6 ++-- .../leo/jail/release-citizen-modal.tsx | 4 +-- .../components/leo/logs/OfficerLogsTable.tsx | 2 +- .../manage-officer/manage-officer-fields.tsx | 2 +- .../leo/modals/CreateWarrantModal.tsx | 2 +- .../CustomFieldSearch/CustomFieldResults.tsx | 6 ++-- .../leo/modals/ManageOfficerModal.tsx | 2 +- .../NameSearchModal/NameSearchModal.tsx | 6 ++-- .../manage-license-points-modal.tsx | 2 +- .../NameSearchModal/tabs/records-tab.tsx | 2 +- .../NameSearchModal/tabs/vehicles-tab.tsx | 2 +- .../NameSearchModal/tabs/warrants-tab.tsx | 2 +- .../leo/modals/VehicleSearchModal.tsx | 4 +-- .../business-search-modal.tsx | 2 +- .../manage-record/penal-codes-table.tsx | 2 +- .../manage-record/select-penal-code.tsx | 2 +- .../modals/manage-record/table-item-form.tsx | 4 +-- .../tabs/connections-tab/connections-tab.tsx | 2 +- .../leo/modals/select-officer-modal.tsx | 9 ++++-- .../leo/modals/weapon-search-modal.tsx | 2 +- .../private-messages-button.tsx | 6 ++-- .../UnitQualificationsTable.tsx | 7 ++++- .../components/leo/records-stats-column.tsx | 2 +- .../src/components/modal/AlertModal.tsx | 4 +-- .../src/components/shared/image-wrapper.tsx | 2 +- .../shared/table/skeleton-loader.tsx | 2 +- .../components/shared/table/table-header.tsx | 2 +- .../src/components/shared/table/table-row.tsx | 2 +- .../src/components/shared/table/table.tsx | 8 +++--- .../shared/utility-panel/statuses-area.tsx | 8 +++--- apps/client/src/context/AuthContext.tsx | 2 +- apps/client/src/hooks/global/use-tones.tsx | 2 +- .../realtime/use-active-incidents-table.ts | 2 +- .../src/hooks/realtime/use-active-warrants.ts | 2 +- .../src/hooks/shared/table/use-async-table.ts | 2 +- .../src/hooks/shared/useUnitsStatusChange.ts | 2 +- apps/client/src/hooks/useFeatureEnabled.ts | 2 +- apps/client/src/hooks/useGenerateCallsign.ts | 1 - apps/client/src/lib/admin/values/values.tsx | 8 +++--- apps/client/src/lib/editor/utils.ts | 2 +- apps/client/src/lib/editor/withChecklists.ts | 2 +- apps/client/src/lib/editor/withShortcuts.ts | 2 +- apps/client/src/lib/fetch.ts | 1 - apps/client/src/lib/fetch/errors.ts | 1 + .../create-map-units-from-active-units.ts.ts | 10 +++---- .../src/lib/table/create-table-dnd-column.tsx | 2 +- apps/client/src/lib/useFetch.tsx | 5 ++-- apps/client/src/lib/utils.ts | 8 +++--- .../does-user-have-required-connections.ts | 2 +- .../src/lib/validation/zod-error-map.ts | 8 +++++- apps/client/src/pages/_error.tsx | 2 +- apps/client/src/pages/account.tsx | 2 +- .../src/pages/admin/import/vehicles.tsx | 2 +- .../client/src/pages/admin/import/weapons.tsx | 2 +- .../pages/admin/values/penal-code/index.tsx | 2 +- .../src/pages/auth/account-password.tsx | 2 +- apps/client/src/pages/auth/register.tsx | 4 +-- apps/client/src/pages/auth/temp-password.tsx | 2 +- apps/client/src/pages/bleeter/@/[handle].tsx | 4 +-- .../business/[id]/[employeeId]/index.tsx | 2 +- .../business/[id]/[employeeId]/manage.tsx | 4 +-- .../src/pages/ems-fd/hospital-services.tsx | 2 +- apps/client/src/pages/officer/index.tsx | 2 +- apps/client/src/pages/officer/jail.tsx | 8 +++++- apps/client/src/pages/officer/my-officers.tsx | 2 +- .../supervisor/citizen-logs/[citizenId].tsx | 2 +- .../src/pages/officer/supervisor/exams.tsx | 2 +- apps/client/src/pages/pets/[id]/index.tsx | 4 +-- apps/client/src/pages/pets/index.tsx | 4 +-- apps/client/src/pages/taxi.tsx | 2 +- apps/client/src/state/mapState.ts | 6 ++-- apps/client/tsconfig.json | 17 ++++++----- packages/types/src/lib/cad-feature.ts | 2 +- packages/ui/src/components/alert/alert.tsx | 2 +- .../ui/src/components/dnd/dnd-provider.tsx | 2 +- packages/ui/src/components/form-row.tsx | 2 +- packages/ui/src/components/infofield.tsx | 2 +- .../utils/src/editor/slate-data-to-string.ts | 2 -- tsconfig.base.json | 7 ++++- 303 files changed, 678 insertions(+), 560 deletions(-) diff --git a/.eslintrc b/.eslintrc index 45bdcc792..d13c83f85 100644 --- a/.eslintrc +++ b/.eslintrc @@ -15,6 +15,7 @@ "ecmaVersion": 2021, "sourceType": "module", "project": "./tsconfig.base.json", + "emitDecoratorMetadata": true, "ecmaFeatures": { "jsx": true } @@ -26,6 +27,10 @@ "@typescript-eslint/no-unnecessary-condition": "error", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", "@typescript-eslint/no-redundant-type-constituents": "off", - "@typescript-eslint/no-unused-vars": "off" + "@typescript-eslint/no-unused-vars": "off", + "@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..3ef507426 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 { MultipartFile, type PlatformMulterFile, Req, Res, UseBefore } from "@tsed/common"; import { 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..00949d3a4 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,16 +4,16 @@ 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"; import { getImageWebPPath } from "lib/images/get-image-webp-path"; import { AuditLogActionType, createAuditLogEntry } from "@snailycad/audit-logger/server"; -import type { User } from "@snailycad/types"; +import { User } from "@snailycad/types"; import { resolve } from "node:path"; import { existsSync } from "node:fs"; import sharp from "sharp"; 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..4eeb18491 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"; @@ -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..3e0dd0332 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"; @@ -33,7 +33,7 @@ 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/2fa-controller.ts b/apps/api/src/controllers/auth/2fa-controller.ts index be566fa99..6d56a0c8f 100644 --- a/apps/api/src/controllers/auth/2fa-controller.ts +++ b/apps/api/src/controllers/auth/2fa-controller.ts @@ -1,4 +1,4 @@ -import type { User } from "@prisma/client"; +import { User } from "@prisma/client"; import process from "node:process"; import { authenticator } from "otplib"; import { BodyParams, Context, UseBeforeEach } from "@tsed/common"; 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..002487327 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, @@ -21,7 +27,7 @@ import { 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"; -import type { User } from "@snailycad/types"; +import { User } from "@snailycad/types"; import { getActiveOfficer } from "~/lib/leo/activeOfficer"; import { getActiveDeputy } from "~/lib/get-active-ems-fd-deputy"; diff --git a/apps/api/src/controllers/bleeter/bleeter-controller.ts b/apps/api/src/controllers/bleeter/bleeter-controller.ts index 1daf7b04d..b72fcaf80 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"; @@ -18,13 +18,13 @@ import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; import { validateSchema } from "lib/data/validate-schema"; import { ExtendedBadRequest } from "src/exceptions/extended-bad-request"; -import type { User } from "@prisma/client"; +import { User } from "@prisma/client"; 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/bleeter/bleeter-profile-controller.ts b/apps/api/src/controllers/bleeter/bleeter-profile-controller.ts index 3c9d7b4be..c5fcfd4d1 100644 --- a/apps/api/src/controllers/bleeter/bleeter-profile-controller.ts +++ b/apps/api/src/controllers/bleeter/bleeter-profile-controller.ts @@ -3,7 +3,7 @@ import { BadRequest, NotFound } from "@tsed/exceptions"; import { ContentType, Description } from "@tsed/schema"; import { prisma } from "lib/data/prisma"; import { IsAuth } from "middlewares/auth/is-auth"; -import type { User } from "@prisma/client"; +import { User } from "@prisma/client"; import type * as APITypes from "@snailycad/types/api"; import { Feature, IsFeatureEnabled } from "middlewares/is-enabled"; import { UsePermissions } from "middlewares/use-permissions"; 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/business/PostsController.ts b/apps/api/src/controllers/business/PostsController.ts index ca1a9cc52..ac5ee89d9 100644 --- a/apps/api/src/controllers/business/PostsController.ts +++ b/apps/api/src/controllers/business/PostsController.ts @@ -8,7 +8,8 @@ import { Forbidden, NotFound } from "@tsed/exceptions"; import { prisma } from "lib/data/prisma"; import { validateBusinessAcceptance } from "utils/businesses"; import { validateSchema } from "lib/data/validate-schema"; -import type { cad, User } from "@prisma/client"; +import { User } from "@prisma/client"; +import type { cad } from "@prisma/client"; import type * as APITypes from "@snailycad/types/api"; import { Feature, IsFeatureEnabled } from "middlewares/is-enabled"; diff --git a/apps/api/src/controllers/calls/taxi-controller.ts b/apps/api/src/controllers/calls/taxi-controller.ts index 7d4386f39..d4d94cd33 100644 --- a/apps/api/src/controllers/calls/taxi-controller.ts +++ b/apps/api/src/controllers/calls/taxi-controller.ts @@ -14,7 +14,7 @@ import { NotFound } from "@tsed/exceptions"; import { IsAuth } from "middlewares/auth/is-auth"; import { 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..25506fec3 100644 --- a/apps/api/src/controllers/calls/tow-controller.ts +++ b/apps/api/src/controllers/calls/tow-controller.ts @@ -15,14 +15,14 @@ import { IsAuth } from "middlewares/auth/is-auth"; import { 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/MedicalRecordController.ts b/apps/api/src/controllers/citizen/MedicalRecordController.ts index cc5889063..24c85529a 100644 --- a/apps/api/src/controllers/citizen/MedicalRecordController.ts +++ b/apps/api/src/controllers/citizen/MedicalRecordController.ts @@ -1,4 +1,5 @@ -import type { cad, Feature, User } from "@prisma/client"; +import { User } from "@prisma/client"; +import type { cad, Feature } from "@prisma/client"; import { MEDICAL_RECORD_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/truck-logs-controller.ts b/apps/api/src/controllers/citizen/truck-logs-controller.ts index 345f1b3a1..403a40d78 100644 --- a/apps/api/src/controllers/citizen/truck-logs-controller.ts +++ b/apps/api/src/controllers/citizen/truck-logs-controller.ts @@ -1,4 +1,4 @@ -import type { User } from "@prisma/client"; +import { User } from "@prisma/client"; import { CREATE_TRUCK_LOG_SCHEMA } from "@snailycad/schemas"; import { Controller } from "@tsed/di"; import { NotFound } from "@tsed/exceptions"; 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/NameChangeRequestController.ts b/apps/api/src/controllers/court/NameChangeRequestController.ts index bfbd09570..564c2f3db 100644 --- a/apps/api/src/controllers/court/NameChangeRequestController.ts +++ b/apps/api/src/controllers/court/NameChangeRequestController.ts @@ -1,4 +1,4 @@ -import type { User } from "@prisma/client"; +import { User } from "@prisma/client"; import { ContentType, Get, Post } from "@tsed/schema"; import { BodyParams, Context, UseBeforeEach } from "@tsed/common"; import { Controller } from "@tsed/di"; 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/calls-911-controller.ts b/apps/api/src/controllers/dispatch/911-calls/calls-911-controller.ts index 84e335228..a037df44d 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,7 +4,7 @@ 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"; @@ -15,12 +15,12 @@ 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..995f94e39 100644 --- a/apps/api/src/controllers/dispatch/bolo-controller.ts +++ b/apps/api/src/controllers/dispatch/bolo-controller.ts @@ -12,12 +12,12 @@ 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..f88ba90b6 100644 --- a/apps/api/src/controllers/dispatch/combined-units-controller.ts +++ b/apps/api/src/controllers/dispatch/combined-units-controller.ts @@ -4,8 +4,8 @@ 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, diff --git a/apps/api/src/controllers/dispatch/dispatch-controller.ts b/apps/api/src/controllers/dispatch/dispatch-controller.ts index 844f12b9f..4199d08af 100644 --- a/apps/api/src/controllers/dispatch/dispatch-controller.ts +++ b/apps/api/src/controllers/dispatch/dispatch-controller.ts @@ -6,7 +6,7 @@ import { prisma } from "lib/data/prisma"; import { 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..e3935d4e9 100644 --- a/apps/api/src/controllers/dispatch/private-messages-controller.ts +++ b/apps/api/src/controllers/dispatch/private-messages-controller.ts @@ -7,7 +7,7 @@ import { 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..8ce157aa3 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"; 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..6d7416347 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 { EmsFdDeputy } from "@snailycad/types"; +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"; 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..f0a6bbba9 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,7 +5,7 @@ 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 { UsePermissions, Permissions } from "middlewares/use-permissions"; 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..4a3e22a14 100644 --- a/apps/api/src/controllers/leo/LeoController.ts +++ b/apps/api/src/controllers/leo/LeoController.ts @@ -8,12 +8,17 @@ import { IsAuth } from "middlewares/auth/is-auth"; import { ActiveOfficer } from "middlewares/active-officer"; import { 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/IncidentController.ts b/apps/api/src/controllers/leo/incidents/IncidentController.ts index 281821295..9353da0a6 100644 --- a/apps/api/src/controllers/leo/incidents/IncidentController.ts +++ b/apps/api/src/controllers/leo/incidents/IncidentController.ts @@ -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..50a69c482 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"; @@ -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..72387f2dd 100644 --- a/apps/api/src/server.ts +++ b/apps/api/src/server.ts @@ -8,12 +8,12 @@ import { Configuration, Inject, PlatformApplication, - PlatformContext, - Request, - Response, - ResponseErrorObject, + 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..d4a8ab70c 100644 --- a/apps/api/src/services/socket-service.ts +++ b/apps/api/src/services/socket-service.ts @@ -2,20 +2,20 @@ import * 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/api/tsconfig.json b/apps/api/tsconfig.json index 17236849d..8d4d8a3d0 100644 --- a/apps/api/tsconfig.json +++ b/apps/api/tsconfig.json @@ -3,21 +3,15 @@ "compilerOptions": { "target": "esnext", "module": "commonjs", - "esModuleInterop": true, "moduleResolution": "node", "importHelpers": true, - "resolveJsonModule": true, + "verbatimModuleSyntax": false, "experimentalDecorators": true, "emitDecoratorMetadata": true, - "declaration": false, "allowSyntheticDefaultImports": true, - "allowJs": true, - "skipLibCheck": true, - "outDir": "dist", - "strict": true, - "lib": ["esnext"], + "baseUrl": ".", "paths": { "~/*": ["./src/*"], diff --git a/apps/client/src/components/account/2fa/manage-2fa-modal.tsx b/apps/client/src/components/account/2fa/manage-2fa-modal.tsx index fe88b9343..576ee331f 100644 --- a/apps/client/src/components/account/2fa/manage-2fa-modal.tsx +++ b/apps/client/src/components/account/2fa/manage-2fa-modal.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { Button, Loader, TextField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "next-intl"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/account/settings/account-settings-tab.tsx b/apps/client/src/components/account/settings/account-settings-tab.tsx index a81c5d17f..ad5057ece 100644 --- a/apps/client/src/components/account/settings/account-settings-tab.tsx +++ b/apps/client/src/components/account/settings/account-settings-tab.tsx @@ -1,5 +1,5 @@ import { useTranslations } from "use-intl"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { CHANGE_USER_SCHEMA } from "@snailycad/schemas"; import { useAuth } from "context/AuthContext"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/components/account/settings/change-password-area.tsx b/apps/client/src/components/account/settings/change-password-area.tsx index 5f12a3b2f..6f39664d4 100644 --- a/apps/client/src/components/account/settings/change-password-area.tsx +++ b/apps/client/src/components/account/settings/change-password-area.tsx @@ -2,7 +2,7 @@ import { CHANGE_PASSWORD_SCHEMA } from "@snailycad/schemas"; import type { PostUserPasswordData } from "@snailycad/types/api"; import { Button, TextField } from "@snailycad/ui"; import { useAuth } from "context/AuthContext"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import toast from "react-hot-toast"; diff --git a/apps/client/src/components/account/user-api-token-tab.tsx b/apps/client/src/components/account/user-api-token-tab.tsx index 7649dc4e8..ef0cf067a 100644 --- a/apps/client/src/components/account/user-api-token-tab.tsx +++ b/apps/client/src/components/account/user-api-token-tab.tsx @@ -1,5 +1,5 @@ import { useAuth } from "context/AuthContext"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "use-intl"; import { Button, Loader, SwitchField, TabsContent, TextField } from "@snailycad/ui"; diff --git a/apps/client/src/components/active-bolos/bolo-filters.tsx b/apps/client/src/components/active-bolos/bolo-filters.tsx index 885d0d71c..ee1aac028 100644 --- a/apps/client/src/components/active-bolos/bolo-filters.tsx +++ b/apps/client/src/components/active-bolos/bolo-filters.tsx @@ -1,5 +1,5 @@ import { Loader, SelectField, TextField } from "@snailycad/ui"; -import { Bolo, BoloType } from "@snailycad/types"; +import { type Bolo, BoloType } from "@snailycad/types"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { useTranslations } from "next-intl"; import { makeUnitName } from "lib/utils"; diff --git a/apps/client/src/components/active-bolos/manage-bolo-modal.tsx b/apps/client/src/components/active-bolos/manage-bolo-modal.tsx index aea158431..1ba397d23 100644 --- a/apps/client/src/components/active-bolos/manage-bolo-modal.tsx +++ b/apps/client/src/components/active-bolos/manage-bolo-modal.tsx @@ -6,7 +6,7 @@ import { Form, Formik } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; -import { Bolo, BoloType, RegisteredVehicle } from "@snailycad/types"; +import { type Bolo, BoloType, type RegisteredVehicle } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { CREATE_BOLO_SCHEMA } from "@snailycad/schemas"; import { useDispatchState } from "state/dispatch/dispatch-state"; 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.tsx b/apps/client/src/components/admin/Sidebar.tsx index e740b37b6..6f98cad24 100644 --- a/apps/client/src/components/admin/Sidebar.tsx +++ b/apps/client/src/components/admin/Sidebar.tsx @@ -5,7 +5,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import { useTranslations } from "use-intl"; import { useViewport } from "@casperiv/useful/hooks/useViewport"; -import { importRoutes, managementRoutes, SidebarRoute, valueRoutes } from "./Sidebar/routes"; +import { importRoutes, managementRoutes, type SidebarRoute, valueRoutes } from "./Sidebar/routes"; import { usePermission } from "hooks/usePermission"; import { defaultPermissions, Permissions } from "@snailycad/permissions"; import { SidebarSection } from "./Sidebar/SidebarSection"; 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/import/ImportModal.tsx b/apps/client/src/components/admin/import/ImportModal.tsx index 2c1162f5c..6271525df 100644 --- a/apps/client/src/components/admin/import/ImportModal.tsx +++ b/apps/client/src/components/admin/import/ImportModal.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { FormField } from "components/form/FormField"; import { Button, Input, Loader } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { useTranslations } from "use-intl"; 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 3ba2a711f..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,7 +1,7 @@ -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, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "use-intl"; import { SettingsFormField } from "components/form/SettingsFormField"; diff --git a/apps/client/src/components/admin/manage/cad-settings/default-permissions-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/default-permissions-tab.tsx index 2e885eee2..3f2f76c71 100644 --- a/apps/client/src/components/admin/manage/cad-settings/default-permissions-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/default-permissions-tab.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useTranslations } from "use-intl"; import { Alert, Button, Loader, SwitchField, TextField } from "@snailycad/ui"; @@ -8,7 +8,7 @@ import type { cad } from "@snailycad/types"; import { toastMessage } from "lib/toastMessage"; import type { PutCADDefaultPermissionsData } from "@snailycad/types/api"; import { usePermissionsModal } from "hooks/use-permissions-modal"; -import { PermissionNames, getPermissions, defaultPermissions } from "@snailycad/permissions"; +import { type PermissionNames, getPermissions, defaultPermissions } from "@snailycad/permissions"; import { TabsContent } from "@radix-ui/react-tabs"; import { SettingsTabs } from "components/admin/cad-settings/layout"; 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 b8cc8b69c..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 @@ -1,5 +1,5 @@ import * as React from "react"; -import { Select, SelectValue } from "components/form/Select"; +import { Select, type SelectValue } from "components/form/Select"; import { Alert, Button, Loader } from "@snailycad/ui"; import { Form, Formik, useFormikContext } from "formik"; import useFetch from "lib/useFetch"; @@ -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/discord-webhooks/discord-webhooks-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/discord-webhooks-tab.tsx index 85f108320..3e05b68b9 100644 --- a/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/discord-webhooks-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/discord-webhooks/discord-webhooks-tab.tsx @@ -4,7 +4,7 @@ import { Form, Formik } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "next-intl"; import { useAuth } from "context/AuthContext"; -import { cad, DiscordWebhookType } from "@snailycad/types"; +import { type cad, DiscordWebhookType } from "@snailycad/types"; import { WebhookSettingsField } from "./WebhookSettingsField"; import { toastMessage } from "lib/toastMessage"; import type { GetCADDiscordWebhooksData, PostCADDiscordWebhooksData } from "@snailycad/types/api"; diff --git a/apps/client/src/components/admin/manage/cad-settings/general/blacklisted-words-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/general/blacklisted-words-tab.tsx index 0b79dd941..263a129b1 100644 --- a/apps/client/src/components/admin/manage/cad-settings/general/blacklisted-words-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/general/blacklisted-words-tab.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { TabsContent } from "@radix-ui/react-tabs"; -import { GetBlacklistedWordsData } from "@snailycad/types/api"; +import type { GetBlacklistedWordsData } from "@snailycad/types/api"; import { Button, FullDate } from "@snailycad/ui"; import { SettingsTabs } from "components/admin/cad-settings/layout"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; @@ -11,7 +11,7 @@ import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { AlertModal } from "components/modal/AlertModal"; import { SearchArea } from "components/shared/search/search-area"; -import { BlacklistedWord } from "@snailycad/types"; +import type { BlacklistedWord } from "@snailycad/types"; import { ImportBlacklistedWordsModal } from "./import-blacklisted-words-modal"; export function BlacklistedWordsTab() { 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 ea9a6a620..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 @@ -4,8 +4,8 @@ import { useTranslations } from "use-intl"; import { useAuth } from "context/AuthContext"; import useFetch from "lib/useFetch"; import { - CadFeature, - CadFeatureOptions, + type CadFeature, + type CadFeatureOptions, CourthouseType, Feature, LicenseExamType, @@ -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/cad-settings/general/general-settings-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/general/general-settings-tab.tsx index 64087ce4a..87848a95a 100644 --- a/apps/client/src/components/admin/manage/cad-settings/general/general-settings-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/general/general-settings-tab.tsx @@ -16,7 +16,7 @@ import { CAD_SETTINGS_SCHEMA } from "@snailycad/schemas"; import { ImageSelectInput, validateFile } from "components/form/inputs/ImageSelectInput"; import { SettingsFormField } from "components/form/SettingsFormField"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; -import { Formik, FormikHelpers } from "formik"; +import { Formik, type FormikHelpers } from "formik"; import { toastMessage } from "lib/toastMessage"; import type { PutCADSettingsData } from "@snailycad/types/api"; import { TabsContent } from "@radix-ui/react-tabs"; diff --git a/apps/client/src/components/admin/manage/cad-settings/general/import-blacklisted-words-modal.tsx b/apps/client/src/components/admin/manage/cad-settings/general/import-blacklisted-words-modal.tsx index 04c33a041..c9f86a87f 100644 --- a/apps/client/src/components/admin/manage/cad-settings/general/import-blacklisted-words-modal.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/general/import-blacklisted-words-modal.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { FormField } from "components/form/FormField"; import { Input, Loader, Button } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/admin/manage/cad-settings/general/whitelist-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/general/whitelist-tab.tsx index 69009f2b0..5f0be9cc8 100644 --- a/apps/client/src/components/admin/manage/cad-settings/general/whitelist-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/general/whitelist-tab.tsx @@ -1,5 +1,5 @@ import { TabsContent } from "@radix-ui/react-tabs"; -import { PutCADSettingsData } from "@snailycad/types/api"; +import type { PutCADSettingsData } from "@snailycad/types/api"; import { Button, Loader, SwitchField } from "@snailycad/ui"; import { SettingsTabs } from "components/admin/cad-settings/layout"; import { SettingsFormField } from "components/form/SettingsFormField"; diff --git a/apps/client/src/components/admin/manage/cad-settings/live-map-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/live-map-tab.tsx index 2d77be5cf..27009cc35 100644 --- a/apps/client/src/components/admin/manage/cad-settings/live-map-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/live-map-tab.tsx @@ -2,7 +2,7 @@ import * as Popover from "@radix-ui/react-popover"; import * as React from "react"; import { Alert, Button, Input, Loader, TextField } from "@snailycad/ui"; import { useAuth } from "context/AuthContext"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "use-intl"; import { SettingsFormField } from "components/form/SettingsFormField"; @@ -11,7 +11,7 @@ import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import Link from "next/link"; import { BoxArrowUpRight, ChevronDown } from "react-bootstrap-icons"; import { Table, useTableState } from "components/shared/Table"; -import { MiscCadSettings, LiveMapURL } from "@snailycad/types"; +import type { MiscCadSettings, LiveMapURL } from "@snailycad/types"; import { TabsContent } from "@radix-ui/react-tabs"; import { SettingsTabs } from "components/admin/cad-settings/layout"; diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/inactivity-timeout-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/inactivity-timeout-tab.tsx index 34ce1ebc0..7aaddc5c9 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/inactivity-timeout-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/inactivity-timeout-tab.tsx @@ -1,6 +1,6 @@ import { TabsContent } from "@radix-ui/react-tabs"; -import { MiscCadSettings } from "@snailycad/types"; -import { PutCADMiscSettingsData } from "@snailycad/types/api"; +import type { MiscCadSettings } from "@snailycad/types"; +import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import { Button, Input, Loader } from "@snailycad/ui"; import { SettingsTabs } from "components/admin/cad-settings/layout"; import { SettingsFormField } from "components/form/SettingsFormField"; diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/license-number-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/license-number-tab.tsx index bb961ebea..c59548459 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/license-number-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/license-number-tab.tsx @@ -1,5 +1,5 @@ import { TabsContent } from "@radix-ui/react-tabs"; -import { PutCADMiscSettingsData } from "@snailycad/types/api"; +import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import { Button, Input, Loader } from "@snailycad/ui"; import { SettingsTabs } from "components/admin/cad-settings/layout"; import { SettingsFormField } from "components/form/SettingsFormField"; @@ -9,7 +9,7 @@ import useFetch from "lib/useFetch"; import { useTranslations } from "use-intl"; import { cleanValues } from "./other-misc-tab"; import { toastMessage } from "lib/toastMessage"; -import { MiscCadSettings } from "@snailycad/types"; +import type { MiscCadSettings } from "@snailycad/types"; export function LicenseNumbersTab() { const t = useTranslations("MiscSettingsTab"); diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/limits-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/limits-tab.tsx index d2c704819..bbe83ea29 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/limits-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/limits-tab.tsx @@ -1,4 +1,4 @@ -import { PutCADMiscSettingsData } from "@snailycad/types/api"; +import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import { Button, Input, Loader } from "@snailycad/ui"; import { SettingsFormField } from "components/form/SettingsFormField"; import { useAuth } from "context/AuthContext"; @@ -9,7 +9,7 @@ import { cleanValues } from "./other-misc-tab"; import { toastMessage } from "lib/toastMessage"; import { TabsContent } from "@radix-ui/react-tabs"; import { SettingsTabs } from "components/admin/cad-settings/layout"; -import { MiscCadSettings } from "@snailycad/types"; +import type { MiscCadSettings } from "@snailycad/types"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; export function LimitsTab() { diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/max-license-points-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/max-license-points-tab.tsx index d1083d227..2a8235253 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/max-license-points-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/max-license-points-tab.tsx @@ -1,10 +1,10 @@ -import { MiscCadSettings } from "@snailycad/types"; +import type { MiscCadSettings } from "@snailycad/types"; import { Button, Input, Loader } from "@snailycad/ui"; import { SettingsFormField } from "components/form/SettingsFormField"; import { toastMessage } from "lib/toastMessage"; import { useTranslations } from "use-intl"; import { cleanValues } from "./other-misc-tab"; -import { PutCADMiscSettingsData } from "@snailycad/types/api"; +import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import useFetch from "lib/useFetch"; import { useAuth } from "context/AuthContext"; import { Form, Formik } from "formik"; diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/other-misc-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/other-misc-tab.tsx index c07688111..8a79cfdf9 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/other-misc-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/other-misc-tab.tsx @@ -5,7 +5,7 @@ import { useTranslations } from "use-intl"; import { Loader, Input, Button } from "@snailycad/ui"; import { useAuth } from "context/AuthContext"; import useFetch from "lib/useFetch"; -import { JailTimeScale, MiscCadSettings } from "@snailycad/types"; +import { JailTimeScale, type MiscCadSettings } from "@snailycad/types"; import { SettingsFormField } from "components/form/SettingsFormField"; import { Select } from "components/form/Select"; import { toastMessage } from "lib/toastMessage"; diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx index 46cccf5fc..d8b249d94 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx @@ -1,4 +1,4 @@ -import { PutCADMiscSettingsData } from "@snailycad/types/api"; +import type { PutCADMiscSettingsData } from "@snailycad/types/api"; import { Button, Input, Loader } from "@snailycad/ui"; import { SettingsFormField } from "components/form/SettingsFormField"; import { useAuth } from "context/AuthContext"; @@ -9,7 +9,7 @@ import { cleanValues } from "./other-misc-tab"; import { toastMessage } from "lib/toastMessage"; import { TabsContent } from "@radix-ui/react-tabs"; import { SettingsTabs } from "components/admin/cad-settings/layout"; -import { MiscCadSettings } from "@snailycad/types"; +import type { MiscCadSettings } from "@snailycad/types"; export const CALLSIGN_TEMPLATE_VARIABLES = ( diff --git a/apps/client/src/components/admin/manage/citizens/all-citizens-tab.tsx b/apps/client/src/components/admin/manage/citizens/all-citizens-tab.tsx index c5dddd745..a54705e95 100644 --- a/apps/client/src/components/admin/manage/citizens/all-citizens-tab.tsx +++ b/apps/client/src/components/admin/manage/citizens/all-citizens-tab.tsx @@ -19,7 +19,7 @@ import { useAsyncTable } from "hooks/shared/table/use-async-table"; import type { DeleteManageCitizenByIdData, GetManageCitizensData } from "@snailycad/types/api"; import { useTemporaryItem } from "hooks/shared/useTemporaryItem"; import dynamic from "next/dynamic"; -import { User } from "@snailycad/types"; +import type { User } from "@snailycad/types"; const AlertModal = dynamic(async () => (await import("components/modal/AlertModal")).AlertModal, { ssr: false, diff --git a/apps/client/src/components/admin/manage/courthouse/pending-warrants-tab.tsx b/apps/client/src/components/admin/manage/courthouse/pending-warrants-tab.tsx index 332268ea0..7158c28cf 100644 --- a/apps/client/src/components/admin/manage/courthouse/pending-warrants-tab.tsx +++ b/apps/client/src/components/admin/manage/courthouse/pending-warrants-tab.tsx @@ -1,4 +1,4 @@ -import { Warrant, WhitelistStatus } from "@snailycad/types"; +import { type Warrant, WhitelistStatus } from "@snailycad/types"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; import { useTranslations } from "next-intl"; import { Button, FullDate, TabsContent } from "@snailycad/ui"; diff --git a/apps/client/src/components/admin/manage/custom-fields/ManageCustomFieldModal.tsx b/apps/client/src/components/admin/manage/custom-fields/ManageCustomFieldModal.tsx index c3f53cb9e..38e1b8344 100644 --- a/apps/client/src/components/admin/manage/custom-fields/ManageCustomFieldModal.tsx +++ b/apps/client/src/components/admin/manage/custom-fields/ManageCustomFieldModal.tsx @@ -1,10 +1,10 @@ import { Loader, Button, TextField, SelectField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; -import { CustomField, CustomFieldCategory } from "@snailycad/types"; +import { type CustomField, CustomFieldCategory } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { ModalIds } from "types/modal-ids"; import { CUSTOM_FIELDS_SCHEMA } from "@snailycad/schemas"; diff --git a/apps/client/src/components/admin/manage/custom-roles/manage-custom-roles-modal.tsx b/apps/client/src/components/admin/manage/custom-roles/manage-custom-roles-modal.tsx index f8e311c37..e594aad7f 100644 --- a/apps/client/src/components/admin/manage/custom-roles/manage-custom-roles-modal.tsx +++ b/apps/client/src/components/admin/manage/custom-roles/manage-custom-roles-modal.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { Button, Loader, SelectField, TextField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/components/admin/manage/units/QualificationsTable.tsx b/apps/client/src/components/admin/manage/units/QualificationsTable.tsx index 4f5ae3eea..3cf5584e9 100644 --- a/apps/client/src/components/admin/manage/units/QualificationsTable.tsx +++ b/apps/client/src/components/admin/manage/units/QualificationsTable.tsx @@ -1,5 +1,5 @@ -import type * as React from "react"; -import { QualificationValueType, UnitQualification } from "@snailycad/types"; +import * as React from "react"; +import { QualificationValueType, type UnitQualification } from "@snailycad/types"; import { Button, FullDate } from "@snailycad/ui"; import { AlertModal } from "components/modal/AlertModal"; import { Table, useTableState } from "components/shared/Table"; @@ -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/manage/units/tabs/manage-unit-tab/manage-unit-tab.tsx b/apps/client/src/components/admin/manage/units/tabs/manage-unit-tab/manage-unit-tab.tsx index 90630a5cd..0f8a77866 100644 --- a/apps/client/src/components/admin/manage/units/tabs/manage-unit-tab/manage-unit-tab.tsx +++ b/apps/client/src/components/admin/manage/units/tabs/manage-unit-tab/manage-unit-tab.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { getUnitDepartment } from "lib/utils"; import { useTranslations } from "use-intl"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useValues } from "context/ValuesContext"; import { Loader, diff --git a/apps/client/src/components/admin/manage/users/modals/manage-permissions-modal.tsx b/apps/client/src/components/admin/manage/users/modals/manage-permissions-modal.tsx index 812095a05..a9280308c 100644 --- a/apps/client/src/components/admin/manage/users/modals/manage-permissions-modal.tsx +++ b/apps/client/src/components/admin/manage/users/modals/manage-permissions-modal.tsx @@ -3,7 +3,7 @@ import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; import { useTranslations } from "next-intl"; import { ModalIds } from "types/modal-ids"; -import { getPermissions, PermissionNames, Permissions } from "@snailycad/permissions"; +import { getPermissions, type PermissionNames, Permissions } from "@snailycad/permissions"; import { Form, Formik } from "formik"; import useFetch from "lib/useFetch"; import { Loader, Button, TextField, SwitchField } from "@snailycad/ui"; diff --git a/apps/client/src/components/admin/values/ManageValueModal.tsx b/apps/client/src/components/admin/values/ManageValueModal.tsx index b3f30b3c8..7d1964924 100644 --- a/apps/client/src/components/admin/values/ManageValueModal.tsx +++ b/apps/client/src/components/admin/values/ManageValueModal.tsx @@ -10,16 +10,16 @@ import { } from "@snailycad/schemas"; import { Loader, Button, SelectField, TextField, SwitchField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { useValues } from "context/ValuesContext"; import { - AnyValue, + type AnyValue, DriversLicenseCategoryType, EmployeeAsEnum, - Feature, + type Feature, QualificationValueType, ValueType, } from "@snailycad/types"; diff --git a/apps/client/src/components/admin/values/import/import-values-modal.tsx b/apps/client/src/components/admin/values/import/import-values-modal.tsx index 9aae052de..32f0db03d 100644 --- a/apps/client/src/components/admin/values/import/import-values-modal.tsx +++ b/apps/client/src/components/admin/values/import/import-values-modal.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { FormField } from "components/form/FormField"; import { Input, Loader, Button } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/admin/values/manage-modal/address-fields.tsx b/apps/client/src/components/admin/values/manage-modal/address-fields.tsx index 20559df1f..cb348335a 100644 --- a/apps/client/src/components/admin/values/manage-modal/address-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/address-fields.tsx @@ -1,7 +1,7 @@ import { TextField } from "@snailycad/ui"; import { useFormikContext } from "formik"; import { useTranslations } from "use-intl"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function AddressFields() { const { values, errors, setFieldValue } = useFormikContext(); diff --git a/apps/client/src/components/admin/values/manage-modal/department-fields.tsx b/apps/client/src/components/admin/values/manage-modal/department-fields.tsx index 539847302..48ca7ec43 100644 --- a/apps/client/src/components/admin/values/manage-modal/department-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/department-fields.tsx @@ -6,7 +6,7 @@ import { useTranslations } from "use-intl"; import { ValueSelectField } from "components/form/inputs/value-select-field"; import { CALLSIGN_TEMPLATE_VARIABLES } from "components/admin/manage/cad-settings/misc-features/template-tab"; import { DepartmentLinksSection } from "./department-links-section"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export const DEPARTMENT_LABELS = { [DepartmentType.LEO]: "LEO", diff --git a/apps/client/src/components/admin/values/manage-modal/department-links-section.tsx b/apps/client/src/components/admin/values/manage-modal/department-links-section.tsx index ff37694b9..e0befdbdc 100644 --- a/apps/client/src/components/admin/values/manage-modal/department-links-section.tsx +++ b/apps/client/src/components/admin/values/manage-modal/department-links-section.tsx @@ -3,10 +3,10 @@ import * as Popover from "@radix-ui/react-popover"; import * as React from "react"; import { useTranslations } from "use-intl"; import { useFormikContext } from "formik"; -import { DepartmentValueLink } from "@snailycad/types"; +import type { DepartmentValueLink } from "@snailycad/types"; import { Table, useTableState } from "components/shared/Table"; import { v4 } from "uuid"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function DepartmentLinksSection() { const [openPopover, setOpenPopover] = React.useState<"new" | null>(null); diff --git a/apps/client/src/components/admin/values/manage-modal/division-fields.tsx b/apps/client/src/components/admin/values/manage-modal/division-fields.tsx index 8fc9f2a6d..da188f514 100644 --- a/apps/client/src/components/admin/values/manage-modal/division-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/division-fields.tsx @@ -4,7 +4,7 @@ import { useFormikContext } from "formik"; import { useTranslations } from "use-intl"; import { ValueSelectField } from "components/form/inputs/value-select-field"; import { ValueType } from "@snailycad/types"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function DivisionFields() { const { values, errors, setFieldValue } = useFormikContext(); diff --git a/apps/client/src/components/admin/values/manage-modal/emergency-vehicle-fields.tsx b/apps/client/src/components/admin/values/manage-modal/emergency-vehicle-fields.tsx index d4aef922f..6aed7fe2c 100644 --- a/apps/client/src/components/admin/values/manage-modal/emergency-vehicle-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/emergency-vehicle-fields.tsx @@ -5,7 +5,7 @@ import { useValues } from "context/ValuesContext"; import { useFormikContext } from "formik"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; import { useTranslations } from "use-intl"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function useDefaultDivisions() { const { division } = useValues(); diff --git a/apps/client/src/components/admin/values/manage-modal/license-fields.tsx b/apps/client/src/components/admin/values/manage-modal/license-fields.tsx index fe4d28e45..e5357562c 100644 --- a/apps/client/src/components/admin/values/manage-modal/license-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/license-fields.tsx @@ -2,7 +2,7 @@ import { ValueLicenseType } from "@snailycad/types"; import { SelectField, SwitchField } from "@snailycad/ui"; import { useFormikContext } from "formik"; import { useTranslations } from "use-intl"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function useLicenseLabels() { const t = useTranslations("Values"); diff --git a/apps/client/src/components/admin/values/manage-modal/qualification-fields.tsx b/apps/client/src/components/admin/values/manage-modal/qualification-fields.tsx index 7b35ccc31..5dbd7e075 100644 --- a/apps/client/src/components/admin/values/manage-modal/qualification-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/qualification-fields.tsx @@ -4,7 +4,7 @@ import { useValues } from "context/ValuesContext"; import { SelectField, TextField } from "@snailycad/ui"; import { QualificationValueType } from "@snailycad/types"; import { useTranslations } from "use-intl"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function QualificationFields({ image, setImage }: any) { const { values, errors, setFieldValue } = useFormikContext(); diff --git a/apps/client/src/components/admin/values/manage-modal/status-value-fields.tsx b/apps/client/src/components/admin/values/manage-modal/status-value-fields.tsx index a8c5c3763..36feec449 100644 --- a/apps/client/src/components/admin/values/manage-modal/status-value-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/status-value-fields.tsx @@ -1,14 +1,14 @@ import { FormField } from "components/form/FormField"; import { useFormikContext } from "formik"; import dynamic from "next/dynamic"; -import { AnyValue, ShouldDoType, StatusValueType, WhatPages } from "@snailycad/types"; +import { type AnyValue, ShouldDoType, StatusValueType, WhatPages } from "@snailycad/types"; import { Eyedropper } from "react-bootstrap-icons"; import { Input, Button, SelectField, RadioGroupField, Radio } from "@snailycad/ui"; import { useValues } from "context/ValuesContext"; import { useTranslations } from "use-intl"; import { isOfficerRankValue } from "@snailycad/utils"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; import { generateContrastColor } from "lib/table/get-contrasting-text-color"; const HexColorPicker = dynamic(async () => (await import("react-colorful")).HexColorPicker); diff --git a/apps/client/src/components/admin/values/manage-modal/vehicle-fields.tsx b/apps/client/src/components/admin/values/manage-modal/vehicle-fields.tsx index ef982b6a8..264cbbfd6 100644 --- a/apps/client/src/components/admin/values/manage-modal/vehicle-fields.tsx +++ b/apps/client/src/components/admin/values/manage-modal/vehicle-fields.tsx @@ -3,7 +3,7 @@ import { ImageSelectInput } from "components/form/inputs/ImageSelectInput"; import { useValues } from "context/ValuesContext"; import { SelectField } from "@snailycad/ui"; import { useTranslations } from "use-intl"; -import { ManageValueFormValues } from "../ManageValueModal"; +import type { ManageValueFormValues } from "../ManageValueModal"; export function VehicleFields({ image, setImage }: any) { const { values, errors, setFieldValue } = useFormikContext(); 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 af370678b..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 { 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/auth/api-verification.tsx b/apps/client/src/components/auth/api-verification.tsx index 7d4f07826..af300a671 100644 --- a/apps/client/src/components/auth/api-verification.tsx +++ b/apps/client/src/components/auth/api-verification.tsx @@ -1,4 +1,4 @@ -import { GetCADSettingsData } from "@snailycad/types/api"; +import type { GetCADSettingsData } from "@snailycad/types/api"; import { Alert } from "@snailycad/ui"; import { useQuery } from "@tanstack/react-query"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/components/auth/login/login-form.tsx b/apps/client/src/components/auth/login/login-form.tsx index 4078c5111..ca363c957 100644 --- a/apps/client/src/components/auth/login/login-form.tsx +++ b/apps/client/src/components/auth/login/login-form.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import Link from "next/link"; import { Discord, Steam } from "react-bootstrap-icons"; import { Alert, Button, Loader, TextField } from "@snailycad/ui"; diff --git a/apps/client/src/components/bleeter/list/posts-list.tsx b/apps/client/src/components/bleeter/list/posts-list.tsx index 3de46cd56..abd92173b 100644 --- a/apps/client/src/components/bleeter/list/posts-list.tsx +++ b/apps/client/src/components/bleeter/list/posts-list.tsx @@ -1,4 +1,4 @@ -import { BleeterPost, BleeterProfile } from "@snailycad/types"; +import type { BleeterPost, BleeterProfile } from "@snailycad/types"; import { FullDate } from "@snailycad/ui"; import { Editor } from "components/editor/editor"; import { ImageWrapper } from "components/shared/image-wrapper"; diff --git a/apps/client/src/components/bleeter/manage-bleet-modal.tsx b/apps/client/src/components/bleeter/manage-bleet-modal.tsx index 3deb9fc9c..e9a771b43 100644 --- a/apps/client/src/components/bleeter/manage-bleet-modal.tsx +++ b/apps/client/src/components/bleeter/manage-bleet-modal.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useTranslations } from "use-intl"; import { Loader, Input, Button, TextField } from "@snailycad/ui"; @@ -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/bleeter/modals/edit-profile-modal.tsx b/apps/client/src/components/bleeter/modals/edit-profile-modal.tsx index 5d4c2d252..e931b5dad 100644 --- a/apps/client/src/components/bleeter/modals/edit-profile-modal.tsx +++ b/apps/client/src/components/bleeter/modals/edit-profile-modal.tsx @@ -3,7 +3,7 @@ import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; import { NewBleeterExperienceForm } from "../new-bleeter-experience"; -import { BleeterProfile } from "@snailycad/types"; +import type { BleeterProfile } from "@snailycad/types"; interface EditBleeterProfileModalProps { profile: BleeterProfile; diff --git a/apps/client/src/components/bleeter/modals/followers-following-modal.tsx b/apps/client/src/components/bleeter/modals/followers-following-modal.tsx index 2bc16f597..37e9930e9 100644 --- a/apps/client/src/components/bleeter/modals/followers-following-modal.tsx +++ b/apps/client/src/components/bleeter/modals/followers-following-modal.tsx @@ -1,4 +1,4 @@ -import { +import type { GetBleeterProfileFollowersData, GetBleeterProfileFollowingData, } from "@snailycad/types/api"; diff --git a/apps/client/src/components/bleeter/new-bleeter-experience.tsx b/apps/client/src/components/bleeter/new-bleeter-experience.tsx index 275b7ba15..a3aa49b38 100644 --- a/apps/client/src/components/bleeter/new-bleeter-experience.tsx +++ b/apps/client/src/components/bleeter/new-bleeter-experience.tsx @@ -1,8 +1,8 @@ -import { BleeterProfile } from "@snailycad/types"; +import type { BleeterProfile } from "@snailycad/types"; import { Button, Loader, TextField, FormRow } from "@snailycad/ui"; import { Layout } from "components/Layout"; import { Title } from "components/shared/Title"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useRouter } from "next/router"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/components/business/join-business-modal.tsx b/apps/client/src/components/business/join-business-modal.tsx index 5fd8e5534..9929d5f0c 100644 --- a/apps/client/src/components/business/join-business-modal.tsx +++ b/apps/client/src/components/business/join-business-modal.tsx @@ -1,7 +1,7 @@ import { Loader, Button, SelectField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/business/manage/tabs/employees-tab/employees-tab.tsx b/apps/client/src/components/business/manage/tabs/employees-tab/employees-tab.tsx index 93a75d1e0..cc1f7145a 100644 --- a/apps/client/src/components/business/manage/tabs/employees-tab/employees-tab.tsx +++ b/apps/client/src/components/business/manage/tabs/employees-tab/employees-tab.tsx @@ -1,10 +1,10 @@ import { useTranslations } from "use-intl"; import { Button, Status, TabsContent } from "@snailycad/ui"; -import { FullEmployee, useBusinessState } from "state/business-state"; +import { type FullEmployee, useBusinessState } from "state/business-state"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { ManageEmployeeModal } from "./manage-employee-modal"; -import { Employee, EmployeeAsEnum, WhitelistStatus } from "@snailycad/types"; +import { type Employee, EmployeeAsEnum, WhitelistStatus } from "@snailycad/types"; import { AlertModal } from "components/modal/AlertModal"; import useFetch from "lib/useFetch"; import { Table, useTableState } from "components/shared/Table"; diff --git a/apps/client/src/components/business/manage/tabs/employees-tab/manage-employee-modal.tsx b/apps/client/src/components/business/manage/tabs/employees-tab/manage-employee-modal.tsx index e2846da44..03b1bc5b9 100644 --- a/apps/client/src/components/business/manage/tabs/employees-tab/manage-employee-modal.tsx +++ b/apps/client/src/components/business/manage/tabs/employees-tab/manage-employee-modal.tsx @@ -1,7 +1,7 @@ import { Loader, Button, SwitchField, FormRow, SelectField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useBusinessState } from "state/business-state"; import { ModalIds } from "types/modal-ids"; @@ -9,7 +9,7 @@ import { useTranslations } from "use-intl"; import { UPDATE_EMPLOYEE_SCHEMA } from "@snailycad/schemas"; import { handleValidate } from "lib/handleValidate"; import { useValues } from "context/ValuesContext"; -import { Employee, EmployeeAsEnum } from "@snailycad/types"; +import { type Employee, EmployeeAsEnum } from "@snailycad/types"; import type { PutBusinessEmployeesData } from "@snailycad/types/api"; interface Props { diff --git a/apps/client/src/components/business/manage/tabs/pending-employees-tab.tsx b/apps/client/src/components/business/manage/tabs/pending-employees-tab.tsx index dd481db50..962f50684 100644 --- a/apps/client/src/components/business/manage/tabs/pending-employees-tab.tsx +++ b/apps/client/src/components/business/manage/tabs/pending-employees-tab.tsx @@ -1,7 +1,7 @@ import { useTranslations } from "use-intl"; import { Button, TabsContent } from "@snailycad/ui"; import { useBusinessState } from "state/business-state"; -import { Employee, WhitelistStatus } from "@snailycad/types"; +import { type Employee, WhitelistStatus } from "@snailycad/types"; import useFetch from "lib/useFetch"; import { Table, useTableState } from "components/shared/Table"; import type { PutBusinessEmployeesData } from "@snailycad/types/api"; diff --git a/apps/client/src/components/business/manage/tabs/roles-tab/manage-business-role-modal.tsx b/apps/client/src/components/business/manage/tabs/roles-tab/manage-business-role-modal.tsx index dfbb1bb73..75bb7fbb0 100644 --- a/apps/client/src/components/business/manage/tabs/roles-tab/manage-business-role-modal.tsx +++ b/apps/client/src/components/business/manage/tabs/roles-tab/manage-business-role-modal.tsx @@ -1,10 +1,10 @@ import { Loader, Button, SelectField, TextField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; -import { EmployeeAsEnum, EmployeeValue } from "@snailycad/types"; +import { EmployeeAsEnum, type EmployeeValue } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { ModalIds } from "types/modal-ids"; import { getValueStrFromValue } from "lib/admin/values/utils"; diff --git a/apps/client/src/components/citizen/ManageCitizenForm.tsx b/apps/client/src/components/citizen/ManageCitizenForm.tsx index 13a2996a8..1b33e3817 100644 --- a/apps/client/src/components/citizen/ManageCitizenForm.tsx +++ b/apps/client/src/components/citizen/ManageCitizenForm.tsx @@ -18,7 +18,7 @@ import { useAuth } from "context/AuthContext"; import { useValues } from "context/ValuesContext"; import { handleValidate } from "lib/handleValidate"; import type { FormikHelpers } from "formik"; -import { User, Citizen, PenalCode, ValueType } from "@snailycad/types"; +import { type User, type Citizen, type PenalCode, ValueType } from "@snailycad/types"; import { useTranslations } from "next-intl"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; import { diff --git a/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx b/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx index 80d1a5c46..b7b1873f5 100644 --- a/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx +++ b/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx @@ -1,4 +1,9 @@ -import { Citizen, DriversLicenseCategoryType, ValueLicenseType, ValueType } from "@snailycad/types"; +import { + type Citizen, + DriversLicenseCategoryType, + ValueLicenseType, + ValueType, +} from "@snailycad/types"; import { useValues } from "context/ValuesContext"; import { useFormikContext } from "formik"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; diff --git a/apps/client/src/components/citizen/licenses/licenses-card.tsx b/apps/client/src/components/citizen/licenses/licenses-card.tsx index a3a6aa38f..24b5e60e8 100644 --- a/apps/client/src/components/citizen/licenses/licenses-card.tsx +++ b/apps/client/src/components/citizen/licenses/licenses-card.tsx @@ -2,10 +2,14 @@ import { useTranslations } from "use-intl"; import { Button, FullDate, Infofield } from "@snailycad/ui"; import { ModalIds } from "types/modal-ids"; import { useModal } from "state/modalState"; -import { LicenseInitialValues, ManageLicensesModal } from "./manage-licenses-modal"; -import { CitizenWithVehAndWep, useCitizen } from "context/CitizenContext"; +import { type LicenseInitialValues, ManageLicensesModal } from "./manage-licenses-modal"; +import { type CitizenWithVehAndWep, useCitizen } from "context/CitizenContext"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; -import { Citizen, DriversLicenseCategoryType, SuspendedCitizenLicenses } from "@snailycad/types"; +import { + type Citizen, + DriversLicenseCategoryType, + type SuspendedCitizenLicenses, +} from "@snailycad/types"; import useFetch from "lib/useFetch"; import type { PutCitizenLicensesByIdData } from "@snailycad/types/api"; diff --git a/apps/client/src/components/citizen/manage-citizen-form/create-previous-records-step.tsx b/apps/client/src/components/citizen/manage-citizen-form/create-previous-records-step.tsx index 81725d314..2804a49a5 100644 --- a/apps/client/src/components/citizen/manage-citizen-form/create-previous-records-step.tsx +++ b/apps/client/src/components/citizen/manage-citizen-form/create-previous-records-step.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Record, RecordType, ValueType } from "@snailycad/types"; +import { type Record, RecordType, ValueType } from "@snailycad/types"; import { ManageRecordModal } from "components/leo/modals/manage-record/manage-record-modal"; import { useLoadValuesClientSide } from "hooks/useLoadValuesClientSide"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/citizen/medical-records/manage-medical-records-modal.tsx b/apps/client/src/components/citizen/medical-records/manage-medical-records-modal.tsx index a58b74ec8..785f8fe8f 100644 --- a/apps/client/src/components/citizen/medical-records/manage-medical-records-modal.tsx +++ b/apps/client/src/components/citizen/medical-records/manage-medical-records-modal.tsx @@ -5,7 +5,7 @@ import { Modal } from "components/modal/Modal"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; -import { BaseCitizen, MedicalRecord, ValueType } from "@snailycad/types"; +import { type BaseCitizen, type MedicalRecord, ValueType } from "@snailycad/types"; import { handleValidate } from "lib/handleValidate"; import { useValues } from "context/ValuesContext"; import type { diff --git a/apps/client/src/components/citizen/pets/manage-pet-modal.tsx b/apps/client/src/components/citizen/pets/manage-pet-modal.tsx index 6cf6cc8fc..057394535 100644 --- a/apps/client/src/components/citizen/pets/manage-pet-modal.tsx +++ b/apps/client/src/components/citizen/pets/manage-pet-modal.tsx @@ -1,13 +1,13 @@ import * as React from "react"; import { PET_SCHEMA } from "@snailycad/schemas"; -import { Pet } from "@snailycad/types"; -import { PostPetsData } from "@snailycad/types/api"; +import type { Pet } from "@snailycad/types"; +import type { PostPetsData } from "@snailycad/types/api"; import { Button, DatePickerField, Loader, TextField, FormRow } from "@snailycad/ui"; import { ImageSelectInput, validateFile } from "components/form/inputs/ImageSelectInput"; import { Modal } from "components/modal/Modal"; import { CitizenSuggestionsField } from "components/shared/CitizenSuggestionsField"; import { useAuth } from "context/AuthContext"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useRouter } from "next/router"; diff --git a/apps/client/src/components/citizen/pets/medical-records/manage-pet-medical-record-modal.tsx b/apps/client/src/components/citizen/pets/medical-records/manage-pet-medical-record-modal.tsx index 83a9aae6b..4af399f1d 100644 --- a/apps/client/src/components/citizen/pets/medical-records/manage-pet-medical-record-modal.tsx +++ b/apps/client/src/components/citizen/pets/medical-records/manage-pet-medical-record-modal.tsx @@ -5,7 +5,7 @@ import { Modal } from "components/modal/Modal"; import useFetch from "lib/useFetch"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; -import { PetMedicalRecord } from "@snailycad/types"; +import type { PetMedicalRecord } from "@snailycad/types"; import { handleValidate } from "lib/handleValidate"; import type { PutPetByIdMedicalRecordsData, diff --git a/apps/client/src/components/citizen/pets/medical-records/pet-medical-records-card.tsx b/apps/client/src/components/citizen/pets/medical-records/pet-medical-records-card.tsx index 7ecdc27e8..a8a326c96 100644 --- a/apps/client/src/components/citizen/pets/medical-records/pet-medical-records-card.tsx +++ b/apps/client/src/components/citizen/pets/medical-records/pet-medical-records-card.tsx @@ -6,7 +6,7 @@ import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; import { ManagePetMedicalRecordModal } from "./manage-pet-medical-record-modal"; import { useTemporaryItem } from "hooks/shared/useTemporaryItem"; -import { PetMedicalRecord } from "@snailycad/types"; +import type { PetMedicalRecord } from "@snailycad/types"; import { AlertModal } from "components/modal/AlertModal"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/components/citizen/pets/notes/pet-notes-card.tsx b/apps/client/src/components/citizen/pets/notes/pet-notes-card.tsx index bd8aa97d7..c72193f4d 100644 --- a/apps/client/src/components/citizen/pets/notes/pet-notes-card.tsx +++ b/apps/client/src/components/citizen/pets/notes/pet-notes-card.tsx @@ -1,4 +1,4 @@ -import { Note } from "@snailycad/types"; +import type { Note } from "@snailycad/types"; import { Button, FullDate } from "@snailycad/ui"; import { Table, useTableState } from "components/shared/Table"; import { useTemporaryItem } from "hooks/shared/useTemporaryItem"; diff --git a/apps/client/src/components/citizen/records/citizen-records-card.tsx b/apps/client/src/components/citizen/records/citizen-records-card.tsx index 5f1f127af..91452729a 100644 --- a/apps/client/src/components/citizen/records/citizen-records-card.tsx +++ b/apps/client/src/components/citizen/records/citizen-records-card.tsx @@ -1,4 +1,4 @@ -import { GetCitizenByIdRecordsData } from "@snailycad/types/api"; +import type { GetCitizenByIdRecordsData } from "@snailycad/types/api"; import { useQuery } from "@tanstack/react-query"; import { RecordsTab } from "components/leo/modals/NameSearchModal/tabs/records-tab"; import { TableSkeletonLoader } from "components/shared/table/skeleton-loader"; diff --git a/apps/client/src/components/citizen/tow/assign-to-tow-taxi-call.tsx b/apps/client/src/components/citizen/tow/assign-to-tow-taxi-call.tsx index af232c198..63b015d55 100644 --- a/apps/client/src/components/citizen/tow/assign-to-tow-taxi-call.tsx +++ b/apps/client/src/components/citizen/tow/assign-to-tow-taxi-call.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useTranslations } from "use-intl"; import { Loader, Button } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; diff --git a/apps/client/src/components/citizen/vehicles/modals/register-vehicle-modal.tsx b/apps/client/src/components/citizen/vehicles/modals/register-vehicle-modal.tsx index 9cd221488..c4cba9272 100644 --- a/apps/client/src/components/citizen/vehicles/modals/register-vehicle-modal.tsx +++ b/apps/client/src/components/citizen/vehicles/modals/register-vehicle-modal.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useTranslations } from "use-intl"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { LEO_VEHICLE_SCHEMA, VEHICLE_SCHEMA } from "@snailycad/schemas"; import { Item, @@ -18,10 +18,10 @@ import { useValues } from "src/context/ValuesContext"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { - RegisteredVehicle, + type RegisteredVehicle, ValueLicenseType, ValueType, - VehicleValue, + type VehicleValue, WhitelistStatus, } from "@snailycad/types"; import { handleValidate } from "lib/handleValidate"; diff --git a/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx b/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx index f503e8747..0a6bd0bde 100644 --- a/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx +++ b/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx @@ -1,5 +1,5 @@ import { useTranslations } from "use-intl"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useRouter } from "next/router"; import { WEAPON_SCHEMA } from "@snailycad/schemas"; import { FormField } from "components/form/FormField"; @@ -12,8 +12,8 @@ import { ModalIds } from "types/modal-ids"; import { ValueLicenseType, ValueType, - Weapon, - WeaponValue, + type Weapon, + type WeaponValue, WhitelistStatus, } from "@snailycad/types"; import { handleValidate } from "lib/handleValidate"; diff --git a/apps/client/src/components/courthouse/court-entries/manage-court-entry-modal.tsx b/apps/client/src/components/courthouse/court-entries/manage-court-entry-modal.tsx index 018ab7dd7..124ae479f 100644 --- a/apps/client/src/components/courthouse/court-entries/manage-court-entry-modal.tsx +++ b/apps/client/src/components/courthouse/court-entries/manage-court-entry-modal.tsx @@ -4,7 +4,7 @@ import { Loader, Button, TextField } from "@snailycad/ui"; import { FormField } from "components/form/FormField"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useTranslations } from "next-intl"; diff --git a/apps/client/src/components/courthouse/courthouse-posts/manage-courthouse-post-modal.tsx b/apps/client/src/components/courthouse/courthouse-posts/manage-courthouse-post-modal.tsx index 5b4a80f7a..3cf198b30 100644 --- a/apps/client/src/components/courthouse/courthouse-posts/manage-courthouse-post-modal.tsx +++ b/apps/client/src/components/courthouse/courthouse-posts/manage-courthouse-post-modal.tsx @@ -4,7 +4,7 @@ import { Loader, Button, TextField } from "@snailycad/ui"; import { FormField } from "components/form/FormField"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useTranslations } from "next-intl"; diff --git a/apps/client/src/components/courthouse/name-change/request-name-change-modal.tsx b/apps/client/src/components/courthouse/name-change/request-name-change-modal.tsx index acf6a5bd0..198438bc3 100644 --- a/apps/client/src/components/courthouse/name-change/request-name-change-modal.tsx +++ b/apps/client/src/components/courthouse/name-change/request-name-change-modal.tsx @@ -2,7 +2,7 @@ import { NAME_CHANGE_REQUEST_SCHEMA } from "@snailycad/schemas"; import { Loader, Button, FormRow, TextField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useTranslations } from "next-intl"; diff --git a/apps/client/src/components/dispatch/active-calls/active-calls.tsx b/apps/client/src/components/dispatch/active-calls/active-calls.tsx index 593de5bff..ec21be67a 100644 --- a/apps/client/src/components/dispatch/active-calls/active-calls.tsx +++ b/apps/client/src/components/dispatch/active-calls/active-calls.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { useRouter } from "next/router"; -import { Full911Call, useDispatchState } from "state/dispatch/dispatch-state"; -import { AssignedUnit, WhitelistStatus } from "@snailycad/types"; +import { type Full911Call, useDispatchState } from "state/dispatch/dispatch-state"; +import { type AssignedUnit, WhitelistStatus } from "@snailycad/types"; import { useTranslations } from "use-intl"; import useFetch from "lib/useFetch"; import { useLeoState } from "state/leo-state"; diff --git a/apps/client/src/components/dispatch/active-calls/call-filters.tsx b/apps/client/src/components/dispatch/active-calls/call-filters.tsx index e8ac69dc1..8cc8b02d2 100644 --- a/apps/client/src/components/dispatch/active-calls/call-filters.tsx +++ b/apps/client/src/components/dispatch/active-calls/call-filters.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import type { Full911Call } from "state/dispatch/dispatch-state"; import { makeUnitName } from "lib/utils"; import { useTranslations } from "next-intl"; -import { Loader, SelectField, SelectValue, TextField } from "@snailycad/ui"; +import { Loader, SelectField, type SelectValue, TextField } from "@snailycad/ui"; import { useCallsFilters } from "state/callsFiltersState"; import type { useAsyncTable } from "components/shared/Table"; import { useValues } from "context/ValuesContext"; diff --git a/apps/client/src/components/dispatch/active-calls/columns/assigned-units-column.tsx b/apps/client/src/components/dispatch/active-calls/columns/assigned-units-column.tsx index b987eb979..a2a9fc5e9 100644 --- a/apps/client/src/components/dispatch/active-calls/columns/assigned-units-column.tsx +++ b/apps/client/src/components/dispatch/active-calls/columns/assigned-units-column.tsx @@ -6,7 +6,7 @@ import { useActiveDispatchers } from "hooks/realtime/use-active-dispatchers"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { makeUnitName } from "lib/utils"; import { useTranslations } from "next-intl"; -import { Full911Call, useDispatchState } from "state/dispatch/dispatch-state"; +import { type Full911Call, useDispatchState } from "state/dispatch/dispatch-state"; import { DndActions } from "types/dnd-actions"; import { classNames } from "lib/classNames"; diff --git a/apps/client/src/components/dispatch/active-calls/modals/assigned-units-table.tsx b/apps/client/src/components/dispatch/active-calls/modals/assigned-units-table.tsx index 57258102c..5029b8a99 100644 --- a/apps/client/src/components/dispatch/active-calls/modals/assigned-units-table.tsx +++ b/apps/client/src/components/dispatch/active-calls/modals/assigned-units-table.tsx @@ -7,7 +7,7 @@ import useFetch from "lib/useFetch"; import { useCall911State } from "state/dispatch/call-911-state"; import type { Post911CallAssignUnAssign, PUT911CallAssignedUnit } from "@snailycad/types/api"; import { useAuth } from "context/AuthContext"; -import { AssignedUnit, StatusViewMode } from "@snailycad/types"; +import { type AssignedUnit, StatusViewMode } from "@snailycad/types"; import { useTranslations } from "next-intl"; import { Button, FullDate, Loader, SelectField } from "@snailycad/ui"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/components/dispatch/active-calls/modals/manage-911-call-modal.tsx b/apps/client/src/components/dispatch/active-calls/modals/manage-911-call-modal.tsx index 8209f208b..7881c577e 100644 --- a/apps/client/src/components/dispatch/active-calls/modals/manage-911-call-modal.tsx +++ b/apps/client/src/components/dispatch/active-calls/modals/manage-911-call-modal.tsx @@ -11,8 +11,8 @@ import { CallEventsArea } from "../../events/EventsArea"; import { usePermission } from "hooks/usePermission"; import { defaultPermissions } from "@snailycad/permissions"; -import { ActiveOfficer, useLeoState } from "state/leo-state"; -import { ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; +import { type ActiveOfficer, useLeoState } from "state/leo-state"; +import { type ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; import type { Delete911CallByIdData } from "@snailycad/types/api"; import { useCall911State } from "state/dispatch/call-911-state"; import { Manage911CallForm } from "./manage-911-call-form"; diff --git a/apps/client/src/components/dispatch/active-incidents/columns/actions-column.tsx b/apps/client/src/components/dispatch/active-incidents/columns/actions-column.tsx index efd0a41ce..8f2d02fe4 100644 --- a/apps/client/src/components/dispatch/active-incidents/columns/actions-column.tsx +++ b/apps/client/src/components/dispatch/active-incidents/columns/actions-column.tsx @@ -6,7 +6,7 @@ import { useRouter } from "next/router"; import { defaultPermissions } from "@snailycad/permissions"; import type { ActiveOfficer } from "state/leo-state"; import type { ActiveDeputy } from "state/ems-fd-state"; -import { LeoIncident, ShouldDoType } from "@snailycad/types"; +import { type LeoIncident, ShouldDoType } from "@snailycad/types"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "next-intl"; diff --git a/apps/client/src/components/dispatch/active-units/deputies/active-deputies.tsx b/apps/client/src/components/dispatch/active-units/deputies/active-deputies.tsx index e07bbac23..5fd86d8d0 100644 --- a/apps/client/src/components/dispatch/active-units/deputies/active-deputies.tsx +++ b/apps/client/src/components/dispatch/active-units/deputies/active-deputies.tsx @@ -4,12 +4,12 @@ import { Button } from "@snailycad/ui"; import { ManageUnitModal } from "../modals/manage-unit-modal"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; -import { ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; +import { type ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; import { useActiveDeputies } from "hooks/realtime/useActiveDeputies"; import { useRouter } from "next/router"; import { formatUnitDivisions, makeUnitName } from "lib/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; -import { CombinedEmsFdUnit, EmsFdDeputy, StatusViewMode } from "@snailycad/types"; +import { type CombinedEmsFdUnit, type EmsFdDeputy, StatusViewMode } from "@snailycad/types"; import { useAuth } from "context/AuthContext"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; @@ -26,7 +26,7 @@ import { useMounted } from "@casperiv/useful"; import { generateContrastColor } from "lib/table/get-contrasting-text-color"; import { isUnitCombinedEmsFd } from "@snailycad/utils"; import { MergeUnitModal } from "../modals/merge-unit-modal"; -import { GetEmsFdActiveDeputies } from "@snailycad/types/api"; +import type { GetEmsFdActiveDeputies } from "@snailycad/types/api"; import { ActiveDeputiesHeader } from "./active-deputies-header"; interface Props { diff --git a/apps/client/src/components/dispatch/active-units/deputies/deputy-column.tsx b/apps/client/src/components/dispatch/active-units/deputies/deputy-column.tsx index 25e542653..7f4fedd84 100644 --- a/apps/client/src/components/dispatch/active-units/deputies/deputy-column.tsx +++ b/apps/client/src/components/dispatch/active-units/deputies/deputy-column.tsx @@ -17,7 +17,7 @@ import type { CombinedEmsFdUnit, EmsFdDeputy } from "@snailycad/types"; import { useDispatchState } from "state/dispatch/dispatch-state"; import { isUnitCombinedEmsFd } from "@snailycad/utils"; import { useRouter } from "next/router"; -import { ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; +import { type ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/dispatch/active-units/modals/manage-unit-modal.tsx b/apps/client/src/components/dispatch/active-units/modals/manage-unit-modal.tsx index 035df03d8..eab2ba3f5 100644 --- a/apps/client/src/components/dispatch/active-units/modals/manage-unit-modal.tsx +++ b/apps/client/src/components/dispatch/active-units/modals/manage-unit-modal.tsx @@ -10,7 +10,12 @@ import { useValues } from "context/ValuesContext"; import { useDispatchState } from "state/dispatch/dispatch-state"; import type { ActiveDeputy } from "state/ems-fd-state"; import { makeUnitName } from "lib/utils"; -import { CombinedLeoUnit, StatusValueType, StatusValue, ValueType } from "@snailycad/types"; +import { + type CombinedLeoUnit, + StatusValueType, + type StatusValue, + ValueType, +} from "@snailycad/types"; import { classNames } from "lib/classNames"; import { useUnitStatusChange } from "hooks/shared/useUnitsStatusChange"; import { isUnitCombined } from "@snailycad/utils"; diff --git a/apps/client/src/components/dispatch/active-units/officers/active-officers.tsx b/apps/client/src/components/dispatch/active-units/officers/active-officers.tsx index 07a1c0078..9763cfa1c 100644 --- a/apps/client/src/components/dispatch/active-units/officers/active-officers.tsx +++ b/apps/client/src/components/dispatch/active-units/officers/active-officers.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { useTranslations } from "use-intl"; import { Button, HoverCard, HoverCardContent, HoverCardTrigger } from "@snailycad/ui"; -import { ActiveOfficer, useLeoState } from "state/leo-state"; +import { type ActiveOfficer, useLeoState } from "state/leo-state"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useActiveOfficers } from "hooks/realtime/useActiveOfficers"; @@ -9,7 +9,7 @@ import { useRouter } from "next/router"; import { formatUnitDivisions, makeUnitName } from "lib/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { useAuth } from "context/AuthContext"; -import { CombinedLeoUnit, StatusViewMode, Officer } from "@snailycad/types"; +import { type CombinedLeoUnit, StatusViewMode, type Officer } from "@snailycad/types"; import { useActiveDispatchers } from "hooks/realtime/use-active-dispatchers"; import { useTableState, Table, useAsyncTable } from "components/shared/Table"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; @@ -27,7 +27,7 @@ import dynamic from "next/dynamic"; import { Permissions } from "@snailycad/permissions"; import { usePermission } from "hooks/usePermission"; import { PrivateMessagesModal } from "../private-messages/private-messages-modal"; -import { GetActiveOfficersData } from "@snailycad/types/api"; +import type { GetActiveOfficersData } from "@snailycad/types/api"; import { ActiveOfficersHeader } from "./active-officers-header"; import { classNames } from "lib/classNames"; diff --git a/apps/client/src/components/dispatch/active-units/officers/columns/active-call-column.tsx b/apps/client/src/components/dispatch/active-units/officers/columns/active-call-column.tsx index 756632628..542f966a7 100644 --- a/apps/client/src/components/dispatch/active-units/officers/columns/active-call-column.tsx +++ b/apps/client/src/components/dispatch/active-units/officers/columns/active-call-column.tsx @@ -6,7 +6,7 @@ import { useCall911State } from "state/dispatch/call-911-state"; import dynamic from "next/dynamic"; import { useQuery } from "@tanstack/react-query"; import useFetch from "lib/useFetch"; -import { Get911CallByIdData } from "@snailycad/types/api"; +import type { Get911CallByIdData } from "@snailycad/types/api"; import { classNames } from "lib/classNames"; const Manage911CallModal = dynamic( diff --git a/apps/client/src/components/dispatch/active-units/officers/columns/active-incident-column.tsx b/apps/client/src/components/dispatch/active-units/officers/columns/active-incident-column.tsx index 1c7b7d5b4..d5a128aa6 100644 --- a/apps/client/src/components/dispatch/active-units/officers/columns/active-incident-column.tsx +++ b/apps/client/src/components/dispatch/active-units/officers/columns/active-incident-column.tsx @@ -8,7 +8,7 @@ import { useActiveDispatchers } from "hooks/realtime/use-active-dispatchers"; import dynamic from "next/dynamic"; import { useQuery } from "@tanstack/react-query"; import useFetch from "lib/useFetch"; -import { GetIncidentByIdData } from "@snailycad/types/api"; +import type { GetIncidentByIdData } from "@snailycad/types/api"; import { classNames } from "lib/classNames"; const ManageIncidentModal = dynamic( diff --git a/apps/client/src/components/dispatch/active-units/officers/columns/officer-column.tsx b/apps/client/src/components/dispatch/active-units/officers/columns/officer-column.tsx index 4f415b438..2bfcde3d9 100644 --- a/apps/client/src/components/dispatch/active-units/officers/columns/officer-column.tsx +++ b/apps/client/src/components/dispatch/active-units/officers/columns/officer-column.tsx @@ -6,7 +6,7 @@ import useFetch from "lib/useFetch"; import { useUnitStatusChange } from "hooks/shared/useUnitsStatusChange"; import { isUnitCombined, isUnitOfficer } from "@snailycad/utils"; import { useActiveOfficers } from "hooks/realtime/useActiveOfficers"; -import { ActiveOfficer, useLeoState } from "state/leo-state"; +import { type ActiveOfficer, useLeoState } from "state/leo-state"; import { ArrowRight } from "react-bootstrap-icons"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/dispatch/active-units/private-messages/message-item.tsx b/apps/client/src/components/dispatch/active-units/private-messages/message-item.tsx index 7917ca119..c3506d537 100644 --- a/apps/client/src/components/dispatch/active-units/private-messages/message-item.tsx +++ b/apps/client/src/components/dispatch/active-units/private-messages/message-item.tsx @@ -1,10 +1,10 @@ -import { DispatchChat } from "@snailycad/types"; +import type { DispatchChat } from "@snailycad/types"; import { Button, FullDate } from "@snailycad/ui"; import { isUnitOfficer } from "@snailycad/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { classNames } from "lib/classNames"; import { makeUnitName } from "lib/utils"; -import { Full911Call, useCall911State } from "state/dispatch/call-911-state"; +import { type Full911Call, useCall911State } from "state/dispatch/call-911-state"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/dispatch/active-units/private-messages/private-messages-modal.tsx b/apps/client/src/components/dispatch/active-units/private-messages/private-messages-modal.tsx index 3e744285f..8768c4169 100644 --- a/apps/client/src/components/dispatch/active-units/private-messages/private-messages-modal.tsx +++ b/apps/client/src/components/dispatch/active-units/private-messages/private-messages-modal.tsx @@ -5,13 +5,13 @@ import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; import { MessageItem } from "./message-item"; import { SendMessageForm } from "./send-message-form/send-message-form"; -import { DispatchChat } from "@snailycad/types"; +import type { DispatchChat } from "@snailycad/types"; import { useQuery } from "@tanstack/react-query"; import useFetch from "lib/useFetch"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { isUnitOfficer } from "@snailycad/utils"; -import { ActiveOfficer } from "state/leo-state"; -import { ActiveDeputy } from "state/ems-fd-state"; +import type { ActiveOfficer } from "state/leo-state"; +import type { ActiveDeputy } from "state/ems-fd-state"; import { makeUnitName } from "lib/utils"; import { SocketEvents } from "@snailycad/config"; import { useListener } from "@casperiv/use-socket.io"; 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 0becb2406..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 @@ -4,7 +4,7 @@ import { Button, SelectField } from "@snailycad/ui"; import { useTranslations } from "use-intl"; import { useFormikContext } from "formik"; import { useCall911State } from "state/dispatch/call-911-state"; -import { Call911 } from "@snailycad/types"; +import type { Call911 } from "@snailycad/types"; import { ChevronDown } from "react-bootstrap-icons"; export function AddCallPopover() { @@ -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 b3f57a31f..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 @@ -3,7 +3,7 @@ import * as Popover from "@radix-ui/react-popover"; import { Button, SelectField } from "@snailycad/ui"; import { useTranslations } from "use-intl"; import { useFormikContext } from "formik"; -import { LeoIncident } from "@snailycad/types"; +import type { LeoIncident } from "@snailycad/types"; import { ChevronDown } from "react-bootstrap-icons"; import { useActiveIncidents } from "hooks/realtime/useActiveIncidents"; @@ -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/active-units/private-messages/send-message-form/send-message-form.tsx b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/send-message-form.tsx index a2e2b4308..f30644a96 100644 --- a/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/send-message-form.tsx +++ b/apps/client/src/components/dispatch/active-units/private-messages/send-message-form/send-message-form.tsx @@ -1,7 +1,7 @@ import * as React from "react"; -import { Call911, DispatchChat, LeoIncident } from "@snailycad/types"; +import type { Call911, DispatchChat, LeoIncident } from "@snailycad/types"; import { Button, Loader, TextField } from "@snailycad/ui"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { useTranslations } from "use-intl"; import { AddCallPopover } from "./add-call-popover"; diff --git a/apps/client/src/components/dispatch/events/UpdateEventForm.tsx b/apps/client/src/components/dispatch/events/UpdateEventForm.tsx index c5eeee8c2..27e96cc69 100644 --- a/apps/client/src/components/dispatch/events/UpdateEventForm.tsx +++ b/apps/client/src/components/dispatch/events/UpdateEventForm.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Form, Formik, FormikHelpers, useFormikContext } from "formik"; +import { Form, Formik, type FormikHelpers, useFormikContext } from "formik"; import { Button, Loader, TextField } from "@snailycad/ui"; import type { Call911Event, IncidentEvent } from "@snailycad/types"; import { useTranslations } from "next-intl"; 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/calls/render-active-map-calls.tsx b/apps/client/src/components/dispatch/map/calls/render-active-map-calls.tsx index e617f2b17..d28803d3c 100644 --- a/apps/client/src/components/dispatch/map/calls/render-active-map-calls.tsx +++ b/apps/client/src/components/dispatch/map/calls/render-active-map-calls.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { icon as leafletIcon, LeafletEvent } from "leaflet"; +import { icon as leafletIcon, type LeafletEvent } from "leaflet"; import useFetch from "lib/useFetch"; import { Marker, Popup, Tooltip, useMap } from "react-leaflet"; import type { Full911Call } from "state/dispatch/dispatch-state"; diff --git a/apps/client/src/components/dispatch/map/modals/select-map-server-modal.tsx b/apps/client/src/components/dispatch/map/modals/select-map-server-modal.tsx index 723686b3f..6e6eb834d 100644 --- a/apps/client/src/components/dispatch/map/modals/select-map-server-modal.tsx +++ b/apps/client/src/components/dispatch/map/modals/select-map-server-modal.tsx @@ -3,9 +3,9 @@ import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; -import { Alert, Button, SelectField, SelectValue } from "@snailycad/ui"; +import { Alert, Button, SelectField, type SelectValue } from "@snailycad/ui"; import { useAuth } from "context/AuthContext"; -import { MiscCadSettings } from "@snailycad/types"; +import type { MiscCadSettings } from "@snailycad/types"; import { useDispatchMapState, useSocketStore } from "state/mapState"; import { toastMessage } from "lib/toastMessage"; import { io } from "socket.io-client"; diff --git a/apps/client/src/components/dispatch/map/render-map-blips.tsx b/apps/client/src/components/dispatch/map/render-map-blips.tsx index 51ae9205f..909b088d3 100644 --- a/apps/client/src/components/dispatch/map/render-map-blips.tsx +++ b/apps/client/src/components/dispatch/map/render-map-blips.tsx @@ -3,7 +3,7 @@ import { icon as leafletIcon } from "leaflet"; import { Marker, Tooltip, useMap } from "react-leaflet"; import { convertToMap } from "lib/map/utils"; import { blipTypes } from "lib/map/blips"; -import { BLIP_SIZES, Blip, BlipsData, MarkerType } from "types/map"; +import { BLIP_SIZES, type Blip, type BlipsData, type MarkerType } from "types/map"; import { MapItem, useDispatchMapState } from "state/mapState"; export function RenderMapBlips() { diff --git a/apps/client/src/components/dispatch/map/smart-signs/use-smart-signs.tsx b/apps/client/src/components/dispatch/map/smart-signs/use-smart-signs.tsx index d71f098b3..ac57ea78f 100644 --- a/apps/client/src/components/dispatch/map/smart-signs/use-smart-signs.tsx +++ b/apps/client/src/components/dispatch/map/smart-signs/use-smart-signs.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useDispatchMapState, useSocketStore } from "state/mapState"; -import { SmartSignMarker } from "types/map"; +import type { SmartSignMarker } from "types/map"; export function useSmartSigns() { const socket = useSocketStore((state) => state.socket); diff --git a/apps/client/src/components/dispatch/map/units/active-map-units.tsx b/apps/client/src/components/dispatch/map/units/active-map-units.tsx index 4517d9799..369e54fd0 100644 --- a/apps/client/src/components/dispatch/map/units/active-map-units.tsx +++ b/apps/client/src/components/dispatch/map/units/active-map-units.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { CombinedEmsFdUnit, CombinedLeoUnit, EmsFdDeputy, Officer } from "@snailycad/types"; +import type { CombinedEmsFdUnit, CombinedLeoUnit, EmsFdDeputy, Officer } from "@snailycad/types"; import { useActiveDeputies } from "hooks/realtime/useActiveDeputies"; import { useActiveOfficers } from "hooks/realtime/useActiveOfficers"; import type { MapPlayer, PlayerDataEventPayload } from "types/map"; 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/dispatch/modals/tones-modal.tsx b/apps/client/src/components/dispatch/modals/tones-modal.tsx index 4af4931d9..cb7dc704c 100644 --- a/apps/client/src/components/dispatch/modals/tones-modal.tsx +++ b/apps/client/src/components/dispatch/modals/tones-modal.tsx @@ -1,7 +1,7 @@ import { Loader, Button, TextField, SwitchField, FormRow } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; @@ -12,7 +12,7 @@ import type { DeleteDispatchTonesData, PostDispatchTonesData } from "@snailycad/ import { useGetActiveTone } from "hooks/global/use-tones"; import { Table, useTableState } from "components/shared/Table"; import { CallDescription } from "../active-calls/CallDescription"; -import { ActiveTone, ActiveToneType } from "@snailycad/types"; +import { type ActiveTone, ActiveToneType } from "@snailycad/types"; import { useQueryClient } from "@tanstack/react-query"; interface Props { diff --git a/apps/client/src/components/editor/editor.tsx b/apps/client/src/components/editor/editor.tsx index 273b3307e..fb092575a 100644 --- a/apps/client/src/components/editor/editor.tsx +++ b/apps/client/src/components/editor/editor.tsx @@ -1,11 +1,16 @@ -import { SlateEditor, SlateElements, Text, slateDataToString } from "@snailycad/utils/editor"; +import { + type SlateEditor, + type SlateElements, + type Text, + slateDataToString, +} from "@snailycad/utils/editor"; import * as React from "react"; -import { Editor as _Editor, Node as SlateNode, Descendant, createEditor } from "slate"; +import { Editor as _Editor, Node as SlateNode, type Descendant, createEditor } from "slate"; import { Editable, ReactEditor, - RenderElementProps, - RenderLeafProps, + type RenderElementProps, + type RenderLeafProps, Slate, withReact, } from "slate-react"; diff --git a/apps/client/src/components/editor/elements/checklist-item.tsx b/apps/client/src/components/editor/elements/checklist-item.tsx index bcb67cc83..bbf6eb7f3 100644 --- a/apps/client/src/components/editor/elements/checklist-item.tsx +++ b/apps/client/src/components/editor/elements/checklist-item.tsx @@ -1,7 +1,7 @@ import { classNames } from "lib/classNames"; import { Transforms } from "slate"; import { ReactEditor, useReadOnly, useSlateStatic, type RenderElementProps } from "slate-react"; -import { CheckListItemElement as ICheckListItemElement } from "@snailycad/utils/editor"; +import type { CheckListItemElement as ICheckListItemElement } from "@snailycad/utils/editor"; import { CheckboxField } from "@snailycad/ui"; type Props = RenderElementProps & { element: ICheckListItemElement }; diff --git a/apps/client/src/components/editor/toolbar.tsx b/apps/client/src/components/editor/toolbar.tsx index eaf922fc4..d04ca5b6c 100644 --- a/apps/client/src/components/editor/toolbar.tsx +++ b/apps/client/src/components/editor/toolbar.tsx @@ -17,7 +17,7 @@ import { Button } from "@snailycad/ui"; import { classNames } from "lib/classNames"; import { isBlockActive, toggleMark, toggleBlock, isMarkActive } from "lib/editor/utils"; import { SelectColorPopover } from "./toolbar/select-color-popover"; -import { SlateElements, Text } from "@snailycad/utils/editor"; +import type { SlateElements, Text } from "@snailycad/utils/editor"; /** * mostly example code from: https://github.com/ianstormtaylor/slate/blob/main/site/examples/richtext.tsx diff --git a/apps/client/src/components/ems-fd/ModalButtons.tsx b/apps/client/src/components/ems-fd/ModalButtons.tsx index 5026eae3e..5df616dea 100644 --- a/apps/client/src/components/ems-fd/ModalButtons.tsx +++ b/apps/client/src/components/ems-fd/ModalButtons.tsx @@ -3,7 +3,7 @@ import { ModalIds } from "types/modal-ids"; import { ActiveToneType, ShouldDoType } from "@snailycad/types"; import { useModal } from "state/modalState"; import { useTranslations } from "use-intl"; -import { ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; +import { type ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { makeUnitName } from "lib/utils"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/components/ems-fd/modals/deputy/manage-deputy-modal.tsx b/apps/client/src/components/ems-fd/modals/deputy/manage-deputy-modal.tsx index 1f2ca5015..17b12ec21 100644 --- a/apps/client/src/components/ems-fd/modals/deputy/manage-deputy-modal.tsx +++ b/apps/client/src/components/ems-fd/modals/deputy/manage-deputy-modal.tsx @@ -6,7 +6,7 @@ import { Select } from "components/form/Select"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; import { useValues } from "context/ValuesContext"; -import { Formik, FormikHelpers } from "formik"; +import { Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/ems-fd/modals/deputy/select-deputy-modal.tsx b/apps/client/src/components/ems-fd/modals/deputy/select-deputy-modal.tsx index 23772d27a..8820eb623 100644 --- a/apps/client/src/components/ems-fd/modals/deputy/select-deputy-modal.tsx +++ b/apps/client/src/components/ems-fd/modals/deputy/select-deputy-modal.tsx @@ -4,14 +4,14 @@ import { FormField } from "components/form/FormField"; import { Select } from "components/form/Select"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; import { useEmsFdState } from "state/ems-fd-state"; import { useValues } from "context/ValuesContext"; -import { EmsFdDeputy, ShouldDoType, WhatPages } from "@snailycad/types"; +import { type EmsFdDeputy, ShouldDoType, WhatPages } from "@snailycad/types"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { isUnitDisabled, makeUnitName } from "lib/utils"; import type { PutDispatchStatusByUnitId } from "@snailycad/types/api"; diff --git a/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/doctor-visits-tab.tsx b/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/doctor-visits-tab.tsx index fc06a14bd..0200aa8cf 100644 --- a/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/doctor-visits-tab.tsx +++ b/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/doctor-visits-tab.tsx @@ -1,4 +1,4 @@ -import { PostEmsFdMedicalRecordsSearchData } from "@snailycad/types/api"; +import type { PostEmsFdMedicalRecordsSearchData } from "@snailycad/types/api"; import { Button, FullDate, TabsContent } from "@snailycad/ui"; import { CallDescription } from "components/dispatch/active-calls/CallDescription"; import { Table, useTableState } from "components/shared/Table"; diff --git a/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/medical-records-tab.tsx b/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/medical-records-tab.tsx index 35f78df48..7760ac1a0 100644 --- a/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/medical-records-tab.tsx +++ b/apps/client/src/components/ems-fd/modals/search-medical-records/tabs/medical-records-tab.tsx @@ -1,5 +1,5 @@ -import { MedicalRecord, Value } from "@snailycad/types"; -import { +import type { MedicalRecord, Value } from "@snailycad/types"; +import type { DeleteCitizenMedicalRecordsData, PostEmsFdMedicalRecordsSearchData, } from "@snailycad/types/api"; diff --git a/apps/client/src/components/form/Select.tsx b/apps/client/src/components/form/Select.tsx index b081e69c0..8ab73f195 100644 --- a/apps/client/src/components/form/Select.tsx +++ b/apps/client/src/components/form/Select.tsx @@ -1,9 +1,9 @@ import { useTranslations } from "use-intl"; import ReactSelect, { - Props as SelectProps, - GroupBase, - StylesConfig, - ActionMeta, + type Props as SelectProps, + type GroupBase, + type StylesConfig, + type ActionMeta, } from "react-select"; import { useAuth } from "context/AuthContext"; import { useModal } from "state/modalState"; @@ -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/form/inputs/ImageSelectInput.tsx b/apps/client/src/components/form/inputs/ImageSelectInput.tsx index 5ab77fff3..188fb1cba 100644 --- a/apps/client/src/components/form/inputs/ImageSelectInput.tsx +++ b/apps/client/src/components/form/inputs/ImageSelectInput.tsx @@ -1,12 +1,12 @@ import * as React from "react"; import { Input, Button } from "@snailycad/ui"; -import { FormikHelpers, useFormikContext } from "formik"; +import { type FormikHelpers, useFormikContext } from "formik"; import { useTranslations } from "next-intl"; import { FormField } from "../FormField"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { CropImageModal } from "components/modal/CropImageModal"; -import { AllowedFileExtension, allowedFileExtensions, IMAGES_REGEX } from "@snailycad/config"; +import { type AllowedFileExtension, allowedFileExtensions, IMAGES_REGEX } from "@snailycad/config"; import Link from "next/link"; import { BoxArrowUpRight } from "react-bootstrap-icons"; import { useDebounce } from "react-use"; diff --git a/apps/client/src/components/form/inputs/value-select-field.tsx b/apps/client/src/components/form/inputs/value-select-field.tsx index b28635b59..9e2d3ca26 100644 --- a/apps/client/src/components/form/inputs/value-select-field.tsx +++ b/apps/client/src/components/form/inputs/value-select-field.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { AnyValue, ValueType } from "@snailycad/types"; +import { type AnyValue, ValueType } from "@snailycad/types"; import { useFormikContext } from "formik"; import { useLoadValuesClientSide } from "hooks/useLoadValuesClientSide"; import { AsyncListSearchField, Item } from "@snailycad/ui"; diff --git a/apps/client/src/components/form/select/MultiValueContainerPenalCode.tsx b/apps/client/src/components/form/select/MultiValueContainerPenalCode.tsx index 17afdfda8..034020687 100644 --- a/apps/client/src/components/form/select/MultiValueContainerPenalCode.tsx +++ b/apps/client/src/components/form/select/MultiValueContainerPenalCode.tsx @@ -1,4 +1,4 @@ -import { components, MultiValueGenericProps } from "react-select"; +import { components, type MultiValueGenericProps } from "react-select"; import type { PenalCode } from "@snailycad/types"; import { dataToSlate, Editor } from "components/editor/editor"; import { HoverCard, HoverCardContent, HoverCardTrigger } from "@snailycad/ui"; diff --git a/apps/client/src/components/form/select/PostalSelect.tsx b/apps/client/src/components/form/select/PostalSelect.tsx index 2bd7bd627..29ec50814 100644 --- a/apps/client/src/components/form/select/PostalSelect.tsx +++ b/apps/client/src/components/form/select/PostalSelect.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { AddressValue, ValueType } from "@snailycad/types"; +import { type AddressValue, ValueType } from "@snailycad/types"; import { useValues } from "context/ValuesContext"; import { useFormikContext } from "formik"; import { useLoadValuesClientSide } from "hooks/useLoadValuesClientSide"; diff --git a/apps/client/src/components/leo/ModalButtons.tsx b/apps/client/src/components/leo/ModalButtons.tsx index b8591890c..99edc6d11 100644 --- a/apps/client/src/components/leo/ModalButtons.tsx +++ b/apps/client/src/components/leo/ModalButtons.tsx @@ -1,5 +1,5 @@ import { Button } from "@snailycad/ui"; -import { ActiveOfficer, useLeoState } from "state/leo-state"; +import { type ActiveOfficer, useLeoState } from "state/leo-state"; import { ActiveToneType, ShouldDoType } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; diff --git a/apps/client/src/components/leo/UnitDepartmentStatus.tsx b/apps/client/src/components/leo/UnitDepartmentStatus.tsx index ac87c12fc..127b3f5ca 100644 --- a/apps/client/src/components/leo/UnitDepartmentStatus.tsx +++ b/apps/client/src/components/leo/UnitDepartmentStatus.tsx @@ -1,4 +1,4 @@ -import { EmsFdDeputy, Officer, WhitelistStatus } from "@snailycad/types"; +import { type EmsFdDeputy, type Officer, WhitelistStatus } from "@snailycad/types"; import { Button, HoverCard, HoverCardContent, HoverCardTrigger, Status } from "@snailycad/ui"; import { useTranslations } from "next-intl"; import { Info } from "react-bootstrap-icons"; diff --git a/apps/client/src/components/leo/active-warrants/active-warrants.tsx b/apps/client/src/components/leo/active-warrants/active-warrants.tsx index a542969c2..b0769e85c 100644 --- a/apps/client/src/components/leo/active-warrants/active-warrants.tsx +++ b/apps/client/src/components/leo/active-warrants/active-warrants.tsx @@ -12,7 +12,7 @@ import { isUnitCombined } from "@snailycad/utils"; import { CallDescription } from "components/dispatch/active-calls/CallDescription"; import { Permissions, usePermission } from "hooks/usePermission"; import dynamic from "next/dynamic"; -import { GetActiveWarrantsData } from "@snailycad/types/api"; +import type { GetActiveWarrantsData } from "@snailycad/types/api"; const CreateWarrantModal = dynamic( async () => (await import("../modals/CreateWarrantModal")).CreateWarrantModal, diff --git a/apps/client/src/components/leo/call-history/link-call-to-citizen-modal.tsx b/apps/client/src/components/leo/call-history/link-call-to-citizen-modal.tsx index 97181471c..181510985 100644 --- a/apps/client/src/components/leo/call-history/link-call-to-citizen-modal.tsx +++ b/apps/client/src/components/leo/call-history/link-call-to-citizen-modal.tsx @@ -1,7 +1,7 @@ import { LINK_INCIDENT_TO_CALL_SCHEMA } from "@snailycad/schemas"; import { Loader, Button } from "@snailycad/ui"; import { FormField } from "components/form/FormField"; -import { Select, SelectValue } from "components/form/Select"; +import { Select, type SelectValue } from "components/form/Select"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; import { Form, Formik } from "formik"; diff --git a/apps/client/src/components/leo/citizen-logs/arrest-reports-tab.tsx b/apps/client/src/components/leo/citizen-logs/arrest-reports-tab.tsx index a587dfa90..06223fa80 100644 --- a/apps/client/src/components/leo/citizen-logs/arrest-reports-tab.tsx +++ b/apps/client/src/components/leo/citizen-logs/arrest-reports-tab.tsx @@ -9,7 +9,7 @@ import { Status, TabsContent, } from "@snailycad/ui"; -import { Record, RecordType } from "@snailycad/types"; +import { type Record, RecordType } from "@snailycad/types"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { makeUnitName } from "lib/utils"; diff --git a/apps/client/src/components/leo/exams/manage-license-exam-modal.tsx b/apps/client/src/components/leo/exams/manage-license-exam-modal.tsx index 1d2faee51..631ee467c 100644 --- a/apps/client/src/components/leo/exams/manage-license-exam-modal.tsx +++ b/apps/client/src/components/leo/exams/manage-license-exam-modal.tsx @@ -1,6 +1,6 @@ import { LICENSE_EXAM_SCHEMA } from "@snailycad/schemas"; import { - LicenseExam, + type LicenseExam, LicenseExamPassType, DriversLicenseCategoryType, ValueLicenseType, diff --git a/apps/client/src/components/leo/incidents/involved-units/involved-units-table.tsx b/apps/client/src/components/leo/incidents/involved-units/involved-units-table.tsx index ccdd7faaa..315df4754 100644 --- a/apps/client/src/components/leo/incidents/involved-units/involved-units-table.tsx +++ b/apps/client/src/components/leo/incidents/involved-units/involved-units-table.tsx @@ -4,7 +4,12 @@ import { makeUnitName } from "lib/utils"; import useFetch from "lib/useFetch"; import type { PutIncidentByIdData } from "@snailycad/types/api"; import { useAuth } from "context/AuthContext"; -import { EmsFdIncident, IncidentInvolvedUnit, LeoIncident, StatusViewMode } from "@snailycad/types"; +import { + type EmsFdIncident, + type IncidentInvolvedUnit, + type LeoIncident, + StatusViewMode, +} from "@snailycad/types"; import { useTranslations } from "next-intl"; import { Button, FullDate, Loader } from "@snailycad/ui"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/components/leo/incidents/manage-incident-modal.tsx b/apps/client/src/components/leo/incidents/manage-incident-modal.tsx index 3610c22d7..137658fd1 100644 --- a/apps/client/src/components/leo/incidents/manage-incident-modal.tsx +++ b/apps/client/src/components/leo/incidents/manage-incident-modal.tsx @@ -22,7 +22,7 @@ import { dataToSlate, Editor } from "components/editor/editor"; import { IncidentEventsArea } from "./IncidentEventsArea"; import { classNames } from "lib/classNames"; import { useActiveIncidents } from "hooks/realtime/useActiveIncidents"; -import { EmsFdIncident, LeoIncident, StatusValueType, ValueType } from "@snailycad/types"; +import { type EmsFdIncident, type LeoIncident, StatusValueType, ValueType } from "@snailycad/types"; import { useValues } from "context/ValuesContext"; import type { PostIncidentsData, PutIncidentByIdData } from "@snailycad/types/api"; import { AddressPostalSelect } from "components/form/select/PostalSelect"; @@ -30,8 +30,8 @@ import { InvolvedUnitsTable } from "./involved-units/involved-units-table"; import { ValueSelectField } from "components/form/inputs/value-select-field"; import { useAuth } from "context/AuthContext"; import { useActiveDispatchers } from "hooks/realtime/use-active-dispatchers"; -import { ActiveOfficer, useLeoState } from "state/leo-state"; -import { ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; +import { type ActiveOfficer, useLeoState } from "state/leo-state"; +import { type ActiveDeputy, useEmsFdState } from "state/ems-fd-state"; interface Props { incident?: T | null; diff --git a/apps/client/src/components/leo/jail/release-citizen-modal.tsx b/apps/client/src/components/leo/jail/release-citizen-modal.tsx index 1dd7f8cab..43a5a7fe5 100644 --- a/apps/client/src/components/leo/jail/release-citizen-modal.tsx +++ b/apps/client/src/components/leo/jail/release-citizen-modal.tsx @@ -1,11 +1,11 @@ import { Modal } from "components/modal/Modal"; import { Button, Loader, SelectField } from "@snailycad/ui"; import useFetch from "lib/useFetch"; -import { BaseCitizen, Record, ReleaseType } from "@snailycad/types"; +import { type BaseCitizen, type Record, ReleaseType } from "@snailycad/types"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "next-intl"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import type { DeleteReleaseJailedCitizenData } from "@snailycad/types/api"; import { CitizenSuggestionsField } from "components/shared/CitizenSuggestionsField"; 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/CreateWarrantModal.tsx b/apps/client/src/components/leo/modals/CreateWarrantModal.tsx index d833af871..099204737 100644 --- a/apps/client/src/components/leo/modals/CreateWarrantModal.tsx +++ b/apps/client/src/components/leo/modals/CreateWarrantModal.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useTranslations } from "use-intl"; import { Loader, Button, SelectField, TextField } from "@snailycad/ui"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/components/leo/modals/CustomFieldSearch/CustomFieldResults.tsx b/apps/client/src/components/leo/modals/CustomFieldSearch/CustomFieldResults.tsx index 4f56e505b..9792ae9c5 100644 --- a/apps/client/src/components/leo/modals/CustomFieldSearch/CustomFieldResults.tsx +++ b/apps/client/src/components/leo/modals/CustomFieldSearch/CustomFieldResults.tsx @@ -4,9 +4,9 @@ import { Button } from "@snailycad/ui"; import { Table, useTableState } from "components/shared/Table"; import { useModal } from "state/modalState"; import { useTranslations } from "next-intl"; -import { NameSearchResult, useNameSearch } from "state/search/name-search-state"; -import { useVehicleSearch, VehicleSearchResult } from "state/search/vehicle-search-state"; -import { useWeaponSearch, WeaponSearchResult } from "state/search/weapon-search-state"; +import { type NameSearchResult, useNameSearch } from "state/search/name-search-state"; +import { useVehicleSearch, type VehicleSearchResult } from "state/search/vehicle-search-state"; +import { useWeaponSearch, type WeaponSearchResult } from "state/search/weapon-search-state"; import { ModalIds } from "types/modal-ids"; import type { CustomFieldResults } from "./CustomFieldSearch"; diff --git a/apps/client/src/components/leo/modals/ManageOfficerModal.tsx b/apps/client/src/components/leo/modals/ManageOfficerModal.tsx index cd704b484..7ed082302 100644 --- a/apps/client/src/components/leo/modals/ManageOfficerModal.tsx +++ b/apps/client/src/components/leo/modals/ManageOfficerModal.tsx @@ -3,7 +3,7 @@ import { CREATE_OFFICER_SCHEMA } from "@snailycad/schemas"; import { Loader, Button } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Formik, FormikHelpers } from "formik"; +import { Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx b/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx index 2579b7de4..bf65472de 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/NameSearchModal.tsx @@ -6,17 +6,17 @@ import { Form, Formik, useFormikContext } from "formik"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; -import { CustomFieldCategory, Citizen, BoloType } from "@snailycad/types"; +import { CustomFieldCategory, type Citizen, BoloType } from "@snailycad/types"; import format from "date-fns/format"; import { NameSearchTabsContainer } from "./tabs/tabs-container"; -import { NameSearchResult, useNameSearch } from "state/search/name-search-state"; +import { type NameSearchResult, useNameSearch } from "state/search/name-search-state"; import { useRouter } from "next/router"; import { ArrowLeft, PersonFill } from "react-bootstrap-icons"; import { useImageUrl } from "hooks/useImageUrl"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; import dynamic from "next/dynamic"; import { - LicenseInitialValues, + type LicenseInitialValues, ManageLicensesModal, } from "components/citizen/licenses/manage-licenses-modal"; import { ManageCitizenFlagsModal } from "./ManageCitizenFlagsModal"; diff --git a/apps/client/src/components/leo/modals/NameSearchModal/sections/license-points/manage-license-points-modal.tsx b/apps/client/src/components/leo/modals/NameSearchModal/sections/license-points/manage-license-points-modal.tsx index e10afae4f..565277a0e 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/sections/license-points/manage-license-points-modal.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/sections/license-points/manage-license-points-modal.tsx @@ -8,7 +8,7 @@ import { Button, Loader, TextField } from "@snailycad/ui"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { useNameSearch } from "state/search/name-search-state"; -import { PutSearchActionsLicensePointsData } from "@snailycad/types/api"; +import type { PutSearchActionsLicensePointsData } from "@snailycad/types/api"; import { toastMessage } from "lib/toastMessage"; export function ManageLicensePointsModal() { diff --git a/apps/client/src/components/leo/modals/NameSearchModal/tabs/records-tab.tsx b/apps/client/src/components/leo/modals/NameSearchModal/tabs/records-tab.tsx index 51bb3b6f4..244f146dc 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/tabs/records-tab.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/tabs/records-tab.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import compareDesc from "date-fns/compareDesc"; import { useRouter } from "next/router"; -import { PaymentStatus, Record, RecordType } from "@snailycad/types"; +import { PaymentStatus, type Record, RecordType } from "@snailycad/types"; import { useTranslations } from "use-intl"; import { Button, FullDate, Loader, Status, TabsContent } from "@snailycad/ui"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/leo/modals/NameSearchModal/tabs/vehicles-tab.tsx b/apps/client/src/components/leo/modals/NameSearchModal/tabs/vehicles-tab.tsx index 0a84f039d..91e8de79b 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/tabs/vehicles-tab.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/tabs/vehicles-tab.tsx @@ -2,7 +2,7 @@ import { Table, useTableState } from "components/shared/Table"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; import { useTranslations } from "use-intl"; import { Button, FullDate, Status, TabsContent } from "@snailycad/ui"; -import { useVehicleSearch, VehicleSearchResult } from "state/search/vehicle-search-state"; +import { useVehicleSearch, type VehicleSearchResult } from "state/search/vehicle-search-state"; import { useModal } from "state/modalState"; import { useNameSearch } from "state/search/name-search-state"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/components/leo/modals/NameSearchModal/tabs/warrants-tab.tsx b/apps/client/src/components/leo/modals/NameSearchModal/tabs/warrants-tab.tsx index 8e87fed01..841245c9a 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/tabs/warrants-tab.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/tabs/warrants-tab.tsx @@ -9,7 +9,7 @@ import { useNameSearch } from "state/search/name-search-state"; import { makeUnitName } from "lib/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { Table, useTableState } from "components/shared/Table"; -import { Warrant, WarrantStatus } from "@snailycad/types"; +import { type Warrant, WarrantStatus } from "@snailycad/types"; import type { DeleteRecordsByIdData, PutWarrantsData } from "@snailycad/types/api"; import { Permissions, usePermission } from "hooks/usePermission"; import { useFeatureEnabled } from "hooks/useFeatureEnabled"; diff --git a/apps/client/src/components/leo/modals/VehicleSearchModal.tsx b/apps/client/src/components/leo/modals/VehicleSearchModal.tsx index 681cc064d..f85016e28 100644 --- a/apps/client/src/components/leo/modals/VehicleSearchModal.tsx +++ b/apps/client/src/components/leo/modals/VehicleSearchModal.tsx @@ -6,9 +6,9 @@ import { Form, Formik, useFormikContext } from "formik"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; -import { BoloType, CustomFieldCategory, RegisteredVehicle } from "@snailycad/types"; +import { BoloType, CustomFieldCategory, type RegisteredVehicle } from "@snailycad/types"; import { useRouter } from "next/router"; -import { useVehicleSearch, VehicleSearchResult } from "state/search/vehicle-search-state"; +import { useVehicleSearch, type VehicleSearchResult } from "state/search/vehicle-search-state"; import { ManageVehicleFlagsModal } from "./VehicleSearch/ManageVehicleFlagsModal"; import { ManageVehicleLicensesModal } from "./VehicleSearch/ManageVehicleLicensesModal"; import { ManageCustomFieldsModal } from "./NameSearchModal/ManageCustomFieldsModal"; diff --git a/apps/client/src/components/leo/modals/business-search-modal/business-search-modal.tsx b/apps/client/src/components/leo/modals/business-search-modal/business-search-modal.tsx index 263ea3b52..b2f086d67 100644 --- a/apps/client/src/components/leo/modals/business-search-modal/business-search-modal.tsx +++ b/apps/client/src/components/leo/modals/business-search-modal/business-search-modal.tsx @@ -10,7 +10,7 @@ import { Table, useTableState } from "components/shared/Table"; import { formatCitizenAddress } from "lib/utils"; import type { PostLeoSearchBusinessData } from "@snailycad/types/api"; import type { BaseCitizen } from "@snailycad/types"; -import { BusinessSearchResult, useBusinessSearch } from "state/search/business-search-state"; +import { type BusinessSearchResult, useBusinessSearch } from "state/search/business-search-state"; import dynamic from "next/dynamic"; const BusinessSearchTabsContainer = dynamic( 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/select-penal-code.tsx b/apps/client/src/components/leo/modals/manage-record/select-penal-code.tsx index 11a9b4ca5..d0a2e6e44 100644 --- a/apps/client/src/components/leo/modals/manage-record/select-penal-code.tsx +++ b/apps/client/src/components/leo/modals/manage-record/select-penal-code.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Select, SelectValue } from "components/form/Select"; +import { Select, type SelectValue } from "components/form/Select"; import type { PenalCode } from "@snailycad/types"; import { FormRow } from "@snailycad/ui"; import { usePenalCodeGroups } from "hooks/values/use-penal-code-groups"; 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/leo/modals/manage-record/tabs/connections-tab/connections-tab.tsx b/apps/client/src/components/leo/modals/manage-record/tabs/connections-tab/connections-tab.tsx index b15fb19e2..0f1e5127f 100644 --- a/apps/client/src/components/leo/modals/manage-record/tabs/connections-tab/connections-tab.tsx +++ b/apps/client/src/components/leo/modals/manage-record/tabs/connections-tab/connections-tab.tsx @@ -10,7 +10,7 @@ import { useTranslations } from "use-intl"; import dynamic from "next/dynamic"; import type { Call911, Record } from "@snailycad/types"; -import { Get911CallsData } from "@snailycad/types/api"; +import type { Get911CallsData } from "@snailycad/types/api"; const ManageIncidentModal = dynamic( async () => (await import("components/leo/incidents/manage-incident-modal")).ManageIncidentModal, diff --git a/apps/client/src/components/leo/modals/select-officer-modal.tsx b/apps/client/src/components/leo/modals/select-officer-modal.tsx index 41a1b40d9..bc4dc4694 100644 --- a/apps/client/src/components/leo/modals/select-officer-modal.tsx +++ b/apps/client/src/components/leo/modals/select-officer-modal.tsx @@ -4,14 +4,19 @@ import { FormField } from "components/form/FormField"; import { Select } from "components/form/Select"; import { Modal } from "components/modal/Modal"; import { useModal } from "state/modalState"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { handleValidate } from "lib/handleValidate"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; import { useLeoState } from "state/leo-state"; import { useValues } from "context/ValuesContext"; -import { EmergencyVehicleValue, Officer, ShouldDoType, WhatPages } from "@snailycad/types"; +import { + type EmergencyVehicleValue, + type Officer, + ShouldDoType, + WhatPages, +} from "@snailycad/types"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; import { isUnitDisabled, makeUnitName } from "lib/utils"; import type { PutDispatchStatusByUnitId } from "@snailycad/types/api"; diff --git a/apps/client/src/components/leo/modals/weapon-search-modal.tsx b/apps/client/src/components/leo/modals/weapon-search-modal.tsx index e7641b1c6..74dbfa0e4 100644 --- a/apps/client/src/components/leo/modals/weapon-search-modal.tsx +++ b/apps/client/src/components/leo/modals/weapon-search-modal.tsx @@ -6,7 +6,7 @@ import { Form, Formik } from "formik"; import useFetch from "lib/useFetch"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; -import { useWeaponSearch, WeaponSearchResult } from "state/search/weapon-search-state"; +import { useWeaponSearch, type WeaponSearchResult } from "state/search/weapon-search-state"; import { CustomFieldsArea } from "./CustomFieldsArea"; import { useRouter } from "next/router"; import { ManageCustomFieldsModal } from "./NameSearchModal/ManageCustomFieldsModal"; diff --git a/apps/client/src/components/leo/private-messages/private-messages-button.tsx b/apps/client/src/components/leo/private-messages/private-messages-button.tsx index 680eccf74..e79e0e687 100644 --- a/apps/client/src/components/leo/private-messages/private-messages-button.tsx +++ b/apps/client/src/components/leo/private-messages/private-messages-button.tsx @@ -1,12 +1,12 @@ import { useListener } from "@casperiv/use-socket.io"; import { SocketEvents } from "@snailycad/config"; -import { DispatchChat } from "@snailycad/types"; +import type { DispatchChat } from "@snailycad/types"; import { Button } from "@snailycad/ui"; import { useQuery } from "@tanstack/react-query"; import { toastMessage } from "lib/toastMessage"; import useFetch from "lib/useFetch"; -import { ActiveDeputy } from "state/ems-fd-state"; -import { ActiveOfficer } from "state/leo-state"; +import type { ActiveDeputy } from "state/ems-fd-state"; +import type { ActiveOfficer } from "state/leo-state"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/components/leo/qualifications/UnitQualificationsTable.tsx b/apps/client/src/components/leo/qualifications/UnitQualificationsTable.tsx index 398f0e54d..e534c3a0e 100644 --- a/apps/client/src/components/leo/qualifications/UnitQualificationsTable.tsx +++ b/apps/client/src/components/leo/qualifications/UnitQualificationsTable.tsx @@ -1,4 +1,9 @@ -import { EmsFdDeputy, Officer, QualificationValueType, UnitQualification } from "@snailycad/types"; +import { + type EmsFdDeputy, + type Officer, + QualificationValueType, + type UnitQualification, +} from "@snailycad/types"; import { FullDate } from "@snailycad/ui"; import { QualificationsHoverCard } from "components/admin/manage/units/QualificationHoverCard"; import { Table, useTableState } from "components/shared/Table"; diff --git a/apps/client/src/components/leo/records-stats-column.tsx b/apps/client/src/components/leo/records-stats-column.tsx index ddd348b69..20ed4bf3f 100644 --- a/apps/client/src/components/leo/records-stats-column.tsx +++ b/apps/client/src/components/leo/records-stats-column.tsx @@ -1,4 +1,4 @@ -import { Record, Violation } from "@snailycad/types"; +import type { Record, Violation } from "@snailycad/types"; import { useTranslations } from "use-intl"; interface Props { diff --git a/apps/client/src/components/modal/AlertModal.tsx b/apps/client/src/components/modal/AlertModal.tsx index f095d87ce..4729e121f 100644 --- a/apps/client/src/components/modal/AlertModal.tsx +++ b/apps/client/src/components/modal/AlertModal.tsx @@ -1,9 +1,9 @@ -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"; import { useTranslations } from "use-intl"; -import { Modal, ModalProps } from "./Modal"; +import { Modal, type ModalProps } from "./Modal"; import type { ModalIds } from "types/modal-ids"; type Props = Pick & { diff --git a/apps/client/src/components/shared/image-wrapper.tsx b/apps/client/src/components/shared/image-wrapper.tsx index 27386737c..a8d7cd870 100644 --- a/apps/client/src/components/shared/image-wrapper.tsx +++ b/apps/client/src/components/shared/image-wrapper.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import Image, { ImageProps } from "next/image"; +import Image, { type ImageProps } from "next/image"; interface Props extends ImageProps { fallback?: React.ReactNode; diff --git a/apps/client/src/components/shared/table/skeleton-loader.tsx b/apps/client/src/components/shared/table/skeleton-loader.tsx index 18bf8e01f..1082353ca 100644 --- a/apps/client/src/components/shared/table/skeleton-loader.tsx +++ b/apps/client/src/components/shared/table/skeleton-loader.tsx @@ -1,5 +1,5 @@ import { classNames } from "lib/classNames"; -import { _RowData } from "./table"; +import type { _RowData } from "./table"; interface TableSkeletonLoaderProps { tableHeaders?: { id: string }[]; diff --git a/apps/client/src/components/shared/table/table-header.tsx b/apps/client/src/components/shared/table/table-header.tsx index e3adb5794..5b13500ad 100644 --- a/apps/client/src/components/shared/table/table-header.tsx +++ b/apps/client/src/components/shared/table/table-header.tsx @@ -6,7 +6,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@snailycad/ui"; -import { Column, flexRender, Header, RowData } from "@tanstack/react-table"; +import { type Column, flexRender, type Header, type RowData } from "@tanstack/react-table"; import { classNames } from "lib/classNames"; import { ArrowDownSquareFill, Check, ThreeDots } from "react-bootstrap-icons"; diff --git a/apps/client/src/components/shared/table/table-row.tsx b/apps/client/src/components/shared/table/table-row.tsx index 227d64ba3..4bde21773 100644 --- a/apps/client/src/components/shared/table/table-row.tsx +++ b/apps/client/src/components/shared/table/table-row.tsx @@ -1,6 +1,6 @@ import { ErrorBoundary } from "@sentry/nextjs"; import { TableActionsAlignment } from "@snailycad/types"; -import { Cell, flexRender, Row, RowData } from "@tanstack/react-table"; +import { type Cell, flexRender, type Row, type RowData } from "@tanstack/react-table"; import { classNames } from "lib/classNames"; interface Props { diff --git a/apps/client/src/components/shared/table/table.tsx b/apps/client/src/components/shared/table/table.tsx index 16e4c6d31..d69c1102c 100644 --- a/apps/client/src/components/shared/table/table.tsx +++ b/apps/client/src/components/shared/table/table.tsx @@ -2,12 +2,12 @@ import * as React from "react"; import { getCoreRowModel, getSortedRowModel, - RowData, + type RowData, useReactTable, - Header, + type Header, getFilteredRowModel, - Row, - AccessorKeyColumnDef, + type Row, + type AccessorKeyColumnDef, } from "@tanstack/react-table"; import { TableRow } from "./table-row"; import { TablePagination } from "./table-pagination"; diff --git a/apps/client/src/components/shared/utility-panel/statuses-area.tsx b/apps/client/src/components/shared/utility-panel/statuses-area.tsx index ef0eee48a..1f4d0a48c 100644 --- a/apps/client/src/components/shared/utility-panel/statuses-area.tsx +++ b/apps/client/src/components/shared/utility-panel/statuses-area.tsx @@ -11,10 +11,10 @@ import type { ActiveDeputy } from "state/ems-fd-state"; import type { ActiveOfficer } from "state/leo-state"; import { ModalIds } from "types/modal-ids"; import { - CombinedEmsFdUnit, - CombinedLeoUnit, - EmsFdDeputy, - Officer, + type CombinedEmsFdUnit, + type CombinedLeoUnit, + type EmsFdDeputy, + type Officer, ShouldDoType, WhatPages, type StatusValue, diff --git a/apps/client/src/context/AuthContext.tsx b/apps/client/src/context/AuthContext.tsx index df42e6954..645816a62 100644 --- a/apps/client/src/context/AuthContext.tsx +++ b/apps/client/src/context/AuthContext.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { useRouter } from "next/router"; -import { type cad as CAD, type User, WhitelistStatus, Rank, ApiToken } from "@snailycad/types"; +import { type cad as CAD, type User, WhitelistStatus, Rank, type ApiToken } from "@snailycad/types"; import { useIsRouteFeatureEnabled } from "../hooks/auth/useIsRouteFeatureEnabled"; import { useListener } from "@casperiv/use-socket.io"; import { SocketEvents } from "@snailycad/config"; diff --git a/apps/client/src/hooks/global/use-tones.tsx b/apps/client/src/hooks/global/use-tones.tsx index 785d7cb5f..9c225dedf 100644 --- a/apps/client/src/hooks/global/use-tones.tsx +++ b/apps/client/src/hooks/global/use-tones.tsx @@ -4,7 +4,7 @@ import { SocketEvents } from "@snailycad/config"; import { useTranslations } from "use-intl"; import { useAudio } from "react-use"; import { useRouter } from "next/router"; -import { ActiveTone, ActiveToneType } from "@snailycad/types"; +import { type ActiveTone, ActiveToneType } from "@snailycad/types"; import { useQuery } from "@tanstack/react-query"; import type { GETDispatchTonesData } from "@snailycad/types/api"; import useFetch from "lib/useFetch"; diff --git a/apps/client/src/hooks/realtime/use-active-incidents-table.ts b/apps/client/src/hooks/realtime/use-active-incidents-table.ts index 121471bc5..898a1ac37 100644 --- a/apps/client/src/hooks/realtime/use-active-incidents-table.ts +++ b/apps/client/src/hooks/realtime/use-active-incidents-table.ts @@ -3,7 +3,7 @@ import type { GetIncidentsData } from "@snailycad/types/api"; import { SocketEvents } from "@snailycad/config"; import { useListener } from "@casperiv/use-socket.io"; import { useAsyncTable } from "components/shared/Table"; -import { LeoIncident } from "@snailycad/types"; +import type { LeoIncident } from "@snailycad/types"; import { useDispatchState } from "state/dispatch/dispatch-state"; export function useActiveIncidentsTable() { diff --git a/apps/client/src/hooks/realtime/use-active-warrants.ts b/apps/client/src/hooks/realtime/use-active-warrants.ts index 67d64b6ee..99c5636ca 100644 --- a/apps/client/src/hooks/realtime/use-active-warrants.ts +++ b/apps/client/src/hooks/realtime/use-active-warrants.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import { ActiveWarrant } from "state/leo-state"; +import type { ActiveWarrant } from "state/leo-state"; import type { GetActiveWarrantsData } from "@snailycad/types/api"; import { SocketEvents } from "@snailycad/config"; import { useListener } from "@casperiv/use-socket.io"; diff --git a/apps/client/src/hooks/shared/table/use-async-table.ts b/apps/client/src/hooks/shared/table/use-async-table.ts index a9813b100..574e88b8f 100644 --- a/apps/client/src/hooks/shared/table/use-async-table.ts +++ b/apps/client/src/hooks/shared/table/use-async-table.ts @@ -1,7 +1,7 @@ import * as React from "react"; import useFetch from "lib/useFetch"; import { useDebounce } from "react-use"; -import { useQuery, QueryFunctionContext } from "@tanstack/react-query"; +import { useQuery, type QueryFunctionContext } from "@tanstack/react-query"; import { useList } from "./use-list"; interface FetchOptions { diff --git a/apps/client/src/hooks/shared/useUnitsStatusChange.ts b/apps/client/src/hooks/shared/useUnitsStatusChange.ts index 8df4724a7..abf1289ac 100644 --- a/apps/client/src/hooks/shared/useUnitsStatusChange.ts +++ b/apps/client/src/hooks/shared/useUnitsStatusChange.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import { StatusValue, StatusValueType, ShouldDoType } from "@snailycad/types"; +import { type StatusValue, StatusValueType, ShouldDoType } from "@snailycad/types"; import useFetch from "lib/useFetch"; import type { PutDispatchStatusByUnitId } from "@snailycad/types/api"; diff --git a/apps/client/src/hooks/useFeatureEnabled.ts b/apps/client/src/hooks/useFeatureEnabled.ts index 7150e5c2f..4cad7351a 100644 --- a/apps/client/src/hooks/useFeatureEnabled.ts +++ b/apps/client/src/hooks/useFeatureEnabled.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import { CadFeatureOptions, CourthouseType, Feature, LicenseExamType } from "@snailycad/types"; +import { type CadFeatureOptions, CourthouseType, Feature, LicenseExamType } from "@snailycad/types"; import { useAuth } from "context/AuthContext"; export const DEFAULT_DISABLED_FEATURES = { 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/admin/values/values.tsx b/apps/client/src/lib/admin/values/values.tsx index 99a1b8e11..16a74ddf5 100644 --- a/apps/client/src/lib/admin/values/values.tsx +++ b/apps/client/src/lib/admin/values/values.tsx @@ -10,11 +10,11 @@ import { type VehicleValue, type Value, ShouldDoType, - QualificationValue, - CallTypeValue, + type QualificationValue, + type CallTypeValue, type AnyValue, - AddressValue, - DriversLicenseCategoryValue, + type AddressValue, + type DriversLicenseCategoryValue, } from "@snailycad/types"; import { SHOULD_DO_LABELS, diff --git a/apps/client/src/lib/editor/utils.ts b/apps/client/src/lib/editor/utils.ts index bf5aa8258..cd4b317fd 100644 --- a/apps/client/src/lib/editor/utils.ts +++ b/apps/client/src/lib/editor/utils.ts @@ -1,4 +1,4 @@ -import { SlateEditor, Text } from "@snailycad/utils/editor"; +import type { SlateEditor, Text } from "@snailycad/utils/editor"; import { Editor, Transforms, Element as SlateElement } from "slate"; const LIST_TYPES = ["numbered-list", "bulleted-list"]; diff --git a/apps/client/src/lib/editor/withChecklists.ts b/apps/client/src/lib/editor/withChecklists.ts index 174f41541..1e1754785 100644 --- a/apps/client/src/lib/editor/withChecklists.ts +++ b/apps/client/src/lib/editor/withChecklists.ts @@ -1,4 +1,4 @@ -import { SlateEditor } from "@snailycad/utils/editor"; +import type { SlateEditor } from "@snailycad/utils/editor"; import { Editor, Transforms, Range, Point, Element as SlateElement } from "slate"; export function withChecklists(editor: SlateEditor) { diff --git a/apps/client/src/lib/editor/withShortcuts.ts b/apps/client/src/lib/editor/withShortcuts.ts index ef553c3b9..3bfb9c92b 100644 --- a/apps/client/src/lib/editor/withShortcuts.ts +++ b/apps/client/src/lib/editor/withShortcuts.ts @@ -1,4 +1,4 @@ -import { SlateEditor } from "@snailycad/utils/editor"; +import type { SlateEditor } from "@snailycad/utils/editor"; import { Editor, Transforms, Range, Point, Element as SlateElement } from "slate"; type SHORTCUTS = (typeof SHORTCUTS)[keyof typeof SHORTCUTS]; 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/map/create-map-units-from-active-units.ts.ts b/apps/client/src/lib/map/create-map-units-from-active-units.ts.ts index d35a7e97c..b5f7f1f31 100644 --- a/apps/client/src/lib/map/create-map-units-from-active-units.ts.ts +++ b/apps/client/src/lib/map/create-map-units-from-active-units.ts.ts @@ -1,12 +1,12 @@ import { - CombinedEmsFdUnit, - CombinedLeoUnit, - EmsFdDeputy, - Officer, + type CombinedEmsFdUnit, + type CombinedLeoUnit, + type EmsFdDeputy, + type Officer, ShouldDoType, } from "@snailycad/types"; import { isUnitCombined, isUnitCombinedEmsFd } from "@snailycad/utils"; -import { MapPlayer, PlayerDataEventPayload } from "types/map"; +import type { MapPlayer, PlayerDataEventPayload } from "types/map"; interface ActiveUnitsOptions { players: (MapPlayer | PlayerDataEventPayload)[]; 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 1caee8e60..2a7f8e500 100644 --- a/apps/client/src/lib/useFetch.tsx +++ b/apps/client/src/lib/useFetch.tsx @@ -8,8 +8,8 @@ import { ModalIds } from "../types/modal-ids"; import { useAuth } from "../context/AuthContext"; import { getNextI18nConfig } from "./i18n/getNextI18nConfig"; import { - ErrorMessage, - ErrorResponseData, + type ErrorMessage, + type ErrorResponseData, getErrorObj, getFeatureNotEnabledError, isAxiosError, @@ -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 2e7cd705f..be12bbbb4 100644 --- a/apps/client/src/lib/utils.ts +++ b/apps/client/src/lib/utils.ts @@ -5,9 +5,9 @@ import { type Value, type ValueLicenseType, WhitelistStatus, - EmsFdDeputy, - CombinedEmsFdUnit, - Business, + type EmsFdDeputy, + type CombinedEmsFdUnit, + type Business, } from "@snailycad/types"; import { isUnitCombined, isUnitCombinedEmsFd, isUnitOfficer } from "@snailycad/utils/typeguards"; import { handleRequest } from "./fetch"; @@ -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/lib/validation/does-user-have-required-connections.ts b/apps/client/src/lib/validation/does-user-have-required-connections.ts index 150658676..50265fec0 100644 --- a/apps/client/src/lib/validation/does-user-have-required-connections.ts +++ b/apps/client/src/lib/validation/does-user-have-required-connections.ts @@ -1,4 +1,4 @@ -import { Feature, Rank, User } from "@snailycad/types"; +import { Feature, Rank, type User } from "@snailycad/types"; import { DEFAULT_DISABLED_FEATURES } from "hooks/useFeatureEnabled"; interface VerifyUserConnectionsOptions { diff --git a/apps/client/src/lib/validation/zod-error-map.ts b/apps/client/src/lib/validation/zod-error-map.ts index df2ce6a54..38df55997 100644 --- a/apps/client/src/lib/validation/zod-error-map.ts +++ b/apps/client/src/lib/validation/zod-error-map.ts @@ -1,5 +1,11 @@ import { createTranslator } from "use-intl"; -import { ErrorMapCtx, util, ZodIssueCode, ZodIssueOptionalMessage, ZodParsedType } from "zod"; +import { + type ErrorMapCtx, + util, + ZodIssueCode, + type ZodIssueOptionalMessage, + ZodParsedType, +} from "zod"; export interface GetErrorMapOptions { locale: string; diff --git a/apps/client/src/pages/_error.tsx b/apps/client/src/pages/_error.tsx index eeee89181..b97afedff 100644 --- a/apps/client/src/pages/_error.tsx +++ b/apps/client/src/pages/_error.tsx @@ -1,6 +1,6 @@ import { Button } from "@snailycad/ui"; import type { NextPageContext } from "next"; -import NextErrorComponent, { ErrorProps } from "next/error"; +import NextErrorComponent, { type ErrorProps } from "next/error"; import * as Sentry from "@sentry/nextjs"; interface ErrorPageProps extends ErrorProps { diff --git a/apps/client/src/pages/account.tsx b/apps/client/src/pages/account.tsx index 2101190c5..b31d75a47 100644 --- a/apps/client/src/pages/account.tsx +++ b/apps/client/src/pages/account.tsx @@ -13,7 +13,7 @@ import { useMounted } from "@casperiv/useful"; import { Title } from "components/shared/Title"; import { toastMessage } from "lib/toastMessage"; import { canUseThirdPartyConnections } from "lib/utils"; -import { getAvailableSounds, Sounds } from "lib/server/getAvailableSounds.server"; +import { getAvailableSounds, type Sounds } from "lib/server/getAvailableSounds.server"; import { AccountInfoTab } from "components/account/account-info-tab"; const AccountSettingsTab = dynamic( diff --git a/apps/client/src/pages/admin/import/vehicles.tsx b/apps/client/src/pages/admin/import/vehicles.tsx index b4ad7ffcc..59cf87822 100644 --- a/apps/client/src/pages/admin/import/vehicles.tsx +++ b/apps/client/src/pages/admin/import/vehicles.tsx @@ -6,7 +6,7 @@ import type { GetServerSideProps } from "next"; import { AdminLayout } from "components/admin/AdminLayout"; import { requestAll } from "lib/utils"; import { Title } from "components/shared/Title"; -import { RegisteredVehicle } from "@snailycad/types"; +import type { RegisteredVehicle } from "@snailycad/types"; import { Table, useTableState } from "components/shared/Table"; import { Button, FullDate } from "@snailycad/ui"; import { ImportModal } from "components/admin/import/ImportModal"; diff --git a/apps/client/src/pages/admin/import/weapons.tsx b/apps/client/src/pages/admin/import/weapons.tsx index 2df14f6a4..a1a1ea0df 100644 --- a/apps/client/src/pages/admin/import/weapons.tsx +++ b/apps/client/src/pages/admin/import/weapons.tsx @@ -6,7 +6,7 @@ import type { GetServerSideProps } from "next"; import { AdminLayout } from "components/admin/AdminLayout"; import { requestAll } from "lib/utils"; import { Title } from "components/shared/Title"; -import { Weapon } from "@snailycad/types"; +import type { Weapon } from "@snailycad/types"; import { Table, useTableState } from "components/shared/Table"; import { Button, FullDate } from "@snailycad/ui"; import { ImportModal } from "components/admin/import/ImportModal"; diff --git a/apps/client/src/pages/admin/values/penal-code/index.tsx b/apps/client/src/pages/admin/values/penal-code/index.tsx index c4de3326b..7825ae9cf 100644 --- a/apps/client/src/pages/admin/values/penal-code/index.tsx +++ b/apps/client/src/pages/admin/values/penal-code/index.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { PenalCodeGroup, ValueType } from "@snailycad/types"; +import { type PenalCodeGroup, ValueType } from "@snailycad/types"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; diff --git a/apps/client/src/pages/auth/account-password.tsx b/apps/client/src/pages/auth/account-password.tsx index d96d8cc14..cc43571db 100644 --- a/apps/client/src/pages/auth/account-password.tsx +++ b/apps/client/src/pages/auth/account-password.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useRouter } from "next/router"; import { TEMP_PASSWORD_SCHEMA } from "@snailycad/schemas"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/pages/auth/register.tsx b/apps/client/src/pages/auth/register.tsx index fb4b8c0a6..8995c77b7 100644 --- a/apps/client/src/pages/auth/register.tsx +++ b/apps/client/src/pages/auth/register.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import Link from "next/link"; import { useRouter } from "next/router"; import { AUTH_SCHEMA } from "@snailycad/schemas"; @@ -10,7 +10,7 @@ import { handleValidate } from "lib/handleValidate"; import type { GetServerSideProps } from "next"; import { getTranslations } from "lib/getTranslation"; import { Button, Loader, TextField } from "@snailycad/ui"; -import { cad, WhitelistStatus } from "@snailycad/types"; +import { type cad, WhitelistStatus } from "@snailycad/types"; import { handleRequest } from "lib/fetch"; import { Title } from "components/shared/Title"; import { AuthScreenImages } from "components/auth/auth-screen-images"; diff --git a/apps/client/src/pages/auth/temp-password.tsx b/apps/client/src/pages/auth/temp-password.tsx index 78886f3df..3d4933c25 100644 --- a/apps/client/src/pages/auth/temp-password.tsx +++ b/apps/client/src/pages/auth/temp-password.tsx @@ -1,4 +1,4 @@ -import { Form, Formik, FormikHelpers } from "formik"; +import { Form, Formik, type FormikHelpers } from "formik"; import { useRouter } from "next/router"; import { TEMP_PASSWORD_SCHEMA } from "@snailycad/schemas"; import { useTranslations } from "use-intl"; diff --git a/apps/client/src/pages/bleeter/@/[handle].tsx b/apps/client/src/pages/bleeter/@/[handle].tsx index 71d382aa5..2d16ce7b5 100644 --- a/apps/client/src/pages/bleeter/@/[handle].tsx +++ b/apps/client/src/pages/bleeter/@/[handle].tsx @@ -1,5 +1,5 @@ import { defaultPermissions } from "@snailycad/permissions"; -import { GetBleeterProfileByHandleData } from "@snailycad/types/api"; +import type { GetBleeterProfileByHandleData } from "@snailycad/types/api"; import { Button, Loader } from "@snailycad/ui"; import { Layout } from "components/Layout"; import { BleeterPostsList } from "components/bleeter/list/posts-list"; @@ -19,7 +19,7 @@ import { classNames } from "lib/classNames"; import { getTranslations } from "lib/getTranslation"; import useFetch from "lib/useFetch"; import { requestAll } from "lib/utils"; -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import { useRouter } from "next/router"; import { PatchCheckFill } from "react-bootstrap-icons"; import { useModal } from "state/modalState"; diff --git a/apps/client/src/pages/business/[id]/[employeeId]/index.tsx b/apps/client/src/pages/business/[id]/[employeeId]/index.tsx index a79f5bce5..349a5fa0d 100644 --- a/apps/client/src/pages/business/[id]/[employeeId]/index.tsx +++ b/apps/client/src/pages/business/[id]/[employeeId]/index.tsx @@ -11,7 +11,7 @@ import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { useBusinessState } from "state/business-state"; import { useTranslations } from "use-intl"; -import { BusinessPost, WhitelistStatus } from "@snailycad/types"; +import { type BusinessPost, WhitelistStatus } from "@snailycad/types"; import useFetch from "lib/useFetch"; import dynamic from "next/dynamic"; import { requestAll } from "lib/utils"; diff --git a/apps/client/src/pages/business/[id]/[employeeId]/manage.tsx b/apps/client/src/pages/business/[id]/[employeeId]/manage.tsx index b09b71bf5..f1e895b36 100644 --- a/apps/client/src/pages/business/[id]/[employeeId]/manage.tsx +++ b/apps/client/src/pages/business/[id]/[employeeId]/manage.tsx @@ -5,7 +5,7 @@ import { Layout } from "components/Layout"; import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; -import { FullBusiness, FullEmployee, useBusinessState } from "state/business-state"; +import { type FullBusiness, type FullEmployee, useBusinessState } from "state/business-state"; import { useTranslations } from "use-intl"; import { EmployeeAsEnum } from "@snailycad/types"; import dynamic from "next/dynamic"; @@ -13,7 +13,7 @@ import { requestAll } from "lib/utils"; import { Title } from "components/shared/Title"; import { EmployeesTab } from "components/business/manage/tabs/employees-tab/employees-tab"; import { TabList, BreadcrumbItem, Breadcrumbs } from "@snailycad/ui"; -import { GetBusinessByIdData } from "@snailycad/types/api"; +import type { GetBusinessByIdData } from "@snailycad/types/api"; interface Props { employee: FullEmployee | null; diff --git a/apps/client/src/pages/ems-fd/hospital-services.tsx b/apps/client/src/pages/ems-fd/hospital-services.tsx index 33c5faf5e..930d2f8e4 100644 --- a/apps/client/src/pages/ems-fd/hospital-services.tsx +++ b/apps/client/src/pages/ems-fd/hospital-services.tsx @@ -11,7 +11,7 @@ import { Title } from "components/shared/Title"; import { usePermission, Permissions } from "hooks/usePermission"; import type { GetDeadCitizensData, PostEmsFdDeclareCitizenById } from "@snailycad/types/api"; import { Table, useAsyncTable, useTableState } from "components/shared/Table"; -import { Citizen } from "@snailycad/types"; +import type { Citizen } from "@snailycad/types"; import { AlertModal } from "components/modal/AlertModal"; import useFetch from "lib/useFetch"; import { useTemporaryItem } from "hooks/shared/useTemporaryItem"; diff --git a/apps/client/src/pages/officer/index.tsx b/apps/client/src/pages/officer/index.tsx index 0850f4b7f..89e56c56f 100644 --- a/apps/client/src/pages/officer/index.tsx +++ b/apps/client/src/pages/officer/index.tsx @@ -10,7 +10,7 @@ import { useLeoState } from "state/leo-state"; import { ActiveToneType, DashboardLayoutCardType, - Record, + type Record, RecordType, ValueType, } from "@snailycad/types"; diff --git a/apps/client/src/pages/officer/jail.tsx b/apps/client/src/pages/officer/jail.tsx index f9b57dac4..eba879d83 100644 --- a/apps/client/src/pages/officer/jail.tsx +++ b/apps/client/src/pages/officer/jail.tsx @@ -6,7 +6,13 @@ import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import { makeUnitName, requestAll } from "lib/utils"; import type { GetServerSideProps } from "next"; -import { Record, BaseCitizen, RecordRelease, ReleaseType, ValueType } from "@snailycad/types"; +import { + type Record, + type BaseCitizen, + type RecordRelease, + ReleaseType, + ValueType, +} from "@snailycad/types"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; import { Table, useTableState } from "components/shared/Table"; diff --git a/apps/client/src/pages/officer/my-officers.tsx b/apps/client/src/pages/officer/my-officers.tsx index 9c640d3db..fca98b3f1 100644 --- a/apps/client/src/pages/officer/my-officers.tsx +++ b/apps/client/src/pages/officer/my-officers.tsx @@ -8,7 +8,7 @@ import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import type { GetServerSideProps } from "next"; import { ModalIds } from "types/modal-ids"; -import { Officer, ValueType } from "@snailycad/types"; +import { type Officer, ValueType } from "@snailycad/types"; import useFetch from "lib/useFetch"; import { formatOfficerDepartment, formatUnitDivisions, makeUnitName, requestAll } from "lib/utils"; import { useGenerateCallsign } from "hooks/useGenerateCallsign"; diff --git a/apps/client/src/pages/officer/supervisor/citizen-logs/[citizenId].tsx b/apps/client/src/pages/officer/supervisor/citizen-logs/[citizenId].tsx index 0138d386e..168f13a3a 100644 --- a/apps/client/src/pages/officer/supervisor/citizen-logs/[citizenId].tsx +++ b/apps/client/src/pages/officer/supervisor/citizen-logs/[citizenId].tsx @@ -4,7 +4,7 @@ import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import { makeUnitName, requestAll } from "lib/utils"; import type { GetServerSideProps } from "next"; -import { Citizen, RecordLog, RecordType } from "@snailycad/types"; +import { type Citizen, type RecordLog, RecordType } from "@snailycad/types"; import { Title } from "components/shared/Title"; import { Permissions } from "@snailycad/permissions"; import type { GetManageRecordsLogsCitizenData } from "@snailycad/types/api"; diff --git a/apps/client/src/pages/officer/supervisor/exams.tsx b/apps/client/src/pages/officer/supervisor/exams.tsx index 8fe12d174..59a949d41 100644 --- a/apps/client/src/pages/officer/supervisor/exams.tsx +++ b/apps/client/src/pages/officer/supervisor/exams.tsx @@ -6,7 +6,7 @@ import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import { requestAll } from "lib/utils"; import type { GetServerSideProps } from "next"; -import { LicenseExam, LicenseExamStatus } from "@snailycad/types"; +import { type LicenseExam, LicenseExamStatus } from "@snailycad/types"; import { Table, useTableState } from "components/shared/Table"; import { Title } from "components/shared/Title"; import { Permissions } from "@snailycad/permissions"; diff --git a/apps/client/src/pages/pets/[id]/index.tsx b/apps/client/src/pages/pets/[id]/index.tsx index 88468deb5..1f7720589 100644 --- a/apps/client/src/pages/pets/[id]/index.tsx +++ b/apps/client/src/pages/pets/[id]/index.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { GetPetByIdData } from "@snailycad/types/api"; +import type { GetPetByIdData } from "@snailycad/types/api"; import { BreadcrumbItem, Breadcrumbs, Loader } from "@snailycad/ui"; import { Layout } from "components/Layout"; import { PetInformationCard } from "components/citizen/pets/pet-information-card"; @@ -7,7 +7,7 @@ import { Title } from "components/shared/Title"; import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import { requestAll } from "lib/utils"; -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import { usePetsState } from "state/citizen/pets-state"; import { useTranslations } from "use-intl"; import { PetMedicalRecordsCard } from "components/citizen/pets/medical-records/pet-medical-records-card"; diff --git a/apps/client/src/pages/pets/index.tsx b/apps/client/src/pages/pets/index.tsx index 87370bbad..2fb3f4c5d 100644 --- a/apps/client/src/pages/pets/index.tsx +++ b/apps/client/src/pages/pets/index.tsx @@ -1,4 +1,4 @@ -import { GetUserPetsData } from "@snailycad/types/api"; +import type { GetUserPetsData } from "@snailycad/types/api"; import { Button, buttonVariants } from "@snailycad/ui"; import { Layout } from "components/Layout"; import { ManagePetModal } from "components/citizen/pets/manage-pet-modal"; @@ -7,7 +7,7 @@ import { Title } from "components/shared/Title"; import { getSessionUser } from "lib/auth"; import { getTranslations } from "lib/getTranslation"; import { requestAll } from "lib/utils"; -import { GetServerSideProps } from "next"; +import type { GetServerSideProps } from "next"; import Link from "next/link"; import { useModal } from "state/modalState"; import { ModalIds } from "types/modal-ids"; diff --git a/apps/client/src/pages/taxi.tsx b/apps/client/src/pages/taxi.tsx index 65bdf3d60..49704244a 100644 --- a/apps/client/src/pages/taxi.tsx +++ b/apps/client/src/pages/taxi.tsx @@ -11,7 +11,7 @@ import { requestAll } from "lib/utils"; import { Title } from "components/shared/Title"; import { TowTaxiCallsTable } from "components/citizen/tow/tow-taxi-calls-table"; import { Permissions } from "@snailycad/permissions"; -import { GetTaxiCallsData } from "@snailycad/types/api"; +import type { GetTaxiCallsData } from "@snailycad/types/api"; interface Props { initialData: GetTaxiCallsData; diff --git a/apps/client/src/state/mapState.ts b/apps/client/src/state/mapState.ts index 82e488dc4..c0b13089e 100644 --- a/apps/client/src/state/mapState.ts +++ b/apps/client/src/state/mapState.ts @@ -1,6 +1,6 @@ -import { ConnectionStatus } from "@snailycad/ui"; -import { Socket } from "socket.io-client"; -import { SmartMotorwaySignMarker, SmartSignMarker } from "types/map"; +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"; import { createWithEqualityFn } from "zustand/traditional"; diff --git a/apps/client/tsconfig.json b/apps/client/tsconfig.json index 9a684683b..58d68d448 100644 --- a/apps/client/tsconfig.json +++ b/apps/client/tsconfig.json @@ -5,16 +5,12 @@ "module": "ESNext", "incremental": true, "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, "noEmit": true, - "esModuleInterop": true, "moduleResolution": "node", - "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", - "strict": true, + "verbatimModuleSyntax": true, + "baseUrl": ".", "paths": { "lib/*": ["./src/lib/*"], @@ -31,6 +27,13 @@ } ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + "**/*.json", + "./i18n.config.mjs", + ".next/types/**/*.ts" + ], "exclude": ["node_modules"] } 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) { diff --git a/tsconfig.base.json b/tsconfig.base.json index 26095cdb9..34adf31cf 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -20,6 +20,7 @@ "noImplicitThis": true, "alwaysStrict": true, "pretty": true, + "forceConsistentCasingInFileNames": true, /* Additional Checks */ "noUnusedLocals": true /* Report errors on unused locals. */, @@ -28,6 +29,10 @@ "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, "allowUnreachableCode": false, - "lib": ["es2022"] + "lib": ["es2022"], + + /* Monorepo options */ + "composite": true, + "declarationMap": true } }