Skip to content

Commit

Permalink
Merge pull request #237 from Hexastack/236-issue-frontend-imports-order
Browse files Browse the repository at this point in the history
fix(frontend): eslint imports order
  • Loading branch information
marrouchi authored Oct 18, 2024
2 parents c902a8c + 4a0e2ae commit 96fe7fa
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 19 deletions.
3 changes: 2 additions & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"unknown", // <- unknown
"index", // <- index imports
"internal", // <- Absolute imports
["sibling", "parent"] // <- Relative imports, the sibling and parent types they can be mingled together
"parent", // <- Relative imports, the sibling and parent types they can be mingled together
"sibling"
],
"newlines-between": "always",
"alphabetize": {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/categories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ import { EntityType } from "@/services/types";
import { PermissionAction } from "@/types/permission.types";
import { getDateTimeFormatter } from "@/utils/date";

import { CategoryDialog } from "./CategoryDialog";
import { ICategory } from "../../types/category.types";

import { CategoryDialog } from "./CategoryDialog";

export const Categories = () => {
const { t } = useTranslate();
const { toast } = useToast();
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/inbox/components/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { useConfig } from "@/hooks/useConfig";
import { useTranslate } from "@/hooks/useTranslate";
import { EntityType } from "@/services/types";

import { ChatActions } from "./ChatActions";
import { ChatHeader } from "./ChatHeader";
import {
getAvatarSrc,
getMessageContent,
Expand All @@ -33,6 +31,9 @@ import {
import { useChat } from "../hooks/ChatContext";
import { useInfinitedLiveMessages } from "../hooks/useInfiniteLiveMessages";

import { ChatActions } from "./ChatActions";
import { ChatHeader } from "./ChatHeader";

export function Chat() {
const { apiUrl } = useConfig();
const { t, i18n } = useTranslate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import { useNormalizedInfiniteQuery } from "@/hooks/crud/useNormalizedInfiniteQu
import { EntityType, QueryType } from "@/services/types";
import { useSubscribe } from "@/websocket/socket-hooks";

import { useChat } from "./ChatContext";
import { SocketMessageEvents } from "../types";

import { useChat } from "./ChatContext";

export const useInfinitedLiveMessages = () => {
const { subscriber: activeChat } = useChat();
const queryClient = useQueryClient();
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/visual-editor/BlockDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ import { useTranslate } from "@/hooks/useTranslate";
import { EntityType } from "@/services/types";
import { OutgoingMessageFormat } from "@/types/message.types";

import { IBlockAttributes, IBlock } from "../../types/block.types";

import BlockFormProvider from "./form/BlockFormProvider";
import { MessageForm } from "./form/MessageForm";
import { OptionsForm } from "./form/OptionsForm";
import { TriggersForm } from "./form/TriggersForm";
import { IBlockAttributes, IBlock } from "../../types/block.types";

export type BlockDialogProps = DialogControlProps<IBlock>;
type TSelectedTab = "triggers" | "options" | "messages";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import { Pattern } from "@/types/block.types";
import { SXStyleOptions } from "@/utils/SXStyleOptions";
import { createValueWithId, ValueWithId } from "@/utils/valueWithId";

import PatternInput from "./PatternInput";
import { getInputControls } from "../../utils/inputControls";

import PatternInput from "./PatternInput";

type PatternsInputProps = {
value: Pattern[];
onChange: (patterns: Pattern[]) => void;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/visual-editor/v2/Diagrams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ import { IBlock } from "@/types/block.types";
import { ICategory } from "@/types/category.types";
import { BlockPorts } from "@/types/visual-editor.types";

import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLinkModel";
import BlockDialog from "../BlockDialog";
import { ZOOM_LEVEL } from "../constants";
import { useVisualEditor } from "../hooks/useVisualEditor";

import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLinkModel";

const Diagrams = () => {
const { t } = useTranslate();
const [model, setModel] = useState<
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";

import { isSameEntity, useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient";

import { isSameEntity, useNormalizeAndCache } from "./helpers";

export const useCreate = <
TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"],
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useDelete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import {
TType,
} from "@/types/base.types";

import { isSameEntity } from "./helpers";
import { useEntityApiClient } from "../useApiClient";

import { isSameEntity } from "./helpers";

export const useDelete = <
TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"],
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useDeleteMany.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";

import { isSameEntity } from "./helpers";
import { useEntityApiClient } from "../useApiClient";

import { isSameEntity } from "./helpers";

export const useDeleteMany = <
TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"],
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/hooks/crud/useFind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import {
TType,
} from "@/types/base.types";

import { useEntityApiClient } from "../useApiClient";
import { usePagination } from "../usePagination";

import { useNormalizeAndCache } from "./helpers";
import { useCount } from "./useCount";
import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";
import { usePagination } from "../usePagination";

export const useFind = <
TDynamicProps extends IDynamicProps,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useGet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import {
TType,
} from "@/types/base.types";

import { useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient";

import { useNormalizeAndCache } from "./helpers";

export const useGet = <
TDynamicProps extends IDynamicProps,
TAttr = TType<TDynamicProps["entity"]>["attributes"],
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useInfiniteFind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import {
TType,
} from "@/types/base.types";

import { useEntityApiClient } from "../useApiClient";

import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";

export const useInfiniteFind = <
TDynamicProps extends IDynamicProps,
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/hooks/crud/useNormalizedInfiniteQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import {
TType,
} from "@/types/base.types";

import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";
import { toPageQueryPayload } from "../usePagination";

import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";

const PAGE_SIZE = 20;

export const useNormalizedInfiniteQuery = <
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import {
} from "@/types/base.types";
import { merge } from "@/utils/object";

import { useEntityApiClient } from "../useApiClient";

import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";

export const useUpdate = <
TEntity extends IDynamicProps["entity"],
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/hooks/crud/useUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";

import { isSameEntity, useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient";

import { isSameEntity, useNormalizeAndCache } from "./helpers";

export const useUpload = <
TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"],
Expand Down

0 comments on commit 96fe7fa

Please sign in to comment.