Code Quality
Our standards for code quality, formatting, and linting using Biome.
To maintain a high standard of code quality and consistency across the project, we use Biome (formerly Rome) for formatting and linting. This ensures that all code adheres to a predefined set of rules, making it more readable and maintainable.
Biome Configuration
Our Biome configuration is defined in the biome.json file at the root of the project. This file specifies the formatting rules, linting checks, and other settings that are enforced across the entire codebase.
Formatting
Consistent formatting is crucial for readability. Biome automatically formats our code to ensure it follows a consistent style. This includes rules for:
- Indentation and spacing
- Quote style (single vs. double)
- Semicolon usage
- Line length
- Trailing commas and whitespace
Linting
In addition to formatting, Biome performs static analysis (linting) to catch potential bugs, enforce best practices, and prevent common errors. Our linting rules are configured to identify issues such as:
- Unused variables and imports
- Violations of React hooks rules
- Accessibility issues in JSX
- Code that can be simplified or improved
Running Biome
To ensure your code is compliant before committing, you can run the following command:
pnpm run formatThis command will format your files and report any linting errors. It's recommended to run this command frequently during development to catch issues early.
Our CI/CD pipeline also runs Biome checks, and pull requests will fail if they don't adhere to our code quality standards.