The Botnadzor Extension uses automated testing and continuous integration to maintain code quality and catch issues early.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/botnadzor/extension/llms.txt
Use this file to discover all available pages before exploring further.
Unit Testing
Unit tests are written using Vitest, a fast unit test framework for Vite projects.Running Unit Tests
Run all unit tests:Writing Tests
Tests should be placed alongside the code they test, using the.test.ts or .test.tsx extension:
Linting
The project uses multiple linters to ensure code quality and consistency.Run All Linters
Run all linting checks:- ESLint - JavaScript/TypeScript linting
- Prettier - Code formatting
- TypeScript - Type checking
- knip - Unused file/export detection
- cspell - Spell checking
- pnpm dedupe - Dependency deduplication check
Auto-fix Issues
Many linting issues can be automatically fixed:pnpm fix:eslint- Fix ESLint issuespnpm fix:prettier- Format code with Prettierpnpm fix:knip- Remove unused files (with confirmation)pnpm fix:pnpm-dedupe- Deduplicate dependencies
Individual Linters
You can run individual linters for faster feedback:ESLint
Prettier
TypeScript
knip
cspell
cspell-words.txt.
pnpm dedupe
CI/CD Pipeline
The project uses GitHub Actions for continuous integration and deployment.When CI Runs
CI runs automatically on:- Pull requests - All checks must pass before merging
- Push to
main- Validates the main branch - Tags - Triggers release builds
CI Jobs
The CI pipeline consists of two parallel jobs:1. Build
Packages the extension for both browsers:pnpm build:chrome- Build Chrome extensionpnpm build:firefox- Build Firefox extension- Package both into
.zipfiles
- Chrome extension (
.zip) - Firefox extension (
.zip) - Source code archives (for tagged releases)
- Pull requests: 2 days
- Main branch: 30 days
- Tagged releases: 90 days
2. Lint and Test
Runs all quality checks:- cspell - Spell checking
- ESLint - Code linting
- knip - Unused code detection
- pnpm dedupe - Dependency deduplication
- Prettier - Code formatting
- TypeScript - Type checking
- Vitest - Unit tests
if: ${{ success() || failure() }} to run independently, so you see all failures at once.
Local Pre-flight Check
Before pushing, run the same checks locally:CI Failure Messages
When CI fails, you’ll see helpful messages: For auto-fixable issues (ESLint, Prettier, knip):Development Scripts
Complete list of development commands:Building
Development Server
Testing
Linting
Auto-fixing
Pre-commit Hooks
The project uses Husky with lint-staged to run checks before commits. Automatically runs on commit:- Prettier formatting on staged files
Best Practices
Run linters before pushing
Run linters before pushing
Always run
pnpm lint locally before pushing to catch issues early:Use pnpm fix for quick fixes
Use pnpm fix for quick fixes
Many issues can be fixed automatically. Run
pnpm fix first:Test in both browsers
Test in both browsers
Always test your changes in both Chrome and Firefox:
Write tests for new features
Write tests for new features
Add unit tests for new functionality:
Keep dependencies deduplicated
Keep dependencies deduplicated
Run
pnpm dedupe periodically to keep pnpm-lock.yaml lean:Related Documentation
- Code Conventions - Coding standards and patterns
- Contributing Guide - How to contribute
- CI Workflow - Full CI configuration