Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build-and-test:
name: Build, Lint, and Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

# Cache Bun dependencies
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

# Cache Next.js build
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: |
frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('frontend/src/**/*.[jt]s', 'frontend/src/**/*.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Lint (ESLint 9)
run: bun run lint

- name: Type Check (TypeScript)
run: bun run type-check

- name: Run Tests
run: bun run test

- name: Build Project
run: bun run build
13 changes: 0 additions & 13 deletions frontend/.eslintrc.json

This file was deleted.

269 changes: 14 additions & 255 deletions frontend/bun.lock

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import js from "@eslint/js";
import path from "path";
import { fileURLToPath } from "url";
import tseslint from "typescript-eslint";
import nextPlugin from "@next/eslint-plugin-next";
import reactPlugin from "eslint-plugin-react";
import globals from "globals";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

export default tseslint.config(
{
ignores: [
"**/node_modules/**",
"**/.next/**",
"**/out/**",
"**/build/**",
"eslint.config.mjs",
],
},
js.configs.recommended,
...tseslint.configs.recommended,
// Use compat for react-hooks to ensure legacy plugin structure is handled correctly
...compat.plugins("eslint-plugin-react-hooks"),
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
plugins: {
"@next/next": nextPlugin,
react: reactPlugin,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
...reactPlugin.configs.recommended.rules,
// Enable hooks rules manually since we loaded the plugin via compat
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",

// Essential Next.js Rules (Manual)
"@next/next/no-html-link-for-pages": "error",
"@next/next/no-img-element": "error",
"@next/next/no-sync-scripts": "error",

// Custom & Relaxed Rules
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-require-imports": "warn",
"react/no-unknown-property": "warn",
},
},
);
12 changes: 7 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "bun --bun next dev --turbo",
"build": "bun --bun next build",
"start": "bun --bun next start",
"lint": "tsc --noEmit",
"lint": "eslint .",
"type-check": "tsc --noEmit",
"test": "bun test",
"test:watch": "bun test --watch",
"test:coverage": "bun test --coverage"
Expand Down Expand Up @@ -35,13 +36,14 @@
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0",
"autoprefixer": "^10.4.23",
"globals": "^16.5.0",
"typescript-eslint": "^8.50.0",
"@eslint/js": "^9.39.2",
"@next/eslint-plugin-next": "^16.0.10",
"eslint": "^9.39.2",
"eslint-config-next": "^16.0.10",
"eslint-plugin-react": "^7.37.5",
"postcss": "^8.5.6",
"tailwindcss": "3.4.17",
"tailwindcss": "^3.4.19",
"typescript": "^5.9.3"
}
}
Loading
Loading