@llcamp/bioy
v0.1.3
Published
**A blazing-fast, Rust-based linter for Playwright tests.** Built on top of the incredible [Oxc](https://oxc.rs/) AST parser, `bioy` analyzes hundreds of TypeScript and JavaScript test files across all your CPU cores in milliseconds. It catches common P
Readme
🌿 bioy
A blazing-fast, Rust-based linter for Playwright tests.
Built on top of the incredible Oxc AST parser, bioy analyzes hundreds of TypeScript and JavaScript test files across all your CPU cores in milliseconds. It catches common Playwright anti-patterns, missing awaits, and enforces test simplicity with rich, graphical miette diagnostics.
✨ Features
- ⚡️ Blazing Fast: Highly concurrent directory traversal powered by
rayonandignore. Respects your.gitignoreand scales effortlessly across massive monorepos. - 🛠️ Auto-Fixes (
--fix): Automatically injects missingawaitstatements directly into your test files. - 🔄 Watch Mode (
--watch): Real-time feedback as you save files. - 🚀 Project Initialization (
init): One-command setup forbioy.jsonand git pre-commit hooks. - 📊 Professional Reporting: Export results in SARIF, JUnit, and JSON formats for CI/CD integration.
- 🔌 LSP Integration: Real-time editor feedback via the Language Server Protocol.
- 🚨 CI Anti-Patterns: Hard fails if developers accidentally commit
test.only,page.pause(), or hardcodedpage.waitForTimeout(). - 🧩 Cognitive Complexity Tracking: Evaluates the nested
if,for, and conditional statements within yourtest()blocks. - 👁️ Gorgeous Output: Uses
mietteto point to the exact source spans of your violations.
🛠️ Development & Publishing
If you are a maintainer of the project, refer to the Publishing Guide for instructions on how to publish bioy to npm and other platforms.
🚀 Installation
The easiest way to get started with bioy is via npm.
Global Installation
npm install -g @llcamp/bioyOne-time Execution (No Install)
npx @llcamp/bioy --help💻 Usage
🌿 Initialization
Set up bioy in your project, generate a default config, and install a git pre-commit hook:
bioy init🔍 Linting
To lint the current directory (and all sub-directories recursively) with high-fidelity output:
bioy📊 Dashboard & Reporting
bioy provides three professional ways to view your quality metrics:
1. Interactive Dashboard (Live)
Launch a local web server to explore violations, auto-fix issues, and acknowledge false positives:
bioy --serve2. Static HTML Report (Portable)
Generate a standalone, self-contained HTML file for CI/CD artifacts or sharing:
bioy --format html . > quality-report.html3. Structured Data for CI/CD
Choose your format for integration with GitHub Actions, GitLab, or Jenkins:
bioy --format sarif . > results.sarif
bioy --format junit . > results.xml🛠️ Auto-Fixing & Acknowledgement
- Auto-Fix (
--fix): Automatically patch missingawaits. - Ignore Syntax: To acknowledge an issue without changing code, use:
// bioy-ignore(rule-name): reason
🐳 Docker
For centralized deployments or standardized CI environments, refer to the Docker Guide.
🛠️ Maintainers
Refer to the Publishing Guide for instructions on how to release new versions of bioy.
### 🔌 Language Server (LSP)
For real-time IDE feedback, point your LSP client to the `bioy lsp` command.
## 🙈 Rule Exceptions
You can ignore specific rules on a per-file or per-line basis using comments:
```typescript
// bioy-ignore(bioy::missing_await)
expect(page.locator('button')).toBeVisible();
// bioy-ignore
// This ignores all bioy rules for the next line
page.pause();⚙️ Configuration
You can customize bioy's rules by placing a bioy.json string file at the root of your execution directory.
Example bioy.json:
{
"cognitive_complexity_threshold": 5
}cognitive_complexity_threshold: (Default:3). Adjusts the tolerance for nested loops and conditionals inside a Playwright test. If a test crosses this threshold,bioywill throw a warning to encourage breaking out helper functions.
