Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix lint errors

Tuan Dangbf08bfacb543
diff --git a/backend/src/ee/controllers/v1/workspaceController.ts b/backend/src/ee/controllers/v1/workspaceController.ts
index 54c28177fd..64b6980f86 100644
--- a/backend/src/ee/controllers/v1/workspaceController.ts
+++ b/backend/src/ee/controllers/v1/workspaceController.ts
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
-import { PipelineStage, trusted, Types } from "mongoose";
+import { PipelineStage, Types } from "mongoose";
import { Secret } from "../../../models";
import {
FolderVersion,
@@ -15,7 +15,7 @@ import { getLatestSecretVersionIds } from "../../helpers/secretVersion";
import Folder, { TFolderSchema } from "../../../models/folder";
import { searchByFolderId } from "../../../services/FolderService";
import { EELicenseService } from "../../services";
-import { isValidIpOrCidr, extractIPDetails } from "../../../utils/ip";
+import { extractIPDetails, isValidIpOrCidr } from "../../../utils/ip";
/**
* Return secret snapshots for workspace with id [workspaceId]
diff --git a/backend/src/ee/routes/v1/users.ts b/backend/src/ee/routes/v1/users.ts
index bf37f84c95..14dcaa49cf 100644
--- a/backend/src/ee/routes/v1/users.ts
+++ b/backend/src/ee/routes/v1/users.ts
@@ -3,7 +3,7 @@ const router = express.Router();
import {
requireAuth
} from "../../../middleware";
-import { AUTH_MODE_JWT, AUTH_MODE_API_KEY } from "../../../variables";
+import { AUTH_MODE_API_KEY, AUTH_MODE_JWT } from "../../../variables";
import { usersController } from "../../controllers/v1";
router.get(
diff --git a/backend/src/utils/ip/ip.ts b/backend/src/utils/ip/ip.ts
index dc68d0b29b..ac3b17149b 100644
--- a/backend/src/utils/ip/ip.ts
+++ b/backend/src/utils/ip/ip.ts
@@ -88,7 +88,7 @@ export const isValidCidr = (cidr: string): boolean => {
*/
export const isValidIpOrCidr = (ip: string): boolean => {
// if the string contains a slash, treat it as a CIDR block
- if (ip.includes('/')) {
+ if (ip.includes("/")) {
return isValidCidr(ip);
}
diff --git a/backend/src/utils/setup/backfillData.ts b/backend/src/utils/setup/backfillData.ts
index 5e2e58910b..fdc766316c 100644
--- a/backend/src/utils/setup/backfillData.ts
+++ b/backend/src/utils/setup/backfillData.ts
@@ -4,11 +4,11 @@ import { Types } from "mongoose";
import { encryptSymmetric128BitHexKeyUTF8 } from "../crypto";
import { EESecretService } from "../../ee/services";
import {
+ IPType,
ISecretVersion,
- SecretSnapshot,
+ SecretSnapshot,
SecretVersion,
- TrustedIP,
- IPType
+ TrustedIP
} from "../../ee/models";
import {
BackupPrivateKey,
diff --git a/frontend/src/hooks/api/index.tsx b/frontend/src/hooks/api/index.tsx
index 034e48b43d..672e510520 100644
--- a/frontend/src/hooks/api/index.tsx
+++ b/frontend/src/hooks/api/index.tsx
@@ -14,7 +14,7 @@ export * from "./serviceTokens";
export * from "./ssoConfig";
export * from "./subscriptions";
export * from "./tags";
+export * from "./trustedIps";
export * from "./users";
export * from "./webhooks";
export * from "./workspace";
-export * from "./trustedIps";
diff --git a/frontend/src/hooks/api/organization/queries.tsx b/frontend/src/hooks/api/organization/queries.tsx
index 5194b56a35..63de2773db 100644
--- a/frontend/src/hooks/api/organization/queries.tsx
+++ b/frontend/src/hooks/api/organization/queries.tsx
@@ -1,4 +1,5 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+
import { apiRequest } from "@app/config/request";
import {
diff --git a/frontend/src/hooks/api/trustedIps/index.ts b/frontend/src/hooks/api/trustedIps/index.ts
index 8aea2ae846..eb86f8e403 100644
--- a/frontend/src/hooks/api/trustedIps/index.ts
+++ b/frontend/src/hooks/api/trustedIps/index.ts
@@ -1,6 +1,5 @@
export {
- useGetTrustedIps,
useAddTrustedIp,
- useUpdateTrustedIp,
- useDeleteTrustedIp
-} from "./queries";
\ No newline at end of file
+ useDeleteTrustedIp,
+ useGetTrustedIps,
+ useUpdateTrustedIp} from "./queries";
\ No newline at end of file
diff --git a/frontend/src/hooks/api/trustedIps/queries.ts b/frontend/src/hooks/api/trustedIps/queries.ts
index c0cb7fbbd9..f239bb0ca6 100644
--- a/frontend/src/hooks/api/trustedIps/queries.ts
+++ b/frontend/src/hooks/api/trustedIps/queries.ts
@@ -1,5 +1,7 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+
import { apiRequest } from "@app/config/request";
+
import {
TrustedIp
} from "./types";
diff --git a/frontend/src/hooks/api/users/index.tsx b/frontend/src/hooks/api/users/index.tsx
index 2d7b14f92b..a209367e23 100644
--- a/frontend/src/hooks/api/users/index.tsx
+++ b/frontend/src/hooks/api/users/index.tsx
@@ -5,8 +5,8 @@ export {
useCreateAPIKey,
useDeleteAPIKey,
useDeleteOrgMembership,
- useGetMyIp,
useGetMyAPIKeys,
+ useGetMyIp,
useGetMySessions,
useGetOrgUsers,
useGetUser,
diff --git a/frontend/src/pages/project/[id]/allowlist/index.tsx b/frontend/src/pages/project/[id]/allowlist/index.tsx
index 0bc865dfba..9014cf0e91 100644
--- a/frontend/src/pages/project/[id]/allowlist/index.tsx
+++ b/frontend/src/pages/project/[id]/allowlist/index.tsx
@@ -1,5 +1,6 @@
import { useTranslation } from "react-i18next";
import Head from "next/head";
+
import { IPAllowlistPage } from "@app/views/Project/IPAllowListPage";
const ProjectAllowlist = () => {
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx
index 52e202a2e8..07de4425e6 100644
--- a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx
@@ -2,6 +2,7 @@ import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
+
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import {
Button,
@@ -10,13 +11,13 @@ import {
Modal,
ModalContent
} from "@app/components/v2";
-import { UsePopUpState } from "@app/hooks/usePopUp";
import { useWorkspace } from "@app/context";
import {
- useGetMyIp,
useAddTrustedIp,
+ useGetMyIp,
useUpdateTrustedIp
} from "@app/hooks/api";
+import { UsePopUpState } from "@app/hooks/usePopUp";
const schema = yup.object({
ipAddress: yup.string().required("IP address is required"),
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx
index 89ba6ce24b..729ab549e5 100644
--- a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx
@@ -1,18 +1,20 @@
-import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import {
Button,
DeleteActionModal,
UpgradePlanModal
} from "@app/components/v2";
+import { useSubscription,useWorkspace } from "@app/context";
import {
useDeleteTrustedIp
} from "@app/hooks/api";
-import { useSubscription,useWorkspace } from "@app/context";
import { usePopUp } from "@app/hooks/usePopUp";
-import { IPAllowlistTable } from "./IPAllowlistTable";
+
import { IPAllowlistModal } from "./IPAllowlistModal";
+import { IPAllowlistTable } from "./IPAllowlistTable";
export const IPAllowlistSection = () => {
const { createNotification } = useNotificationContext();
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx
index 97d09f9a50..cd93d7c1b6 100644
--- a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx
@@ -1,22 +1,23 @@
+import { faGlobe, faPencil, faXmark } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
import {
- TableContainer,
+ EmptyState,
+ IconButton,
Table,
- THead,
- Tr,
- Th,
+ TableContainer,
+ TableSkeleton,
TBody,
Td,
- EmptyState,
- TableSkeleton,
- IconButton,
+ Th,
+ THead,
+ Tr,
UpgradePlanModal
} from "@app/components/v2";
import { useSubscription, useWorkspace } from "@app/context";
import {
useGetTrustedIps
} from "@app/hooks/api";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { faGlobe, faPencil, faXmark } from "@fortawesome/free-solid-svg-icons";
import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = {
@@ -56,7 +57,7 @@ export const IPAllowlistTable = ({
<Th className="flex-1">Format</Th>
<Th className="flex-1">Comment</Th>
{/* <Th className="flex-1">Status</Th> */}
- <Th className="w-5"></Th>
+ <Th className="w-5" />
</Tr>
</THead>
<TBody>
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsSection.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsSection.tsx
index 8098443fa9..a124813ed4 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsSection.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsSection.tsx
@@ -1,6 +1,7 @@
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
import {
Button
} from "@app/components/v2";
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
index e1e9c1bb90..743106998f 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
@@ -1,5 +1,6 @@
import { faCreditCard, faXmark } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
import {
EmptyState,
IconButton,
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/TaxIDModal.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/TaxIDModal.tsx
index 73827e4f33..a6e039a9b6 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/TaxIDModal.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/TaxIDModal.tsx
@@ -1,6 +1,7 @@
import { Controller, useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
+
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import {
Button,
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
index 6807af0d57..612052a366 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
@@ -1,5 +1,6 @@
import { faDownload, faFileInvoice } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
import {
EmptyState,
IconButton,
diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentSection.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentSection.tsx
index 80476eb5ec..62a66e72c3 100644
--- a/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentSection.tsx
+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentSection.tsx
@@ -1,5 +1,6 @@
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import {
Button,
@@ -11,6 +12,7 @@ import {
useDeleteWsEnvironment
} from "@app/hooks/api";
import { usePopUp } from "@app/hooks/usePopUp";
+
import { AddEnvironmentModal } from "./AddEnvironmentModal";
import { EnvironmentTable } from "./EnvironmentTable";
import { UpdateEnvironmentModal } from "./UpdateEnvironmentModal";