Release notes
Add the Prettier CLI tool to ensure consistent code formatting across the project. This helps maintain code quality and reduces the need for manual formatting.
Problem to solve
As a developer, I want consistent code formatting so I can avoid style inconsistencies and improve code readability.
Intended users
- Developers maintaining or contributing to the project.
Metrics
- Number of formatting issues caught during pre-commit hooks.
- Time saved by automating code formatting.
- Reduction in manual code reviews related to formatting.
User experience goal
The user should be able to run formatting checks and fixes easily with Prettier, and have formatting automatically validated before commits.
Proposal
- Add Prettier CLI to the project for code formatting.
- Add formatting scripts in
package.json:
format:check: Check for formatting issues.
format:fix: Automatically format the code.
- Integrate Prettier with Husky pre-commit hooks to enforce formatting.
Further details
Prettier Configuration:
.prettierrc: Contains Prettier configuration settings.
.prettierignore: Specifies files to exclude from formatting.
Pre-commit Hook:
- Automatically runs
npm run format:check to catch formatting issues before committing.
Desired outcomes
- Consistent code style enforced across the codebase.
- Reduced manual effort in code reviews related to formatting.
Acceptance criteria
- Formatting issues are detected and corrected via Prettier.
- Pre-commit hooks enforce formatting checks automatically.
Links / references
Release notes
Add the Prettier CLI tool to ensure consistent code formatting across the project. This helps maintain code quality and reduces the need for manual formatting.
Problem to solve
As a developer, I want consistent code formatting so I can avoid style inconsistencies and improve code readability.
Intended users
Metrics
User experience goal
The user should be able to run formatting checks and fixes easily with Prettier, and have formatting automatically validated before commits.
Proposal
package.json:format:check: Check for formatting issues.format:fix: Automatically format the code.Further details
Prettier Configuration:
.prettierrc: Contains Prettier configuration settings..prettierignore: Specifies files to exclude from formatting.Pre-commit Hook:
npm run format:checkto catch formatting issues before committing.Desired outcomes
Acceptance criteria
Links / references