Setup Formatting Command
July 12, 2025 ยท View on GitHub
Configure code formatting tools
Instructions
Setup code formatting following these steps: $ARGUMENTS
-
Language-Specific Tools
JavaScript/TypeScript:
npm install -D prettier echo '{"semi": true, "singleQuote": true, "tabWidth": 2}' > .prettierrcPython:
pip install black isort echo '[tool.black]\nline-length = 88\ntarget-version = ["py38"]' > pyproject.tomlJava:
# Google Java Format or Spotless plugin -
Configuration Files
.prettierrc:
{ "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "es5", "printWidth": 80 } -
IDE Setup
- Install formatter extensions
- Enable format on save
- Configure keyboard shortcuts
-
Scripts and Automation
{ "scripts": { "format": "prettier --write .", "format:check": "prettier --check ." } } -
Pre-commit Hooks
npm install -D husky lint-staged echo '{"*.{js,ts,tsx}": ["prettier --write", "eslint --fix"]}' > .lintstagedrc
Remember to run formatting on entire codebase initially and configure team IDE settings consistently.