Skip to content

Commit

Permalink
Fixed lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Miller committed Nov 8, 2023
1 parent 49c8303 commit 214127a
Show file tree
Hide file tree
Showing 53 changed files with 124 additions and 127 deletions.
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@tsndr/cloudflare-worker-jwt": "^2.2.5",
"app": "*",
"million": "2.6.4",
"pattycake": "^0.0.2",
"next": "14.0.1",
"next-superjson-plugin": "^0.5.9",
"pattycake": "^0.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "^0.72.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Anchor, Button, H1, Paragraph, XStack, YStack } from '@t4/ui'
import { RotateCw } from '@tamagui/lucide-icons'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { SolitoImage } from 'solito/image'
import { RotateCw } from '@tamagui/lucide-icons'

const customerCareEmail = process.env.NEXT_PUBLIC_CUSTOMER_CARE_EMAIL

Expand All @@ -20,7 +20,7 @@ export default function Page() {
<Paragraph maxWidth={500}>
Your changes were saved, but we could not load the page you requested because it was not
found on our server. Please try connecting again. If the issue keeps happening,{' '}
<Anchor href={'mailto:' + customerCareEmail} target='_blank' rel='noreferrer'>
<Anchor href={`mailto:${customerCareEmail}`} target='_blank' rel='noreferrer'>
contact Customer Care
</Anchor>
.
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/500.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Anchor, Button, H1, Paragraph, XStack, YStack } from '@t4/ui'
import { RotateCw } from '@tamagui/lucide-icons'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { SolitoImage } from 'solito/image'
import { RotateCw } from '@tamagui/lucide-icons'

const customerCareEmail = process.env.NEXT_PUBLIC_CUSTOMER_CARE_EMAIL

