Thank you for contributing to xBlockOrigin! This guide covers code style, quality standards, and the pull request process.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chefnaphtha/xBlockOrigin/llms.txt
Use this file to discover all available pages before exploring further.
Code quality standards
All code must pass automated checks before being merged. Run these commands before committing:Code style guidelines
Language preferences
xBlockOrigin uses modern JavaScript/TypeScript patterns:- Use Bun over Node.js - All scripts should use
buninstead ofnode - Tab indentation - 4-space tabs (configured in Biome)
- No semicolons - Biome enforces semicolon-free style
- Latest JS/TS features - Use modern syntax over legacy patterns
- Lowercase comments - Keep comments lowercase unless referencing proper nouns
- Files under 200 lines - Split large files into smaller, focused modules
TypeScript guidelines
Follow these TypeScript best practices: Preferred patterns:- Prefer inline types over separate interface declarations
- Leverage automatic type inference (avoid explicit return types when unnecessary)
- Use Valibot schemas for runtime type validation
Functional programming over OOP
xBlockOrigin strongly prefers functional programming:Classes are allowed only for pure, semantic types where per-instance state is required (e.g.,
User, Task).File organization
Naming conventions
- PascalCase - Directories and component files (
Popup/,App.tsx) - camelCase - Utility files and functions (
cache.ts,orchestrator.ts) - Consistent casing within each domain
Directory structure principles
- Feature-based organization - Group by feature, not by type
- Colocate related code - Keep components with their styles and types
- No barrel exports - Import directly from source files
- Separate concerns - Each file should have a single responsibility
Biome configuration
The project uses Biome for linting and formatting. Key settings frombiome.json:
- Indentation: Tabs (4 spaces)
- Line width: 80 characters
- Quotes: Single quotes for JS, double for JSX
- Semicolons: As needed (effectively none)
- Trailing commas: None
- Arrow parentheses: Always
Biome runs automatically via the
lint and format scripts. Don’t fight the formatter - let Biome handle style.Pull request process
Create a feature branch
Create a branch from Use descriptive branch names:
main for your changes:feature/- New featuresfix/- Bug fixesrefactor/- Code refactoringdocs/- Documentation changes
Make your changes
Follow the code style guidelines and keep commits focused:
- One logical change per commit
- Write clear commit messages
- Keep files under 200 lines
- Add comments only for complex logic
Run quality checks
Before committing, ensure all checks pass:This runs:
- Type checking (
bunx tsc --noEmit) - Linting (
bunx @biomejs/biome check --fix --unsafe) - Formatting (
bunx @biomejs/biome format --fix)
Test your changes
Build and test the extension in both browsers:Load the extension in Chrome and Firefox to verify:
- Functionality works as expected
- No console errors
- No visual regressions
Commit with version bump
The pre-commit hook automatically increments the major version:The hook will bump the version (e.g.,
28.0.0 → 29.0.0) automatically.If the hook doesn’t run, manually run:
bun run setup-hooksPush and create PR
Push your branch and create a pull request:In your PR description:
- Describe what changed and why
- Include screenshots for UI changes
- Reference any related issues
- Note if this is a breaking change
Common pitfalls to avoid
Getting help
If you need help:- Check the project structure to understand the codebase
- Review the README.md for technical details
- Look at recent commits for examples of good code style
- Open a discussion issue before starting large changes