From 1afa125cc2402a184e126ffa327c2e0c5a91481e Mon Sep 17 00:00:00 2001 From: Henry Catalini Smith Date: Wed, 22 May 2024 20:50:47 +0200 Subject: [PATCH] Fix linter errors --- webapp/src/app/page.tsx | 6 +- webapp/src/components/MessageForm.tsx | 6 +- webapp/src/components/ProjectCard.tsx | 4 +- webapp/src/stories/MessageForm.stories.tsx | 74 +++++++++++++++------- webapp/src/stories/ProjectCard.stories.tsx | 4 +- 5 files changed, 61 insertions(+), 33 deletions(-) diff --git a/webapp/src/app/page.tsx b/webapp/src/app/page.tsx index 91390bf5..a2dc2919 100644 --- a/webapp/src/app/page.tsx +++ b/webapp/src/app/page.tsx @@ -10,13 +10,13 @@ import { ServerConfig } from '@/utils/serverConfig'; // time instead of at runtime. That doesn't work: this page needs to fetch // project-specific config files and perform git operations. So this little // one-liner forces it into dynamic rendering mode. -// +// // More info on dynamic vs static rendering at: // https://nextjs.org/learn/dashboard-app/static-and-dynamic-rendering -// +// // More info on `export const dynamic` at: // https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config -export const dynamic = "force-dynamic"; +export const dynamic = 'force-dynamic'; export default async function Home() { const serverConfig = await ServerConfig.read(); diff --git a/webapp/src/components/MessageForm.tsx b/webapp/src/components/MessageForm.tsx index a64f89d4..07c08b68 100644 --- a/webapp/src/components/MessageForm.tsx +++ b/webapp/src/components/MessageForm.tsx @@ -32,7 +32,11 @@ type MessageFormProps = { * the source code on the left for reference, and the current translation on the * right. */ -const MessageForm: FC = ({ message, onSave, translation }) => { +const MessageForm: FC = ({ + message, + onSave, + translation, +}) => { const [text, setText] = useState(translation); useEffect(() => { diff --git a/webapp/src/components/ProjectCard.tsx b/webapp/src/components/ProjectCard.tsx index c935cdc2..ff8e83ce 100644 --- a/webapp/src/components/ProjectCard.tsx +++ b/webapp/src/components/ProjectCard.tsx @@ -154,11 +154,11 @@ const ProjectCard: FC = ({ diff --git a/webapp/src/stories/MessageForm.stories.tsx b/webapp/src/stories/MessageForm.stories.tsx index 97016f10..4a800a2c 100644 --- a/webapp/src/stories/MessageForm.stories.tsx +++ b/webapp/src/stories/MessageForm.stories.tsx @@ -1,4 +1,4 @@ -import MessageForm from "@/components/MessageForm"; +import MessageForm from '@/components/MessageForm'; const stories = { component: MessageForm, @@ -6,31 +6,57 @@ const stories = { layout: 'centered', }, tags: ['autodocs'], - title: "MessageForm", -} + title: 'MessageForm', +}; -export const Default = () => {}} translation="translation" /> +export const Default = () => ( + {}} + translation="translation" + /> +); -export const LongDefaultMessage = () => {}} translation="translation" /> +export const LongDefaultMessage = () => ( + {}} + translation="translation" + /> +); -export const LongTranslationString = () => {}} translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." /> +export const LongTranslationString = () => ( + {}} + translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." + /> +); -export const LongDefaultAndTranslation = () => {}} translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." /> +export const LongDefaultAndTranslation = () => ( + {}} + translation="Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation." + /> +); -export default stories \ No newline at end of file +export default stories; diff --git a/webapp/src/stories/ProjectCard.stories.tsx b/webapp/src/stories/ProjectCard.stories.tsx index 2e7a77af..89540019 100644 --- a/webapp/src/stories/ProjectCard.stories.tsx +++ b/webapp/src/stories/ProjectCard.stories.tsx @@ -34,9 +34,7 @@ export const Gen2 = () => (