Skip to content

Commit

Permalink
feat: migrated to biome
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatsandeepsen committed Jan 27, 2024
1 parent 7818ec4 commit d251e9f
Show file tree
Hide file tree
Showing 282 changed files with 20,603 additions and 35,921 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ AUTH_SECRET='supersecret'
# @see https://next-auth.js.org/providers/discord
AUTH_DISCORD_ID=''
AUTH_DISCORD_SECRET=''
DATABASE_URL=''
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: cp .env.example .env

- name: Lint
run: pnpm lint && pnpm lint:ws
run: pnpm lint

format:
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"expo.vscode-expo-tools",
"yoavbls.pretty-ts-errors"
"yoavbls.pretty-ts-errors",
"biomejs.biome"
]
}
}
14 changes: 5 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.organizeImports.biome": "explicit",
"source.fixAll.biome": "explicit",
"quickfix.biome": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"tailwindCSS.experimental.configFile": "./tooling/tailwind/index.ts",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
]
}
}
5 changes: 5 additions & 0 deletions apps/auth-proxy/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"../../biome.json"
]
}
20 changes: 5 additions & 15 deletions apps/auth-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,18 @@
"build": "nitro build",
"clean": "rm -rf .turbo node_modules",
"dev": "nitro dev --port 3001",
"lint": "eslint .",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "biome lint ./routes",
"format": "biome format ./routes ",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@auth/core": "^0.18.0"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@biomejs/biome": "^1.5.3",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"eslint": "^8.53.0",
"nitropack": "^2.7.2",
"prettier": "^3.1.0",
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
"extends": [
"@acme/eslint-config/base"
]
},
"prettier": "@acme/prettier-config"
}
}
}
22 changes: 11 additions & 11 deletions apps/auth-proxy/routes/[...auth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import Discord from "@auth/core/providers/discord";
import { eventHandler, toWebRequest } from "h3";

export default eventHandler(async (event) =>
Auth(toWebRequest(event), {
secret: process.env.AUTH_SECRET,
trustHost: !!process.env.VERCEL,
redirectProxyUrl: process.env.AUTH_REDIRECT_PROXY_URL,
providers: [
Discord({
clientId: process.env.AUTH_DISCORD_ID,
clientSecret: process.env.AUTH_DISCORD_SECRET,
}),
],
}),
Auth(toWebRequest(event), {
secret: process.env.AUTH_SECRET,
trustHost: !!process.env.VERCEL,
redirectProxyUrl: process.env.AUTH_REDIRECT_PROXY_URL,
providers: [
Discord({
clientId: process.env.AUTH_DISCORD_ID,
clientSecret: process.env.AUTH_DISCORD_SECRET,
}),
],
}),
);
5 changes: 5 additions & 0 deletions apps/native/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"../../biome.json"
]
}
22 changes: 4 additions & 18 deletions apps/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"dev": "expo start --go",
"dev:android": "expo start --android",
"dev:ios": "expo start --ios",
"lint": "eslint .",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "biome lint ./src",
"format": "biome format ./src ",
"typecheck": "tsc --noEmit",
"android": "expo run:android",
"ios": "expo run:ios"
Expand Down Expand Up @@ -41,9 +41,8 @@
"tailwind-merge": "^2.2.1"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@acme/api": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@babel/core": "^7.23.2",
Expand All @@ -52,20 +51,7 @@
"@expo/config-plugins": "^7.2.5",
"@types/babel__core": "^7.20.4",
"@types/react": "^18.2.37",
"eslint": "^8.53.0",
"prettier": "^3.1.0",
"tailwindcss": "3.3.5",
"typescript": "^5.2.2"
},
"eslintConfig": {
"root": true,
"extends": [
"@acme/eslint-config/base",
"@acme/eslint-config/react"
],
"ignorePatterns": [
"expo-plugins/**"
]
},
"prettier": "@acme/prettier-config"
}
}
10 changes: 5 additions & 5 deletions apps/native/src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { TRPCProvider } from "~/utils/api";
import "../styles.css";

