diff --git a/website/.eslintrc.json b/website/.eslintrc.json
index 95127c06..b2253ce8 100644
--- a/website/.eslintrc.json
+++ b/website/.eslintrc.json
@@ -6,6 +6,19 @@
"next/core-web-vitals"
],
"rules": {
- "sort-imports": "warn"
- }
+ "simple-import-sort/imports": "error",
+ "simple-import-sort/exports": "error",
+ "@typescript-eslint/no-unused-vars": "off",
+ "unused-imports/no-unused-imports": "error",
+ "unused-imports/no-unused-vars": [
+ "warn",
+ {
+ "vars": "all",
+ "varsIgnorePattern": "^_",
+ "args": "after-used",
+ "argsIgnorePattern": "^_"
+ }
+ ]
+ },
+ "plugins": ["simple-import-sort", "unused-imports"]
}
diff --git a/website/package-lock.json b/website/package-lock.json
index c67880f1..1896ff26 100644
--- a/website/package-lock.json
+++ b/website/package-lock.json
@@ -24,6 +24,7 @@
"clsx": "^1.2.1",
"eslint": "8.29.0",
"eslint-config-next": "13.0.6",
+ "eslint-plugin-simple-import-sort": "^8.0.0",
"focus-visible": "^5.2.0",
"framer-motion": "^6.5.1",
"next": "13.0.6",
@@ -57,6 +58,7 @@
"cypress": "^12.2.0",
"cypress-image-diff-js": "^1.23.0",
"eslint-plugin-storybook": "^0.6.8",
+ "eslint-plugin-unused-imports": "^2.0.0",
"prettier": "2.8.1",
"prisma": "^4.7.1",
"typescript": "4.9.4"
@@ -16344,6 +16346,14 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/eslint-plugin-simple-import-sort": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-8.0.0.tgz",
+ "integrity": "sha512-bXgJQ+lqhtQBCuWY/FUWdB27j4+lqcvXv5rUARkzbeWLwea+S5eBZEQrhnO+WgX3ZoJHVj0cn943iyXwByHHQw==",
+ "peerDependencies": {
+ "eslint": ">=5.0.0"
+ }
+ },
"node_modules/eslint-plugin-storybook": {
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-0.6.8.tgz",
@@ -16371,6 +16381,36 @@
"lodash": "^4.17.15"
}
},
+ "node_modules/eslint-plugin-unused-imports": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz",
+ "integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==",
+ "dev": true,
+ "dependencies": {
+ "eslint-rule-composer": "^0.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
+ "eslint": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@typescript-eslint/eslint-plugin": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-rule-composer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
+ "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
"node_modules/eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@@ -40976,6 +41016,12 @@
"integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==",
"requires": {}
},
+ "eslint-plugin-simple-import-sort": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-8.0.0.tgz",
+ "integrity": "sha512-bXgJQ+lqhtQBCuWY/FUWdB27j4+lqcvXv5rUARkzbeWLwea+S5eBZEQrhnO+WgX3ZoJHVj0cn943iyXwByHHQw==",
+ "requires": {}
+ },
"eslint-plugin-storybook": {
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-0.6.8.tgz",
@@ -40999,6 +41045,21 @@
}
}
},
+ "eslint-plugin-unused-imports": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz",
+ "integrity": "sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==",
+ "dev": true,
+ "requires": {
+ "eslint-rule-composer": "^0.3.0"
+ }
+ },
+ "eslint-rule-composer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
+ "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
+ "dev": true
+ },
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
diff --git a/website/package.json b/website/package.json
index 87e4ebeb..98f18965 100644
--- a/website/package.json
+++ b/website/package.json
@@ -12,7 +12,10 @@
"build-storybook": "build-storybook",
"cypress": "cypress open",
"cypress:run": "cypress run",
- "cypress:image-baseline": "cypress-image-diff -u"
+ "cypress:image-baseline": "cypress-image-diff -u",
+ "fix:lint": "eslint --fix src/",
+ "fix:format": "prettier --write ./src",
+ "fix": "npm run fix:lint && npm run fix:format"
},
"dependencies": {
"@chakra-ui/react": "^2.4.4",
@@ -31,6 +34,7 @@
"clsx": "^1.2.1",
"eslint": "8.29.0",
"eslint-config-next": "13.0.6",
+ "eslint-plugin-simple-import-sort": "^8.0.0",
"focus-visible": "^5.2.0",
"framer-motion": "^6.5.1",
"next": "13.0.6",
@@ -64,6 +68,7 @@
"cypress": "^12.2.0",
"cypress-image-diff-js": "^1.23.0",
"eslint-plugin-storybook": "^0.6.8",
+ "eslint-plugin-unused-imports": "^2.0.0",
"prettier": "2.8.1",
"prisma": "^4.7.1",
"typescript": "4.9.4"
diff --git a/website/src/components/Container.cy.tsx b/website/src/components/Container.cy.tsx
index 5ffa204f..3e458307 100644
--- a/website/src/components/Container.cy.tsx
+++ b/website/src/components/Container.cy.tsx
@@ -1,4 +1,5 @@
import React from "react";
+
import { Container } from "./Container";
describe("
= NextPage
& { getLayout?: (page: React.ReactElement) => React.ReactNode; diff --git a/website/src/components/Sortable/Sortable.tsx b/website/src/components/Sortable/Sortable.tsx index a86b957a..74ff1bb2 100644 --- a/website/src/components/Sortable/Sortable.tsx +++ b/website/src/components/Sortable/Sortable.tsx @@ -1,8 +1,9 @@ -import { DndContext, PointerSensor, TouchSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core"; -import { ReactNode, useEffect, useState } from "react"; -import { SortableContext, arrayMove, verticalListSortingStrategy } from "@dnd-kit/sortable"; -import type { DragEndEvent } from "@dnd-kit/core/dist/types/events"; import { Flex } from "@chakra-ui/react"; +import { closestCenter, DndContext, PointerSensor, TouchSensor, useSensor, useSensors } from "@dnd-kit/core"; +import type { DragEndEvent } from "@dnd-kit/core/dist/types/events"; +import { arrayMove, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable"; +import { ReactNode, useEffect, useState } from "react"; + import { SortableItem } from "./SortableItem"; export interface SortableProps { diff --git a/website/src/components/Sortable/SortableItem.tsx b/website/src/components/Sortable/SortableItem.tsx index e6b1707f..244fc313 100644 --- a/website/src/components/Sortable/SortableItem.tsx +++ b/website/src/components/Sortable/SortableItem.tsx @@ -1,6 +1,6 @@ +import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { PropsWithChildren } from "react"; -import { useSortable } from "@dnd-kit/sortable"; export const SortableItem = ({ children, id }: PropsWithChildren<{ id: number }>) => { const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id }); diff --git a/website/src/components/TaskSelection/TaskSelection.tsx b/website/src/components/TaskSelection/TaskSelection.tsx index c4f14cde..7cb216c1 100644 --- a/website/src/components/TaskSelection/TaskSelection.tsx +++ b/website/src/components/TaskSelection/TaskSelection.tsx @@ -1,7 +1,8 @@ -import React from "react"; -import { TaskOptions } from "./TaskOptions"; import { Flex } from "@chakra-ui/react"; +import React from "react"; + import { TaskOption } from "./TaskOption"; +import { TaskOptions } from "./TaskOptions"; export const TaskSelection = () => { return ( diff --git a/website/src/components/TaskSelection/index.ts b/website/src/components/TaskSelection/index.ts index 4da7ea7f..d6d93973 100644 --- a/website/src/components/TaskSelection/index.ts +++ b/website/src/components/TaskSelection/index.ts @@ -1,3 +1,3 @@ -export { TaskSelection } from "./TaskSelection"; -export { TaskOptions } from "./TaskOptions"; export { TaskOption } from "./TaskOption"; +export { TaskOptions } from "./TaskOptions"; +export { TaskSelection } from "./TaskSelection"; diff --git a/website/src/pages/404.tsx b/website/src/pages/404.tsx index 2f464fa2..1eb600d7 100644 --- a/website/src/pages/404.tsx +++ b/website/src/pages/404.tsx @@ -1,8 +1,4 @@ -import { useSession } from "next-auth/react"; -import { Footer } from "../components/Footer"; -import { Header } from "src/components/Header"; import Head from "next/head"; -import Link from "next/link"; export default function Error() { return ( diff --git a/website/src/pages/_app.tsx b/website/src/pages/_app.tsx index 119f337b..b36e3392 100644 --- a/website/src/pages/_app.tsx +++ b/website/src/pages/_app.tsx @@ -1,14 +1,13 @@ -import { ChakraProvider } from "@chakra-ui/react"; -import { SessionProvider } from "next-auth/react"; -import { Inter } from "@next/font/google"; -import { extendTheme } from "@chakra-ui/react"; -import type { AppProps } from "next/app"; - -import { NextPageWithLayout, getDefaultLayout } from "src/components/Layout"; - import "../styles/globals.css"; import "focus-visible"; +import { ChakraProvider } from "@chakra-ui/react"; +import { extendTheme } from "@chakra-ui/react"; +import { Inter } from "@next/font/google"; +import type { AppProps } from "next/app"; +import { SessionProvider } from "next-auth/react"; +import { getDefaultLayout, NextPageWithLayout } from "src/components/Layout"; + const inter = Inter({ subsets: ["latin"], variable: "--font-inter", diff --git a/website/src/pages/account/edit.tsx b/website/src/pages/account/edit.tsx index d652ef8a..a14c27f8 100644 --- a/website/src/pages/account/edit.tsx +++ b/website/src/pages/account/edit.tsx @@ -1,8 +1,8 @@ -import React, { useState } from "react"; -import { useSession } from "next-auth/react"; -import { Button, Input, InputGroup, Stack } from "@chakra-ui/react"; +import { Button, Input, InputGroup } from "@chakra-ui/react"; import Head from "next/head"; import Router from "next/router"; +import { useSession } from "next-auth/react"; +import React, { useState } from "react"; export default function Account() { const { data: session } = useSession(); diff --git a/website/src/pages/account/index.tsx b/website/src/pages/account/index.tsx index 98bdc301..b5c9d906 100644 --- a/website/src/pages/account/index.tsx +++ b/website/src/pages/account/index.tsx @@ -1,8 +1,8 @@ +import { Button } from "@chakra-ui/react"; import Head from "next/head"; import Link from "next/link"; -import React, { useState } from "react"; import { useSession } from "next-auth/react"; -import { Button } from "@chakra-ui/react"; +import React, { useState } from "react"; export default function Account() { const { data: session } = useSession(); diff --git a/website/src/pages/api/auth/[...nextauth].ts b/website/src/pages/api/auth/[...nextauth].ts index e0d818c5..9bb993e5 100644 --- a/website/src/pages/api/auth/[...nextauth].ts +++ b/website/src/pages/api/auth/[...nextauth].ts @@ -1,12 +1,10 @@ -import type { AuthOptions } from "next-auth"; -import NextAuth from "next-auth"; -import { NextApiHandler } from "next"; -import DiscordProvider from "next-auth/providers/discord"; -import EmailProvider from "next-auth/providers/email"; -import CredentialsProvider from "next-auth/providers/credentials"; import { PrismaAdapter } from "@next-auth/prisma-adapter"; import { boolean } from "boolean"; - +import type { AuthOptions } from "next-auth"; +import NextAuth from "next-auth"; +import CredentialsProvider from "next-auth/providers/credentials"; +import DiscordProvider from "next-auth/providers/discord"; +import EmailProvider from "next-auth/providers/email"; import prisma from "src/lib/prismadb"; const providers = []; diff --git a/website/src/pages/api/new_task/[task_type].ts b/website/src/pages/api/new_task/[task_type].ts index 6c3eb01b..b07215cd 100644 --- a/website/src/pages/api/new_task/[task_type].ts +++ b/website/src/pages/api/new_task/[task_type].ts @@ -1,7 +1,5 @@ import { getToken } from "next-auth/jwt"; - import prisma from "src/lib/prismadb"; -import { authOptions } from "src/pages/api/auth/[...nextauth]"; /** * Returns a new task created from the Task Backend. We do a few things here: diff --git a/website/src/pages/api/update_task.ts b/website/src/pages/api/update_task.ts index 35de6542..ef0147df 100644 --- a/website/src/pages/api/update_task.ts +++ b/website/src/pages/api/update_task.ts @@ -1,7 +1,5 @@ import { getToken } from "next-auth/jwt"; - import prisma from "src/lib/prismadb"; -import { authOptions } from "src/pages/api/auth/[...nextauth]"; /** * Stores the task interaction with the Task Backend and then returns the next task generated. diff --git a/website/src/pages/api/username.tsx b/website/src/pages/api/username.tsx index a8aab7aa..36c8360e 100644 --- a/website/src/pages/api/username.tsx +++ b/website/src/pages/api/username.tsx @@ -1,6 +1,4 @@ import { getSession } from "next-auth/react"; -import { Prisma } from "@prisma/client"; -import Email from "next-auth/providers/email"; // POST /api/post // Required fields in body: title diff --git a/website/src/pages/auth/signin.tsx b/website/src/pages/auth/signin.tsx index 1f1b0323..bcb51835 100644 --- a/website/src/pages/auth/signin.tsx +++ b/website/src/pages/auth/signin.tsx @@ -1,10 +1,9 @@ import { Button, Input, Stack } from "@chakra-ui/react"; import Head from "next/head"; -import { FaDiscord, FaEnvelope, FaGithub, FaBug } from "react-icons/fa"; +import Link from "next/link"; import { getCsrfToken, getProviders, signIn } from "next-auth/react"; import React, { useRef } from "react"; -import Link from "next/link"; - +import { FaBug, FaDiscord, FaEnvelope, FaGithub } from "react-icons/fa"; import { AuthLayout } from "src/components/AuthLayout"; export default function Signin({ csrfToken, providers }) { diff --git a/website/src/pages/auth/verify.tsx b/website/src/pages/auth/verify.tsx index f22bea2d..cbf40241 100644 --- a/website/src/pages/auth/verify.tsx +++ b/website/src/pages/auth/verify.tsx @@ -1,7 +1,5 @@ import Head from "next/head"; -import { getCsrfToken, getProviders, signIn } from "next-auth/react"; -import Link from "next/link"; - +import { getCsrfToken, getProviders } from "next-auth/react"; import { AuthLayout } from "src/components/AuthLayout"; export default function Verify() { diff --git a/website/src/pages/create/assistant_reply.tsx b/website/src/pages/create/assistant_reply.tsx index ef4175db..d28a0ad0 100644 --- a/website/src/pages/create/assistant_reply.tsx +++ b/website/src/pages/create/assistant_reply.tsx @@ -1,17 +1,15 @@ import { Flex, Textarea } from "@chakra-ui/react"; import { useRef, useState } from "react"; -import useSWRMutation from "swr/mutation"; -import useSWRImmutable from "swr/immutable"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - -import { Messages } from "src/components/Messages"; -import { TwoColumns } from "src/components/TwoColumns"; -import { LoadingScreen } from "src/components/Loading/LoadingScreen"; -import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; import { SkipButton } from "src/components/Buttons/Skip"; import { SubmitButton } from "src/components/Buttons/Submit"; +import { LoadingScreen } from "src/components/Loading/LoadingScreen"; +import { Messages } from "src/components/Messages"; +import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; +import { TwoColumns } from "src/components/TwoColumns"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const AssistantReply = () => { const [tasks, setTasks] = useState([]); diff --git a/website/src/pages/create/summarize_story.tsx b/website/src/pages/create/summarize_story.tsx index 77b03d1d..8746b03e 100644 --- a/website/src/pages/create/summarize_story.tsx +++ b/website/src/pages/create/summarize_story.tsx @@ -1,17 +1,15 @@ import { Flex, Textarea } from "@chakra-ui/react"; import Head from "next/head"; import { useRef, useState } from "react"; -import useSWRImmutable from "swr/immutable"; -import useSWRMutation from "swr/mutation"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - -import { LoadingScreen } from "src/components/Loading/LoadingScreen"; -import { TwoColumns } from "src/components/TwoColumns"; -import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; import { SkipButton } from "src/components/Buttons/Skip"; import { SubmitButton } from "src/components/Buttons/Submit"; +import { LoadingScreen } from "src/components/Loading/LoadingScreen"; +import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; +import { TwoColumns } from "src/components/TwoColumns"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const SummarizeStory = () => { // Use an array of tasks that record the sequence of steps until a task is diff --git a/website/src/pages/create/user_reply.tsx b/website/src/pages/create/user_reply.tsx index 89d17e4f..36c912d5 100644 --- a/website/src/pages/create/user_reply.tsx +++ b/website/src/pages/create/user_reply.tsx @@ -1,17 +1,15 @@ import { Flex, Textarea } from "@chakra-ui/react"; import { useRef, useState } from "react"; -import useSWRMutation from "swr/mutation"; -import useSWRImmutable from "swr/immutable"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - +import { SkipButton } from "src/components/Buttons/Skip"; +import { SubmitButton } from "src/components/Buttons/Submit"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Messages } from "src/components/Messages"; import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; import { TwoColumns } from "src/components/TwoColumns"; -import { SkipButton } from "src/components/Buttons/Skip"; -import { SubmitButton } from "src/components/Buttons/Submit"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const UserReply = () => { const [tasks, setTasks] = useState([]); diff --git a/website/src/pages/evaluate/rank_assistant_replies.tsx b/website/src/pages/evaluate/rank_assistant_replies.tsx index e2b89d90..cd6d7811 100644 --- a/website/src/pages/evaluate/rank_assistant_replies.tsx +++ b/website/src/pages/evaluate/rank_assistant_replies.tsx @@ -1,17 +1,15 @@ -import { Button, Flex } from "@chakra-ui/react"; +import { Flex } from "@chakra-ui/react"; import Head from "next/head"; import { useState } from "react"; -import useSWRImmutable from "swr/immutable"; -import useSWRMutation from "swr/mutation"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - +import { SkipButton } from "src/components/Buttons/Skip"; +import { SubmitButton } from "src/components/Buttons/Submit"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Sortable } from "src/components/Sortable/Sortable"; import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; -import { SubmitButton } from "src/components/Buttons/Submit"; -import { SkipButton } from "src/components/Buttons/Skip"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const RankAssistantReplies = () => { const [tasks, setTasks] = useState([]); diff --git a/website/src/pages/evaluate/rank_initial_prompts.tsx b/website/src/pages/evaluate/rank_initial_prompts.tsx index a71b223e..4f236b50 100644 --- a/website/src/pages/evaluate/rank_initial_prompts.tsx +++ b/website/src/pages/evaluate/rank_initial_prompts.tsx @@ -1,17 +1,15 @@ import { Flex } from "@chakra-ui/react"; import Head from "next/head"; import { useState } from "react"; -import useSWRImmutable from "swr/immutable"; -import useSWRMutation from "swr/mutation"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - +import { SkipButton } from "src/components/Buttons/Skip"; +import { SubmitButton } from "src/components/Buttons/Submit"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Sortable } from "src/components/Sortable/Sortable"; import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; -import { SkipButton } from "src/components/Buttons/Skip"; -import { SubmitButton } from "src/components/Buttons/Submit"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const RankInitialPrompts = () => { const [tasks, setTasks] = useState([]); diff --git a/website/src/pages/evaluate/rank_user_replies.tsx b/website/src/pages/evaluate/rank_user_replies.tsx index 1d16b55f..b67fda10 100644 --- a/website/src/pages/evaluate/rank_user_replies.tsx +++ b/website/src/pages/evaluate/rank_user_replies.tsx @@ -1,17 +1,15 @@ +import { Flex } from "@chakra-ui/react"; import Head from "next/head"; import { useState } from "react"; -import useSWRImmutable from "swr/immutable"; -import useSWRMutation from "swr/mutation"; - -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - +import { SkipButton } from "src/components/Buttons/Skip"; +import { SubmitButton } from "src/components/Buttons/Submit"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Sortable } from "src/components/Sortable/Sortable"; import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; -import { Flex } from "@chakra-ui/react"; -import { SkipButton } from "src/components/Buttons/Skip"; -import { SubmitButton } from "src/components/Buttons/Submit"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const RankUserReplies = () => { const [tasks, setTasks] = useState([]); diff --git a/website/src/pages/evaluate/rate_summary.tsx b/website/src/pages/evaluate/rate_summary.tsx index c3d7509d..f11e19f6 100644 --- a/website/src/pages/evaluate/rate_summary.tsx +++ b/website/src/pages/evaluate/rate_summary.tsx @@ -2,18 +2,16 @@ import { Flex, Textarea } from "@chakra-ui/react"; import { QuestionMarkCircleIcon } from "@heroicons/react/20/solid"; import Head from "next/head"; import { useState } from "react"; -import useSWRImmutable from "swr/immutable"; -import useSWRMutation from "swr/mutation"; - -import RatingRadioGroup from "src/components/RatingRadioGroup"; -import fetcher from "src/lib/fetcher"; -import poster from "src/lib/poster"; - -import { LoadingScreen } from "src/components/Loading/LoadingScreen"; -import { TwoColumns } from "src/components/TwoColumns"; -import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; import { SkipButton } from "src/components/Buttons/Skip"; import { SubmitButton } from "src/components/Buttons/Submit"; +import { LoadingScreen } from "src/components/Loading/LoadingScreen"; +import RatingRadioGroup from "src/components/RatingRadioGroup"; +import { TaskInfo } from "src/components/TaskInfo/TaskInfo"; +import { TwoColumns } from "src/components/TwoColumns"; +import fetcher from "src/lib/fetcher"; +import poster from "src/lib/poster"; +import useSWRImmutable from "swr/immutable"; +import useSWRMutation from "swr/mutation"; const RateSummary = () => { // Use an array of tasks that record the sequence of steps until a task is diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 61dea8e9..722abd35 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -1,12 +1,11 @@ import Head from "next/head"; import { useSession } from "next-auth/react"; - import { CallToAction } from "src/components/CallToAction"; import { Faq } from "src/components/Faq"; +import { Footer } from "src/components/Footer"; +import { Header } from "src/components/Header"; import { Hero } from "src/components/Hero"; import { TaskSelection } from "src/components/TaskSelection"; -import { Header } from "src/components/Header"; -import { Footer } from "src/components/Footer"; const Home = () => { const { data: session } = useSession(); diff --git a/website/src/pages/leaderboard/score-leaderboard.tsx b/website/src/pages/leaderboard/score-leaderboard.tsx index 495c1c35..231c9e71 100644 --- a/website/src/pages/leaderboard/score-leaderboard.tsx +++ b/website/src/pages/leaderboard/score-leaderboard.tsx @@ -1,5 +1,5 @@ -import RankItem from "src/components/RankItem"; import { HiBarsArrowDown } from "react-icons/hi2"; +import RankItem from "src/components/RankItem"; const LeaderBoard = () => { const PlaceHolderProps = { username: "test_user", score: 10 };