add prettier support

Signed-off-by: Karan Yadav <xpresskaran98@gmail.com>
This commit is contained in:
Karan Yadav 2025-02-19 05:59:40 +00:00
parent a20477b0b2
commit dd03b2f3c0
6 changed files with 12327 additions and 11638 deletions

24
.github/workflows/formatting.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Formatting Check
on:
pull_request:
branches: [main]
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run Prettier Check
run: npm run format:check || (echo "Code is not formatted! Run 'npm run format' locally." && exit 1)

1
.husky/pre-commit Normal file
View File

@ -0,0 +1 @@
npx lint-staged

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
node_modules
frontend/node_modules
backend/node_modules
backend/dist
deployment/
docs/

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"semi": true,
"tabWidth": 4,
"arrowParens": "always",
"endOfLine": "lf",
"singleQuote": false,
"bracketSpacing": true
}

23852
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,43 @@
{
"name": "volcano-dashboard",
"version": "0.1.0",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"scripts": {
"backend": "npm run dev -w backend",
"frontend": "npm run dev -w frontend",
"dev": "concurrently -n server,client \"npm run backend\" \"npm run frontend\""
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
"name": "volcano-dashboard",
"version": "0.1.0",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"concurrently": "^9.1.2"
}
}
"scripts": {
"backend": "npm run dev -w backend",
"frontend": "npm run dev -w frontend",
"dev": "concurrently -n server,client \"npm run backend\" \"npm run frontend\"",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx,json,md}": "prettier --write"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"concurrently": "^9.1.2",
"husky": "^9.1.7",
"lint-staged": "^15.4.3",
"prettier": "^3.5.1"
}
}