Code Quality¶
Maintaining high code quality is essential for a maintainable and robust project. This document outlines the formatting and code-quality tools used in this project.
Formatting Rules¶
Consistent formatting improves code readability and maintainability. We utilize Prettier for automatic code formatting.
Using Prettier:
Prettier automatically formats your code according to the project’s configuration.
Here are the available commands:
npm run format
: Runs Prettier to check for format issues.npm run format:fix
: Formats all code files and saves the changes.
Code Quality¶
Linting enforces consistent coding style and catches potential errors. We use ESLint for static code analysis.
Using ESLint:
ESLint scans your code for potential issues and stylistic inconsistencies.
Here are the available commands:
npm run lint
: Runs ESLint to check for errors and style issues.npm run lint:fix
(Optional): Attempts to automatically fix some ESLint problems.
By following these guidelines and utilizing the provided tools, you can ensure your code adheres to consistent formatting and coding practices, leading to a higher quality project.