Expand All @@ -20,7 +20,7 @@ export default function Page() {
<Paragraph maxWidth={500}>
Your changes were saved, but we could not connect to the server due to a technical issue
on our end. Please try connecting again. If the issue keeps happening,{' '}
<Anchor href={'mailto:' + customerCareEmail} target='_blank' rel='noreferrer'>
<Anchor href={`mailto:${customerCareEmail}`} target='_blank' rel='noreferrer'>
contact Customer Care
</Anchor>
.
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
if (typeof requestAnimationFrame === 'undefined') {
globalThis['requestAnimationFrame'] = setImmediate
globalThis.requestAnimationFrame = setImmediate
}
import '@tamagui/core/reset.css'
import '@tamagui/font-inter/css/400.css'
import '@tamagui/font-inter/css/700.css'

import type { Session } from '@supabase/supabase-js'
import { Provider } from 'app/provider'
import { trpc } from 'app/utils/trpc/index.web'
import Head from 'next/head'
import type { SolitoAppProps } from 'solito'
import type { Session } from '@supabase/supabase-js'

if (process.env.NODE_ENV === 'production') {
require('../public/tamagui.css')
Expand Down
4 changes: 2 additions & 2 deletions apps/next/pages/_offline.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Anchor, Button, H1, Paragraph, XStack, YStack } from '@t4/ui'
import { RotateCw } from '@tamagui/lucide-icons'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { SolitoImage } from 'solito/image'
import { RotateCw } from '@tamagui/lucide-icons'

const customerCareEmail = process.env.NEXT_PUBLIC_CUSTOMER_CARE_EMAIL

Expand All @@ -20,7 +20,7 @@ export default function Page() {
<Paragraph maxWidth={500}>
Your changes were saved, but we could not connect to the server because you are offline.
Please try connecting again. If the issue keeps happening,{' '}
<Anchor href={'mailto:' + customerCareEmail} target='_blank' rel='noreferrer'>
<Anchor href={`mailto:${customerCareEmail}`} target='_blank' rel='noreferrer'>
contact Customer Care
</Anchor>
.
Expand Down
2 changes: 1 addition & 1 deletion apps/next/pages/password-reset/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head'
import { PasswordResetScreen } from 'app/features/password-reset/screen'
import Head from 'next/head'

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/next/pages/password-reset/update-password/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head'
import { UpdatePasswordScreen } from 'app/features/password-reset/update-password/screen'
import Head from 'next/head'

export default function Page() {
return (
Expand Down
3 changes: 0 additions & 3 deletions apps/next/tamagui.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// don't import from here, that's handled already
// instead this is just setting types for this folder

import { config } from '@t4/ui'

type Conf = typeof config
Expand Down
4 changes: 2 additions & 2 deletions apps/next/utils/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import jwt from '@tsndr/cloudflare-worker-jwt'
import type { GetServerSidePropsContext } from 'next/types'
import { Session, createPagesServerClient } from '@supabase/auth-helpers-nextjs'
import jwt from '@tsndr/cloudflare-worker-jwt'
import { secureCookieOptions } from 'app/utils/supabase/cookies'
import type { GetServerSidePropsContext } from 'next/types'

export const verifyToken = async (token: string): Promise<boolean> => {
try {
Expand Down
9 changes: 8 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
},
"files": {
"ignoreUnknown": true,
"ignore": ["**/node_modules/**", "**/dist/**", "**/build/**", "**/ios/**", "**/.git/**", "**/.vscode/**", "**/.android/**", "**/.DS_Store/**", "**/Thumbs.db/**", "**/.tamagui*", "**/.next*"]
"ignore": ["**/.wrangler/**", "**/tamagui.css", "**/workbox*.js", "**/service-worker.js", "**/fallback*.js", "**/node_modules/**", "**/dist/**", "**/build/**", "**/ios/**", "**/.git/**", "**/.vscode/**", "**/.android/**", "**/.DS_Store/**", "**/Thumbs.db/**", "**/.tamagui*", "**/.next*"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"useTemplate": "warn"
},
"suspicious": {
"noEmptyInterface": "off",
"noExplicitAny": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"check-deps": "check-dependency-version-consistency .",
"check-types": "tsc --noEmit",
"format": "bunx @biomejs/biome format --write ./packages ./apps",
"fix": "manypkg fix",
"lint": "bunx @biomejs/biome lint ./packages ./apps",
"fix": "bunx @biomejs/biome check --apply-unsafe ./packages ./apps",
"deps:fix": "manypkg fix",
"postinstall": "bun run build && bun ./.github/scripts/env.ts && bun check-deps && bun format",
"clean": "git clean -xdf node_modules && rm bun.lockb",
"clean:all": "npm-run-all clean"
Expand All @@ -38,6 +40,7 @@
],
"dependencies": {
"@babel/runtime": "^7.23.2",
"@biomejs/biome": "1.3.3",
"@manypkg/cli": "^0.21.0",
"@nderscore/tamagui-typescript-plugin": "^0.6.0",
"@supabase/supabase-js": "^2.38.4",
Expand All @@ -46,8 +49,5 @@
"react-native-url-polyfill": "^2.0.0",
"typescript": "^5.2.2",
"workerd": "1.20231030.0"
},
"devDependencies": {
"@biomejs/biome": "1.3.3"
}
}
4 changes: 2 additions & 2 deletions packages/api/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'
import type { Config } from 'drizzle-kit'
dotenv.config({ path: './.dev.vars' })

const DATABASE_ID = process.env.DATABASE_ID
Expand All @@ -10,7 +10,7 @@ if (DATABASE_ID === undefined) {
export default {
driver: 'better-sqlite',
dbCredentials: {
url: './.wrangler/state/v3/d1/' + DATABASE_ID + '/db.sqlite',
url: `./.wrangler/state/v3/d1/${DATABASE_ID}/db.sqlite`,
},
schema: './src/db/schema.ts',
out: './migrations',
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type inferAsyncReturnType } from '@trpc/server'
import { type FetchCreateContextFnOptions } from '@trpc/server/adapters/fetch'
import jwt from '@tsndr/cloudflare-worker-jwt'
import { DrizzleD1Database } from 'drizzle-orm/d1'
import { createDb } from './db/client'
import jwt from '@tsndr/cloudflare-worker-jwt'

interface User {
id: string
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/db/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InferSelectModel, InferInsertModel } from 'drizzle-orm'
import { sqliteTable, text, integer, real } from 'drizzle-orm/sqlite-core'
import { InferInsertModel, InferSelectModel } from 'drizzle-orm'
import { integer, real, sqliteTable, text } from 'drizzle-orm/sqlite-core'
import { createInsertSchema } from 'drizzle-valibot'

// User
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/db/studio.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as schema from './schema'
import studio, { Setup } from '@drizzle-team/studio'
import { drizzle } from 'drizzle-orm/bun-sqlite'
import { Database } from 'bun:sqlite'
import { readdir } from 'node:fs/promises'
import { join } from 'node:path'
import studio, { Setup } from '@drizzle-team/studio'
import { drizzle } from 'drizzle-orm/bun-sqlite'
import * as schema from './schema'

async function getSqliteFile() {
try {
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { router } from './trpc'
import { helloRouter } from './routes/hello'
import { authRouter } from './routes/auth'
import { userRouter } from './routes/user'
import { carsRouter } from './routes/cars'
import { helloRouter } from './routes/hello'
import { userRouter } from './routes/user'
import { router } from './trpc'

export const appRouter = router({
hello: helloRouter,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routes/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { router, protectedProcedure, publicProcedure } from '../trpc'
import { protectedProcedure, publicProcedure, router } from '../trpc'

export const authRouter = router({
getSession: publicProcedure.query(({ ctx }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routes/cars.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CarTable } from '../db/schema'
import { router, publicProcedure } from '../trpc'
import { publicProcedure, router } from '../trpc'

export const carsRouter = router({
all: publicProcedure.query(async ({ ctx }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routes/hello.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parse, string } from 'valibot'
import { router, publicProcedure } from '../trpc'
import { publicProcedure, router } from '../trpc'

export const helloRouter = router({
world: publicProcedure
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/routes/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { eq } from 'drizzle-orm'
import { UserTable, UserSchema, type User } from '../db/schema'
import { router, protectedProcedure } from '../trpc'
import { parse } from 'valibot'
import { type User, UserSchema, UserTable } from '../db/schema'
import { protectedProcedure, router } from '../trpc'

export const userRouter = router({
current: protectedProcedure.query(async ({ ctx }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initTRPC, TRPCError } from '@trpc/server'
import { type Context } from './context'
import { TRPCError, initTRPC } from '@trpc/server'
import superJson from 'superjson'
import { type Context } from './context'

const t = initTRPC.context<Context>().create({
transformer: superJson,
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Hono } from 'hono'
import { trpcServer } from '@hono/trpc-server'
import { createContext } from '@t4/api/src/context'
import { appRouter } from '@t4/api/src/router'
import { Hono } from 'hono'
import { cors } from 'hono/cors'
import { createContext } from '@t4/api/src/context'
import { trpcServer } from '@hono/trpc-server'

type Bindings = {
DB: D1Database
Expand Down
2 changes: 1 addition & 1 deletion packages/app/features/data-fetching/screen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { H1, H2, Paragraph, YStack } from '@t4/ui'
import React from 'react'
import { trpc } from 'app/utils/trpc'
import React from 'react'
import { match } from 'ts-pattern'
import { error, loading, success } from '../../utils/trpc/patterns'

Expand Down
10 changes: 5 additions & 5 deletions packages/app/features/home/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import {
YStack,
useToastController,
} from '@t4/ui'
import { ThemeToggle } from '@t4/ui/src/ThemeToggle'
import { ChevronDown } from '@tamagui/lucide-icons'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { useUser } from 'app/utils/supabase/hooks/useUser'
import { trpc } from 'app/utils/trpc'
import React, { useState } from 'react'
import { Linking } from 'react-native'
import { SolitoImage } from 'solito/image'
import { useLink } from 'solito/link'
import { useSheetOpen } from '../../atoms/sheet'
import { SolitoImage } from 'solito/image'
import { trpc } from 'app/utils/trpc'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { useUser } from 'app/utils/supabase/hooks/useUser'
import { ThemeToggle } from '@t4/ui/src/ThemeToggle'

export function HomeScreen() {
const utils = trpc.useContext()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/features/password-reset/screen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { YStack, useToastController } from '@t4/ui'
import { useRouter } from 'solito/router'
import { PasswordResetComponent } from '@t4/ui/src/PasswordReset'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { useRouter } from 'solito/router'

export function PasswordResetScreen() {
const { push } = useRouter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { YStack, useToastController } from '@t4/ui'
import { useRouter } from 'solito/router'
import { PasswordResetComponent } from '@t4/ui/src/PasswordReset'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import { useRouter } from 'solito/router'

export function UpdatePasswordScreen() {
const { push } = useRouter()
Expand Down
6 changes: 3 additions & 3 deletions packages/app/features/sign-in/SignUpSignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from 'react'
import { YStack, Paragraph, XStack, Button, Input, Stack } from '@t4/ui'
import { Link } from 'solito/link'
import { type Provider } from '@supabase/supabase-js'
import { Button, Input, Paragraph, Stack, XStack, YStack } from '@t4/ui'
import { useState } from 'react'
import { SolitoImage } from 'solito/image'
import { Link } from 'solito/link'

interface Props {
type: 'sign-up' | 'sign-in'
Expand Down
14 changes: 7 additions & 7 deletions packages/app/features/sign-in/screen.native.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Provider } from '@supabase/supabase-js'
import { YStack, useToastController } from '@t4/ui'
import { capitalizeWord } from '@t4/ui/src/libs/string'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import { useRouter } from 'solito/router'
import type { Provider } from '@supabase/supabase-js'
import { initiateAppleSignIn } from 'app/utils/supabase/appleAuth'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
import * as WebBrowser from 'expo-web-browser'
import { getInitialURL } from 'expo-linking'
import * as WebBrowser from 'expo-web-browser'
import { Platform } from 'react-native'
import { initiateAppleSignIn } from 'app/utils/supabase/appleAuth'
import { capitalizeWord } from '@t4/ui/src/libs/string'
import { useRouter } from 'solito/router'

export const SignInScreen = (): React.ReactNode => {
const { replace } = useRouter()
Expand Down Expand Up @@ -65,15 +65,15 @@ export const SignInScreen = (): React.ReactNode => {
supabase.auth._notifyAllSubscribers('SIGNED_IN', session)
replace('/')
} else {
toast.show(capitalizeWord(provider) + ' sign in failed', {
toast.show(`${capitalizeWord(provider)} sign in failed`, {
description: error?.message || 'Something went wrong, please try again.',
})
console.log('Supabase session error:', error)
}
})
}
} catch (error) {
toast.show(capitalizeWord(provider) + ' sign in failed', {
toast.show(`${capitalizeWord(provider)} sign in failed`, {
description: 'Something went wrong, please try again.',
})
} finally {
Expand Down
Loading

1 comment on commit 214127a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ EAS production build completed

  • 🤖 Android build failed ❌
  • 🍏 IOS build failed ❌
Android QR IOS QR

Please sign in to comment.