From 50c7b92e360d2013d31d901bdbf87d972b600d46 Mon Sep 17 00:00:00 2001 From: molvqingtai Date: Wed, 2 Aug 2023 04:25:05 +0800 Subject: [PATCH] style: enable import order and format --- .eslintrc | 1 + src/components/Message.tsx | 4 ++-- src/components/MessageInput.tsx | 2 +- src/components/ui/Markdown.tsx | 2 +- src/createShadowRoot.ts | 2 +- src/main.tsx | 6 +++--- src/views/Footer/index.tsx | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.eslintrc b/.eslintrc index f7f7baf..95a26bc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -32,6 +32,7 @@ "rules": { "prettier/prettier": "error", "react/prop-types": "off", + "import/order": "error", "@typescript-eslint/naming-convention": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/explicit-function-return-type": "off", diff --git a/src/components/Message.tsx b/src/components/Message.tsx index 53edb67..e38f720 100644 --- a/src/components/Message.tsx +++ b/src/components/Message.tsx @@ -1,9 +1,9 @@ import { type FC, useState } from 'react' -import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/Avatar' import { format } from 'date-fns' +import { FrownIcon, ThumbsUpIcon } from 'lucide-react' +import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/Avatar' import LikeButton from '@/components/LikeButton' -import { FrownIcon, ThumbsUpIcon } from 'lucide-react' export interface MessageProps { data: { diff --git a/src/components/MessageInput.tsx b/src/components/MessageInput.tsx index 21f41df..d8e9fc9 100644 --- a/src/components/MessageInput.tsx +++ b/src/components/MessageInput.tsx @@ -1,8 +1,8 @@ import { type FC, type ChangeEvent, type KeyboardEvent } from 'react' +import { useRemeshDomain, useRemeshQuery, useRemeshSend } from 'remesh-react' import { Textarea } from '@/components/ui/Textarea' import { Markdown } from '@/components/ui/Markdown' import { cn } from '@/utils' -import { useRemeshDomain, useRemeshQuery, useRemeshSend } from 'remesh-react' import MessageInputDomain from '@/domain/MessageInput' import { MESSAGE_MAX_LENGTH } from '@/constants' diff --git a/src/components/ui/Markdown.tsx b/src/components/ui/Markdown.tsx index f46b39a..7075d36 100644 --- a/src/components/ui/Markdown.tsx +++ b/src/components/ui/Markdown.tsx @@ -1,7 +1,7 @@ -import { cn } from '@/utils' import { type FC } from 'react' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' +import { cn } from '@/utils' export interface MarkdownProps { children?: string diff --git a/src/createShadowRoot.ts b/src/createShadowRoot.ts index a1f638e..3b11b9a 100644 --- a/src/createShadowRoot.ts +++ b/src/createShadowRoot.ts @@ -1,6 +1,6 @@ -import { createElement } from '@/utils' import { type ReactNode } from 'react' import { createRoot, type Root } from 'react-dom/client' +import { createElement } from '@/utils' export interface RootOptions { mode?: ShadowRootMode diff --git a/src/main.tsx b/src/main.tsx index e945135..cbaea9e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,10 +1,10 @@ import React from 'react' -import App from './App' -import createShadowRoot from './createShadowRoot' -import style from './index.css?inline' import { RemeshRoot } from 'remesh-react' import { RemeshLogger } from 'remesh-logger' import { Remesh } from 'remesh' +import App from './App' +import createShadowRoot from './createShadowRoot' +import style from './index.css?inline' void (async () => { const store = Remesh.store({ diff --git a/src/views/Footer/index.tsx b/src/views/Footer/index.tsx index 7edd6c0..9fe3ec4 100644 --- a/src/views/Footer/index.tsx +++ b/src/views/Footer/index.tsx @@ -1,8 +1,8 @@ import { type FC } from 'react' -import { Button } from '@/components/ui/Button' import { SmileIcon, CornerDownLeftIcon, ImageIcon } from 'lucide-react' -import MessageInput from '@/components/MessageInput' import { useRemeshDomain, useRemeshEvent, useRemeshSend } from 'remesh-react' +import { Button } from '@/components/ui/Button' +import MessageInput from '@/components/MessageInput' import MessageInputDomain from '@/domain/MessageInput' const Footer: FC = () => {