Integrate Prettier into project configuration

- Added `eslint-config-prettier` to disable conflicting ESLint rules.
- Configured Prettier with `.prettierrc` for consistent formatting.
- Updated `package.json` scripts to apply and check formatting on entire project.
- Added `.prettierignore` to exclude unnecessary files and directories from formatting.
- Updated dependencies in `package-lock.json` and removed unused packages.
This commit is contained in:
2025-11-10 11:02:51 +01:00
parent b2f3ec8f25
commit 464a6140c4
5 changed files with 93 additions and 3 deletions

41
frontend/.prettierignore Normal file
View File

@@ -0,0 +1,41 @@
# Dependencies
node_modules
.pnp
.pnp.js
# Build outputs
.next
out
build
dist
# Coverage
coverage
.nyc_output
# Generated files
src/lib/api/generated
*.gen.ts
*.gen.tsx
# Logs
*.log
# Environment files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
# Auth storage for E2E tests
.auth
# Package manager lock files
package-lock.json
pnpm-lock.yaml
yarn.lock
# Other
.DS_Store
*.pem

13
frontend/.prettierrc Normal file
View File

@@ -0,0 +1,13 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "lf",
"bracketSpacing": true,
"jsxSingleQuote": false,
"plugins": []
}

View File

@@ -12,6 +12,7 @@ const compat = new FlatCompat({
const eslintConfig = [
...compat.extends('next/core-web-vitals'),
...compat.extends('next/typescript'),
...compat.extends('prettier'), // Disable ESLint rules that conflict with Prettier
{
ignores: [
'node_modules/**',

View File

@@ -48,7 +48,6 @@
"zustand": "^4.5.7"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@hey-api/openapi-ts": "^0.86.11",
"@next/bundle-analyzer": "^16.0.1",
"@peculiar/webcrypto": "^1.5.0",
@@ -64,9 +63,11 @@
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.2.0",
"eslint-config-prettier": "^10.1.8",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"lighthouse": "^12.8.2",
"prettier": "^3.6.2",
"tailwindcss": "^4",
"typescript": "^5",
"whatwg-fetch": "^3.6.20"
@@ -8201,6 +8202,22 @@
}
}
},
"node_modules/eslint-config-prettier": {
"version": "10.1.8",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
"dev": true,
"license": "MIT",
"bin": {
"eslint-config-prettier": "bin/cli.js"
},
"funding": {
"url": "https://opencollective.com/eslint-config-prettier"
},
"peerDependencies": {
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-import-resolver-node": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
@@ -14295,6 +14312,22 @@
"node": ">= 0.8.0"
}
},
"node_modules/prettier": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-format": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",

View File

@@ -10,8 +10,8 @@
"lint:fix": "eslint --fix .",
"lint:tests": "eslint tests --max-warnings=0",
"type-check": "tsc --noEmit",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format": "prettier --write .",
"format:check": "prettier --check .",
"generate:api": "./scripts/generate-api-client.sh",
"test": "jest",
"test:watch": "jest --watch",
@@ -76,9 +76,11 @@
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.2.0",
"eslint-config-prettier": "^10.1.8",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"lighthouse": "^12.8.2",
"prettier": "^3.6.2",
"tailwindcss": "^4",
"typescript": "^5",
"whatwg-fetch": "^3.6.20"