From b666101821f8184f2f9bfc6c8ea08fd9211fa20d Mon Sep 17 00:00:00 2001 From: sauhardjain Date: Wed, 4 Oct 2023 22:09:57 -0700 Subject: [PATCH] chore: resolve eslint errors and run prettier --- .eslintrc.js | 16 +++++++------- src/api/supabase/auth/auth.ts | 29 ++++++++++++------------ src/api/supabase/createClient.ts | 2 +- src/app/layout.tsx | 14 ++++++------ src/app/login/page.tsx | 38 ++++++++++++++++++++++---------- 5 files changed, 57 insertions(+), 42 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9f6eb0b8..0f2c600d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,9 @@ module.exports = { - extends: ["@calblueprint/eslint-config-react", "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"], - rules: { - // Add any custom rules here - // Disable the rule that requires React to be in scope -- we don't need this with React 18 - 'react/react-in-jsx-scope': 'off', - 'react/jsx-uses-react': 'off', - }, - }; \ No newline at end of file + extends: ["@calblueprint/eslint-config-react"], + rules: { + // Add any custom rules here + // Disable the rule that requires React to be in scope -- we don't need this with React 18 + 'react/react-in-jsx-scope': 'off', + 'react/jsx-uses-react': 'off', + }, +}; \ No newline at end of file diff --git a/src/api/supabase/auth/auth.ts b/src/api/supabase/auth/auth.ts index f5e2fc88..c37b9e03 100644 --- a/src/api/supabase/auth/auth.ts +++ b/src/api/supabase/auth/auth.ts @@ -1,20 +1,21 @@ -import supabase from '@/api/supabase/createClient'; +import supabase from '../createClient'; export const handleSignUp = async (email: string, password: string) => { - const { data, error } = await supabase.auth.signUp({ - email, - password - }) - console.log(error) - } + const { data, error } = await supabase.auth.signUp({ + email, + password, + }); + console.log(error); +}; export const signInWithEmail = async (email: string, password: string) => { - const { data, error } = await supabase.auth.signInWithPassword({ - email, password, - }) - console.log(data) -} + const { data, error } = await supabase.auth.signInWithPassword({ + email, + password, + }); + console.log(data); +}; export const signOut = async () => { - const { error } = await supabase.auth.signOut() -} + const { error } = await supabase.auth.signOut(); +}; diff --git a/src/api/supabase/createClient.ts b/src/api/supabase/createClient.ts index e576c68f..53892337 100644 --- a/src/api/supabase/createClient.ts +++ b/src/api/supabase/createClient.ts @@ -17,4 +17,4 @@ const supabase = createClient( process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY, ); -export default supabase; \ No newline at end of file +export default supabase; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 80589675..8815ba1b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,22 +1,22 @@ -import './globals.css' -import type { Metadata } from 'next' -import { Inter } from 'next/font/google' +import './globals.css'; +import type { Metadata } from 'next'; +import { Inter } from 'next/font/google'; -const inter = Inter({ subsets: ['latin'] }) +const inter = Inter({ subsets: ['latin'] }); export const metadata: Metadata = { title: 'Shanti Project', description: 'Application Created by Blueprint', -} +}; export default function RootLayout({ children, }: { - children: React.ReactNode + children: React.ReactNode; }) { return ( {children} - ) + ); } diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 6b1759f3..b1613cb9 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,24 +1,38 @@ -"use client" +'use client'; import { useState } from 'react'; -import { handleSignUp, signInWithEmail, signOut } from '@/api/supabase/auth/auth' +import { + handleSignUp, + signInWithEmail, + signOut, +} from '../../api/supabase/auth/auth'; export default function Login() { - const [email, setEmail] = useState('') - const [password, setPassword] = useState('') + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); - return ( + return ( <> - setEmail(e.target.value)} value={email} /> + setEmail(e.target.value)} + value={email} + /> setPassword(e.target.value)} + onChange={e => setPassword(e.target.value)} value={password} /> - - - + + + - ) -} \ No newline at end of file + ); +}