From a8a0e5453881c615b24201f13c97a51e7b3b2f15 Mon Sep 17 00:00:00 2001 From: Juan Andrade Date: Sun, 1 Oct 2023 03:14:50 -0300 Subject: [PATCH] Added linting to import/export --- .eslintrc.json | 10 +- app/[locale]/Providers.tsx | 4 +- app/[locale]/[id]/page.tsx | 7 +- app/[locale]/layout.tsx | 6 +- app/[locale]/page.tsx | 9 +- assets/index.tsx | 2 +- components/CreateHighline.tsx | 19 +- components/Footer.tsx | 2 +- components/Highline.tsx | 5 +- components/RegistryEntry.tsx | 14 +- components/animations/SuccessAnimation.tsx | 2 +- components/layout/navbar/LocaleSwitcher.tsx | 11 +- components/layout/navbar/ThemeToggler.tsx | 2 +- components/tabs/Comments.tsx | 3 +- components/tabs/Ranking/Cadenas.tsx | 7 +- components/tabs/Ranking/CategoryDropdown.tsx | 5 +- components/tabs/Ranking/Distance.tsx | 7 +- components/tabs/Ranking/FullLine.tsx | 7 +- components/tabs/Ranking/Speedline.tsx | 9 +- components/tabs/Ranking/index.tsx | 6 +- components/tabs/Tabs.tsx | 7 +- components/ui/Dialog.tsx | 2 +- components/ui/Dropzone.tsx | 5 +- components/ui/NumberPicker.tsx | 4 +- components/ui/Select.tsx | 4 +- package.json | 2 + yarn.lock | 194 ++++++++++++++++++- 27 files changed, 280 insertions(+), 75 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..51978af 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,11 @@ { - "extends": "next/core-web-vitals" + "extends": "next/core-web-vitals", + "plugins": ["simple-import-sort", "import"], + "rules": { + "simple-import-sort/imports": "warn", + "simple-import-sort/exports": "warn", + "import/first": "error", + "import/newline-after-import": "warn", + "import/no-duplicates": "error" + } } diff --git a/app/[locale]/Providers.tsx b/app/[locale]/Providers.tsx index c6a6e79..269109e 100644 --- a/app/[locale]/Providers.tsx +++ b/app/[locale]/Providers.tsx @@ -1,8 +1,8 @@ "use client"; -import type { ReactNode } from "react"; -import { ThemeProvider } from "next-themes"; import { type AbstractIntlMessages, NextIntlClientProvider } from "next-intl"; +import { ThemeProvider } from "next-themes"; +import type { ReactNode } from "react"; import { ReactQueryProvider } from "@/components/ReactQueryProvider"; diff --git a/app/[locale]/[id]/page.tsx b/app/[locale]/[id]/page.tsx index 2897588..4a7f9f4 100644 --- a/app/[locale]/[id]/page.tsx +++ b/app/[locale]/[id]/page.tsx @@ -1,7 +1,8 @@ -import supabase from "@/utils/supabase"; -import Tabs from "@/components/tabs/Tabs"; -import RegistryEntry from "@/components/RegistryEntry"; import HighlineImage from "@/components/HighlineImage"; +import RegistryEntry from "@/components/RegistryEntry"; +import Tabs from "@/components/tabs/Tabs"; +import supabase from "@/utils/supabase"; + import GoBack from "./_components/GoBack"; export async function generateStaticParams() { diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index d6d949d..07613d4 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -1,12 +1,14 @@ import "./globals.css"; -import { Inter } from "next/font/google"; + import { Analytics } from "@vercel/analytics/react"; +import { Inter } from "next/font/google"; import { notFound } from "next/navigation"; -import Providers from "./Providers"; import Footer from "@/components/Footer"; import NavBar from "@/components/layout/navbar"; +import Providers from "./Providers"; + const inter = Inter({ subsets: ["latin"] }); export const metadata = { diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index d66a9d6..f1ca986 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,11 +1,12 @@ "use client"; -import { useState, useEffect } from "react"; -import supabase, { type Tables } from "@/utils/supabase"; -import Highline from "@/components/Highline"; +import { useTranslations } from "next-intl"; +import { useEffect, useState } from "react"; + import { SearchSvg } from "@/assets"; import CreateHighline from "@/components/CreateHighline"; -import { useTranslations } from "next-intl"; +import Highline from "@/components/Highline"; +import supabase, { type Tables } from "@/utils/supabase"; export default function Home() { const [highlines, setHighlines] = useState([]); diff --git a/assets/index.tsx b/assets/index.tsx index bece926..530d14f 100644 --- a/assets/index.tsx +++ b/assets/index.tsx @@ -1,5 +1,5 @@ -import { SVGAttributes } from "react"; import { motion } from "framer-motion"; +import { SVGAttributes } from "react"; export const PlusSvg = (props: SVGAttributes) => (