Merge pull request #237 from Hexastack/236-issue-frontend-imports-order

fix(frontend): eslint imports order
This commit is contained in:
Med Marrouchi 2024-10-18 18:26:51 +01:00 committed by GitHub
commit 96fe7faabc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 35 additions and 19 deletions

View File

@ -20,7 +20,8 @@
"unknown", // <- unknown "unknown", // <- unknown
"index", // <- index imports "index", // <- index imports
"internal", // <- Absolute 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", "newlines-between": "always",
"alphabetize": { "alphabetize": {

View File

@ -34,9 +34,10 @@ import { EntityType } from "@/services/types";
import { PermissionAction } from "@/types/permission.types"; import { PermissionAction } from "@/types/permission.types";
import { getDateTimeFormatter } from "@/utils/date"; import { getDateTimeFormatter } from "@/utils/date";
import { CategoryDialog } from "./CategoryDialog";
import { ICategory } from "../../types/category.types"; import { ICategory } from "../../types/category.types";
import { CategoryDialog } from "./CategoryDialog";
export const Categories = () => { export const Categories = () => {
const { t } = useTranslate(); const { t } = useTranslate();
const { toast } = useToast(); const { toast } = useToast();

View File

@ -23,8 +23,6 @@ import { useConfig } from "@/hooks/useConfig";
import { useTranslate } from "@/hooks/useTranslate"; import { useTranslate } from "@/hooks/useTranslate";
import { EntityType } from "@/services/types"; import { EntityType } from "@/services/types";
import { ChatActions } from "./ChatActions";
import { ChatHeader } from "./ChatHeader";
import { import {
getAvatarSrc, getAvatarSrc,
getMessageContent, getMessageContent,
@ -33,6 +31,9 @@ import {
import { useChat } from "../hooks/ChatContext"; import { useChat } from "../hooks/ChatContext";
import { useInfinitedLiveMessages } from "../hooks/useInfiniteLiveMessages"; import { useInfinitedLiveMessages } from "../hooks/useInfiniteLiveMessages";
import { ChatActions } from "./ChatActions";
import { ChatHeader } from "./ChatHeader";
export function Chat() { export function Chat() {
const { apiUrl } = useConfig(); const { apiUrl } = useConfig();
const { t, i18n } = useTranslate(); const { t, i18n } = useTranslate();

View File

@ -14,9 +14,10 @@ import { useNormalizedInfiniteQuery } from "@/hooks/crud/useNormalizedInfiniteQu
import { EntityType, QueryType } from "@/services/types"; import { EntityType, QueryType } from "@/services/types";
import { useSubscribe } from "@/websocket/socket-hooks"; import { useSubscribe } from "@/websocket/socket-hooks";
import { useChat } from "./ChatContext";
import { SocketMessageEvents } from "../types"; import { SocketMessageEvents } from "../types";
import { useChat } from "./ChatContext";
export const useInfinitedLiveMessages = () => { export const useInfinitedLiveMessages = () => {
const { subscriber: activeChat } = useChat(); const { subscriber: activeChat } = useChat();
const queryClient = useQueryClient(); const queryClient = useQueryClient();

View File

@ -35,11 +35,12 @@ import { useTranslate } from "@/hooks/useTranslate";
import { EntityType } from "@/services/types"; import { EntityType } from "@/services/types";
import { OutgoingMessageFormat } from "@/types/message.types"; import { OutgoingMessageFormat } from "@/types/message.types";
import { IBlockAttributes, IBlock } from "../../types/block.types";
import BlockFormProvider from "./form/BlockFormProvider"; import BlockFormProvider from "./form/BlockFormProvider";
import { MessageForm } from "./form/MessageForm"; import { MessageForm } from "./form/MessageForm";
import { OptionsForm } from "./form/OptionsForm"; import { OptionsForm } from "./form/OptionsForm";
import { TriggersForm } from "./form/TriggersForm"; import { TriggersForm } from "./form/TriggersForm";
import { IBlockAttributes, IBlock } from "../../types/block.types";
export type BlockDialogProps = DialogControlProps<IBlock>; export type BlockDialogProps = DialogControlProps<IBlock>;
type TSelectedTab = "triggers" | "options" | "messages"; type TSelectedTab = "triggers" | "options" | "messages";

View File

@ -17,9 +17,10 @@ import { Pattern } from "@/types/block.types";
import { SXStyleOptions } from "@/utils/SXStyleOptions"; import { SXStyleOptions } from "@/utils/SXStyleOptions";
import { createValueWithId, ValueWithId } from "@/utils/valueWithId"; import { createValueWithId, ValueWithId } from "@/utils/valueWithId";
import PatternInput from "./PatternInput";
import { getInputControls } from "../../utils/inputControls"; import { getInputControls } from "../../utils/inputControls";
import PatternInput from "./PatternInput";
type PatternsInputProps = { type PatternsInputProps = {
value: Pattern[]; value: Pattern[];
onChange: (patterns: Pattern[]) => void; onChange: (patterns: Pattern[]) => void;

View File

@ -52,11 +52,12 @@ import { IBlock } from "@/types/block.types";
import { ICategory } from "@/types/category.types"; import { ICategory } from "@/types/category.types";
import { BlockPorts } from "@/types/visual-editor.types"; import { BlockPorts } from "@/types/visual-editor.types";
import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLinkModel";
import BlockDialog from "../BlockDialog"; import BlockDialog from "../BlockDialog";
import { ZOOM_LEVEL } from "../constants"; import { ZOOM_LEVEL } from "../constants";
import { useVisualEditor } from "../hooks/useVisualEditor"; import { useVisualEditor } from "../hooks/useVisualEditor";
import { AdvancedLinkModel } from "./AdvancedLink/AdvancedLinkModel";
const Diagrams = () => { const Diagrams = () => {
const { t } = useTranslate(); const { t } = useTranslate();
const [model, setModel] = useState< const [model, setModel] = useState<

View File

@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types"; import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types"; import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";
import { isSameEntity, useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { isSameEntity, useNormalizeAndCache } from "./helpers";
export const useCreate = < export const useCreate = <
TEntity extends IDynamicProps["entity"], TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"], TAttr = TType<TEntity>["attributes"],

View File

@ -16,9 +16,10 @@ import {
TType, TType,
} from "@/types/base.types"; } from "@/types/base.types";
import { isSameEntity } from "./helpers";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { isSameEntity } from "./helpers";
export const useDelete = < export const useDelete = <
TEntity extends IDynamicProps["entity"], TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"], TAttr = TType<TEntity>["attributes"],

View File

@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types"; import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types"; import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";
import { isSameEntity } from "./helpers";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { isSameEntity } from "./helpers";
export const useDeleteMany = < export const useDeleteMany = <
TEntity extends IDynamicProps["entity"], TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"], TAttr = TType<TEntity>["attributes"],

View File

@ -23,11 +23,12 @@ import {
TType, TType,
} from "@/types/base.types"; } from "@/types/base.types";
import { useEntityApiClient } from "../useApiClient";
import { usePagination } from "../usePagination";
import { useNormalizeAndCache } from "./helpers"; import { useNormalizeAndCache } from "./helpers";
import { useCount } from "./useCount"; import { useCount } from "./useCount";
import { useGetFromCache } from "./useGet"; import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";
import { usePagination } from "../usePagination";
export const useFind = < export const useFind = <
TDynamicProps extends IDynamicProps, TDynamicProps extends IDynamicProps,

View File

@ -18,9 +18,10 @@ import {
TType, TType,
} from "@/types/base.types"; } from "@/types/base.types";
import { useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { useNormalizeAndCache } from "./helpers";
export const useGet = < export const useGet = <
TDynamicProps extends IDynamicProps, TDynamicProps extends IDynamicProps,
TAttr = TType<TDynamicProps["entity"]>["attributes"], TAttr = TType<TDynamicProps["entity"]>["attributes"],

View File

@ -23,9 +23,10 @@ import {
TType, TType,
} from "@/types/base.types"; } from "@/types/base.types";
import { useEntityApiClient } from "../useApiClient";
import { useNormalizeAndCache } from "./helpers"; import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet"; import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";
export const useInfiniteFind = < export const useInfiniteFind = <
TDynamicProps extends IDynamicProps, TDynamicProps extends IDynamicProps,

View File

@ -23,11 +23,12 @@ import {
TType, TType,
} from "@/types/base.types"; } from "@/types/base.types";
import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { toPageQueryPayload } from "../usePagination"; import { toPageQueryPayload } from "../usePagination";
import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet";
const PAGE_SIZE = 20; const PAGE_SIZE = 20;
export const useNormalizedInfiniteQuery = < export const useNormalizedInfiniteQuery = <

View File

@ -17,9 +17,10 @@ import {
} from "@/types/base.types"; } from "@/types/base.types";
import { merge } from "@/utils/object"; import { merge } from "@/utils/object";
import { useEntityApiClient } from "../useApiClient";
import { useNormalizeAndCache } from "./helpers"; import { useNormalizeAndCache } from "./helpers";
import { useGetFromCache } from "./useGet"; import { useGetFromCache } from "./useGet";
import { useEntityApiClient } from "../useApiClient";
export const useUpdate = < export const useUpdate = <
TEntity extends IDynamicProps["entity"], TEntity extends IDynamicProps["entity"],

View File

@ -11,9 +11,10 @@ import { useMutation, useQueryClient } from "react-query";
import { QueryType, TMutationOptions } from "@/services/types"; import { QueryType, TMutationOptions } from "@/services/types";
import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types"; import { IBaseSchema, IDynamicProps, TType } from "@/types/base.types";
import { isSameEntity, useNormalizeAndCache } from "./helpers";
import { useEntityApiClient } from "../useApiClient"; import { useEntityApiClient } from "../useApiClient";
import { isSameEntity, useNormalizeAndCache } from "./helpers";
export const useUpload = < export const useUpload = <
TEntity extends IDynamicProps["entity"], TEntity extends IDynamicProps["entity"],
TAttr = TType<TEntity>["attributes"], TAttr = TType<TEntity>["attributes"],