feat: Add Prettier configuration and format check workflow

- Introduced .prettierrc for consistent code formatting with specified rules.
- Added .prettierignore to exclude unnecessary files from formatting.
- Updated package.json to include Prettier and lint-staged as devDependencies.
- Implemented GitHub Actions workflow for format checking on pull requests and pushes.
- Created a Husky pre-commit hook to run lint-staged for automatic formatting.

These changes enhance code quality and maintainability by enforcing consistent formatting across the codebase.
This commit is contained in:
Test User
2025-12-21 00:20:18 -05:00
parent 1b8d23688e
commit 89acada310
6 changed files with 664 additions and 2 deletions

View File

@@ -35,10 +35,23 @@
"test:server:coverage": "npm run test:cov --workspace=apps/server",
"test:packages": "npm run test -w @automaker/types -w @automaker/utils -w @automaker/prompts -w @automaker/platform -w @automaker/model-resolver -w @automaker/dependency-resolver -w @automaker/git-utils --if-present",
"test:all": "npm run test:packages && npm run test:server",
"lint:lockfile": "! grep -q 'git+ssh://' package-lock.json || (echo 'Error: package-lock.json contains git+ssh:// URLs. Run: git config --global url.\"https://github.com/\".insteadOf \"git@github.com:\"' && exit 1)"
"lint:lockfile": "! grep -q 'git+ssh://' package-lock.json || (echo 'Error: package-lock.json contains git+ssh:// URLs. Run: git config --global url.\"https://github.com/\".insteadOf \"git@github.com:\"' && exit 1)",
"format": "prettier --write .",
"format:check": "prettier --check .",
"prepare": "husky"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,md,html,yml,yaml}": [
"prettier --write"
]
},
"dependencies": {
"cross-spawn": "^7.0.6",
"tree-kill": "^1.2.2"
},
"devDependencies": {
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"prettier": "^3.7.4"
}
}