Skip to content

Commit 3e16a0f

Browse files
ran formatter
1 parent 8cae4fd commit 3e16a0f

File tree

14 files changed

+131
-169
lines changed

14 files changed

+131
-169
lines changed

.github/workflows/format.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Auto Format Code
2+
3+
on:
4+
push:
5+
branches: [ main, develop, feature/*, bugfix/* ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
format:
11+
name: Format Code
12+
runs-on: ubuntu-latest
13+
if: github.event_name == 'push'
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '18'
25+
cache: 'npm'
26+
cache-dependency-path: |
27+
frontend/package-lock.json
28+
backend/package-lock.json
29+
30+
# Format frontend
31+
- name: Install frontend dependencies
32+
working-directory: ./frontend
33+
run: npm ci
34+
35+
- name: Format frontend code
36+
working-directory: ./frontend
37+
run: npm run format
38+
39+
# Format backend
40+
- name: Install backend dependencies
41+
working-directory: ./backend
42+
run: npm ci
43+
44+
- name: Format backend code
45+
working-directory: ./backend
46+
run: npm run format
47+
48+
# Commit formatted code
49+
- name: Commit formatted code
50+
run: |
51+
git config --local user.email "action@github.com"
52+
git config --local user.name "GitHub Action"
53+
git add .
54+
git diff --staged --quiet || git commit -m "🎨 Auto-format code with Prettier"
55+
git push
56+
57+
check-format:
58+
name: Check Formatting
59+
runs-on: ubuntu-latest
60+
if: github.event_name == 'pull_request'
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: '18'
70+
cache: 'npm'
71+
cache-dependency-path: |
72+
frontend/package-lock.json
73+
backend/package-lock.json
74+
75+
# Check frontend formatting
76+
- name: Install frontend dependencies
77+
working-directory: ./frontend
78+
run: npm ci
79+
80+
- name: Check frontend formatting
81+
working-directory: ./frontend
82+
run: npm run format:check
83+
84+
# Check backend formatting
85+
- name: Install backend dependencies
86+
working-directory: ./backend
87+
run: npm ci
88+
89+
- name: Check backend formatting
90+
working-directory: ./backend
91+
run: npm run format:check

backend/eslint.config.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

backend/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
"build": "tsc",
99
"start": "node dist/server.js",
1010
"test": "jest",
11-
"lint": "eslint . --ext .ts,.tsx",
12-
"lint:fix": "eslint . --ext .ts,.tsx --fix",
1311
"format": "prettier --write \"**/*.{ts,tsx,js,json,md}\"",
14-
"format:check": "prettier --check \"**/*.{ts,tsx,js,json,md}\"",
15-
"type-check": "tsc --noEmit"
12+
"format:check": "prettier --check \"**/*.{ts,tsx,js,json,md}\""
1613
},
1714
"dependencies": {
1815
"@prisma/client": "^6.16.2",

frontend/.eslintrc.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

frontend/eslint.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import js from '@eslint/js'
2-
import globals from 'globals'
3-
import reactHooks from 'eslint-plugin-react-hooks'
4-
import reactRefresh from 'eslint-plugin-react-refresh'
5-
import tseslint from 'typescript-eslint'
6-
import { defineConfig, globalIgnores } from 'eslint/config'
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
6+
import { defineConfig, globalIgnores } from 'eslint/config';
77

88
export default defineConfig([
99
globalIgnores(['dist']),
@@ -20,4 +20,4 @@ export default defineConfig([
2020
globals: globals.browser,
2121
},
2222
},
23-
])
23+
]);

frontend/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc -b && vite build",
9-
"lint": "eslint . --ext .ts,.tsx",
10-
"lint:fix": "eslint . --ext .ts,.tsx --fix",
119
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,css}\"",
1210
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,css}\"",
13-
"type-check": "tsc --noEmit",
1411
"preview": "vite preview"
1512
},
1613
"dependencies": {

frontend/postcss.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import tailwindcss from '@tailwindcss/postcss'
2-
import autoprefixer from 'autoprefixer'
1+
import tailwindcss from '@tailwindcss/postcss';
2+
import autoprefixer from 'autoprefixer';
33

44
export default {
55
plugins: [tailwindcss, autoprefixer],
6-
}
6+
};

frontend/src/App.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import viteLogo from '/vite.svg'
4-
import './App.css'
1+
import { useState } from 'react';
2+
import reactLogo from './assets/react.svg';
3+
import viteLogo from '/vite.svg';
4+
import './App.css';
55

66
function App() {
7-
const [count, setCount] = useState(0)
7+
const [count, setCount] = useState(0);
88

99
return (
1010
<>
1111
<div>
12-
<a href="https://vite.dev" target="_blank">
13-
<img src={viteLogo} className="logo" alt="Vite logo" />
12+
<a href='https://vite.dev' target='_blank'>
13+
<img src={viteLogo} className='logo' alt='Vite logo' />
1414
</a>
15-
<a href="https://react.dev" target="_blank">
16-
<img src={reactLogo} className="logo react" alt="React logo" />
15+
<a href='https://react.dev' target='_blank'>
16+
<img src={reactLogo} className='logo react' alt='React logo' />
1717
</a>
1818
</div>
1919
<h1>Vite + React</h1>
20-
<div className="card">
20+
<div className='card'>
2121
<button
22-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
23-
onClick={() => setCount((count) => count + 1)}
22+
className='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded'
23+
onClick={() => setCount(count => count + 1)}
2424
>
2525
count is {count}
2626
</button>
2727
<p>
2828
Edit <code>src/App.tsx</code> and save to test HMR
2929
</p>
3030
</div>
31-
<p className="read-the-docs">
32-
Click on the Vite and React logos to learn more
33-
</p>
31+
<p className='read-the-docs'>Click on the Vite and React logos to learn more</p>
3432
</>
35-
)
33+
);
3634
}
3735

38-
export default App
36+
export default App;

frontend/src/config/firebase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ const firebaseConfig = {
1010

1111
const app = initializeApp(firebaseConfig);
1212
export const auth = getAuth(app);
13-
export default app;
13+
export default app;

frontend/src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@tailwind base;
22
@tailwind components;
3-
@tailwind utilities;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)