Skip to content

Commit

Permalink
chore: update and fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocroh committed Feb 2, 2025
1 parent 7792dbb commit 62c166e
Show file tree
Hide file tree
Showing 13 changed files with 2,221 additions and 2,375 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm run build
turbo run build
5 changes: 5 additions & 0 deletions apps/client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
extends: 'expo',
ignorePatterns: ['/dist/*'],
};
2 changes: 2 additions & 0 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"@types/jest": "^29.5.12",
"@types/react": "~18.3.12",
"@types/react-test-renderer": "^18.3.0",
"eslint": "^8.57.0",
"eslint-config-expo": "~8.0.1",
"jest": "^29.2.1",
"jest-expo": "~52.0.3",
"react-test-renderer": "18.3.1",
Expand Down
10 changes: 8 additions & 2 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ import {
ArrowRight,
Dumbbell,
Heart,
LucideIcon,
MessageCircle,
PiggyBank,
} from 'lucide-react'
import { Button } from '@/components/ui/button'
import { InfoCard } from './components/info-card'

const infoCardContent = [
type InfoCard = {
icon: LucideIcon
content: string
}

const infoCardContent: InfoCard[] = [
{
icon: MessageCircle,
content:
Expand Down Expand Up @@ -86,7 +92,7 @@ export default function Page(): JSX.Element {
}}
/>
<div className="mt-10 flex w-full flex-col flex-wrap items-center justify-center gap-10 md:flex-row">
{infoCardContent.map((card, i) => (
{infoCardContent.map((card: InfoCard, i: number) => (
<InfoCard icon={card.icon} content={card.content} key={i} />
))}
</div>
Expand Down
7 changes: 1 addition & 6 deletions apps/web/app/room/[slug]/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import { MessageCircle } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { ScrollArea } from '@/components/ui/scroll-area'
import { MessageItem } from './message-item'

export type Message = {
sender: 'me' | 'other'
content: string
}
import { Message, MessageItem } from './message-item'

type Chat = {
messages: Message[]
Expand Down
10 changes: 7 additions & 3 deletions apps/web/app/room/[slug]/components/message-item.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import clsx from 'clsx'
import { Message } from './chat'

type MessageItem = {
export type Message = {
sender: 'me' | 'other'
content: string
}

type MessageItemProps = {
message: Message
}

export const MessageItem: React.FC<MessageItem> = ({ message }) => {
export const MessageItem = ({ message }: MessageItemProps) => {
const isMe = message.sender === 'me'

return (
Expand Down
14 changes: 9 additions & 5 deletions apps/web/app/room/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import useWebSocket from 'react-use-websocket'
import { usePathname } from 'next/navigation'
import { clsx } from 'clsx'
import Peer from 'simple-peer'
import { Chat, Message } from '@/app/room/[slug]/components/chat'
import { Chat } from '@/app/room/[slug]/components/chat'
import Countdown from '@/components/countdown'
import { Button } from '@/components/ui/button'
import { Card, CardContent } from '@/components/ui/card'
import { VideoPlayer } from '@/components/video-player'
import { useUserMedia } from '@/hooks/useUserMedia'
import { env } from '@repo/env-config'
import { Message } from './components/message-item'

export default function Page(): JSX.Element {
const peerRef: MutableRefObject<Peer.Instance | null> = useRef(null)
Expand Down Expand Up @@ -178,14 +179,17 @@ export default function Page(): JSX.Element {
type: 'audio' | 'video'
) => {
const result = await switchInput(deviceId, type)
if (!result) {
return
}
peerRef.current?.replaceTrack(
result?.oldVideoTrack!,
result?.newVideoTrack!,
result.oldVideoTrack,
result.newVideoTrack,
stream!
)
peerRef.current?.replaceTrack(
result?.oldAudioTrack!,
result?.newAudioTrack!,
result.oldAudioTrack,
result.newAudioTrack,
stream!
)
}
Expand Down
4 changes: 0 additions & 4 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
const nextConfig = {
transpilePackages: ['@repo/ui'],
reactStrictMode: false,
eslint: {
ignoreDuringBuilds: false,
dirs: ['pages', 'components', 'lib', 'src'], // Specify directories to lint
},
}

export default nextConfig
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"dotenv-cli": "^7.4.2",
"eslint": "^9.19.0",
"postcss": "^8.4.38",
"socket.io-client": "^4.7.5",
"tailwindcss": "^3.4.3",
Expand Down
16 changes: 8 additions & 8 deletions packages/eslint-config/base.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import eslintConfigPrettier from 'eslint-config-prettier'
import onlyWarn from 'eslint-plugin-only-warn'
import turboPlugin from 'eslint-plugin-turbo'
import tseslint from 'typescript-eslint'
import js from '@eslint/js'
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import turboPlugin from "eslint-plugin-turbo";
import tseslint from "typescript-eslint";
import onlyWarn from "eslint-plugin-only-warn";

/**
* A shared ESLint configuration for the repository.
Expand All @@ -18,7 +18,7 @@ export const config = [
turbo: turboPlugin,
},
rules: {
'turbo/no-undeclared-env-vars': 'warn',
"turbo/no-undeclared-env-vars": "warn",
},
},
{
Expand All @@ -27,6 +27,6 @@ export const config = [
},
},
{
ignores: ['dist/**'],
ignores: ["dist/**"],
},
]
];
28 changes: 14 additions & 14 deletions packages/eslint-config/next.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import eslintConfigPrettier from 'eslint-config-prettier'
import pluginReact from 'eslint-plugin-react'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import js from '@eslint/js'
import pluginNext from '@next/eslint-plugin-next'
import { config as baseConfig } from './base.js'
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginReact from "eslint-plugin-react";
import globals from "globals";
import pluginNext from "@next/eslint-plugin-next";
import { config as baseConfig } from "./base.js";

/**
* A custom ESLint configuration for libraries that use Next.js.
Expand All @@ -28,22 +28,22 @@ export const nextJsConfig = [
},
{
plugins: {
'@next/next': pluginNext,
"@next/next": pluginNext,
},
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
...pluginNext.configs["core-web-vitals"].rules,
},
},
{
plugins: {
'react-hooks': pluginReactHooks,
"react-hooks": pluginReactHooks,
},
settings: { react: { version: 'detect' } },
settings: { react: { version: "detect" } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
'react/react-in-jsx-scope': 'off',
"react/react-in-jsx-scope": "off",
},
},
]
];
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import eslintConfigPrettier from 'eslint-config-prettier'
import pluginReact from 'eslint-plugin-react'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import js from '@eslint/js'
import { config as baseConfig } from './base.js'
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import pluginReactHooks from "eslint-plugin-react-hooks";
import pluginReact from "eslint-plugin-react";
import globals from "globals";
import { config as baseConfig } from "./base.js";

/**
* A custom ESLint configuration for libraries that use React.
Expand All @@ -27,13 +27,13 @@ export const config = [
},
{
plugins: {
'react-hooks': pluginReactHooks,
"react-hooks": pluginReactHooks,
},
settings: { react: { version: 'detect' } },
settings: { react: { version: "detect" } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
'react/react-in-jsx-scope': 'off',
"react/react-in-jsx-scope": "off",
},
},
]
];
Loading

0 comments on commit 62c166e

Please sign in to comment.