const RootLayout = () => {
return (
<TRPCProvider>
<Stack />
</TRPCProvider>
);
return (
<TRPCProvider>
<Stack />
</TRPCProvider>
);
};

export default RootLayout;
29 changes: 11 additions & 18 deletions apps/native/src/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,18 @@ import { SafeAreaView } from "react-native-safe-area-context";
import { Button } from "~/components/ui/button";
import { Card } from "~/components/ui/card";


const Index = () => {

return (
<SafeAreaView className="bg-[#1F104A]">
<View className="h-full w-full p-4">


<View className="py-2">
<Card className="p-10">
<Button variant={"destructive"}>
hi
</Button>
</Card>
</View>

</View>
</SafeAreaView>
);
return (
<SafeAreaView className="bg-[#1F104A]">
<View className="h-full w-full p-4">
<View className="py-2">
<Card className="p-10">
<Button variant={"destructive"}>hi</Button>
</Card>
</View>
</View>
</SafeAreaView>
);
};

export default Index;
26 changes: 13 additions & 13 deletions apps/native/src/app/post/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { Stack, useGlobalSearchParams } from "expo-router";
import { api } from "~/utils/api";

export default function Post() {
const { id } = useGlobalSearchParams();
if (!id || typeof id !== "string") throw new Error("unreachable");
const { data } = api.post.byId.useQuery({ id: parseInt(id) });
const { id } = useGlobalSearchParams();
if (!id || typeof id !== "string") throw new Error("unreachable");
const { data } = api.post.byId.useQuery({ id: parseInt(id) });

if (!data) return null;
if (!data) return null;

return (
<SafeAreaView className="bg-[#1F104A]">
<Stack.Screen options={{ title: data.title }} />
<View className="h-full w-full p-4">
<Text className="py-2 text-3xl font-bold text-white">{data.title}</Text>
<Text className="py-4 text-white">{data.content}</Text>
</View>
</SafeAreaView>
);
return (
<SafeAreaView className="bg-[#1F104A]">
<Stack.Screen options={{ title: data.title }} />
<View className="h-full w-full p-4">
<Text className="py-2 text-3xl font-bold text-white">{data.title}</Text>
<Text className="py-4 text-white">{data.content}</Text>
</View>
</SafeAreaView>
);
}
54 changes: 27 additions & 27 deletions apps/native/src/components/DrawerToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { DrawerNavigationProp } from '@react-navigation/drawer';
import { useNavigation } from 'expo-router';
import { AlignJustify } from 'lucide-react-native';
import { Pressable, View } from 'react-native';
import { cn } from '~/lib/utils';
import { DrawerNavigationProp } from "@react-navigation/drawer";
import { useNavigation } from "expo-router";
import { AlignJustify } from "lucide-react-native";
import { Pressable, View } from "react-native";
import { cn } from "~/lib/utils";

export function DrawerToggle() {
const navigation = useNavigation<DrawerNavigationProp<{}>>();
const navigation = useNavigation<DrawerNavigationProp<{}>>();

return (
<Pressable
onPress={navigation.toggleDrawer}
className='ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50'
>
{({ pressed }) => (
<View
className={cn(
'flex-1 aspect-square justify-center items-end pt-0.5 web:pl-4',
pressed && 'opacity-70'
)}
>
<AlignJustify
className='text-foreground'
size={24}
strokeWidth={1.25}
/>
</View>
)}
</Pressable>
);
return (
<Pressable
onPress={navigation.toggleDrawer}
className="ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
>
{({ pressed }) => (
<View
className={cn(
"flex-1 aspect-square justify-center items-end pt-0.5 web:pl-4",
pressed && "opacity-70",
)}
>
<AlignJustify
className="text-foreground"
size={24}
strokeWidth={1.25}
/>
</View>
)}
</Pressable>
);
}
Loading

0 comments on commit d251e9f

Please sign in to comment.