npm package: @llcamp/bioy
Description: **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
Latest version: 0.1.3

# 🌿 bioy

**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 Playwright anti-patterns, missing awaits, and enforces test simplicity with rich, graphical `miette` diagnostics.

---

## ✨ Features

- **⚡️ Blazing Fast:** Highly concurrent directory traversal powered by `rayon` and `ignore`. Respects your `.gitignore` and scales effortlessly across massive monorepos.
- **🛠️ Auto-Fixes (`--fix`):** Automatically injects missing `await` statements directly into your test files.
- **🔄 Watch Mode (`--watch`):** Real-time feedback as you save files.
- **🚀 Project Initialization (`init`):** One-command setup for `bioy.json` and 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 hardcoded `page.waitForTimeout()`.
- **🧩 Cognitive Complexity Tracking:** Evaluates the nested `if`, `for`, and conditional statements within your `test()` blocks.
- **👁️ Gorgeous Output:** Uses `miette` to point to the exact source spans of your violations.

---

## 🛠️ Development & Publishing

If you are a maintainer of the project, refer to the [Publishing Guide](file:///Users/luiscampos/bioy/PUBLISHING.md) 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
```bash
npm install -g @llcamp/bioy
```

### One-time Execution (No Install)
```bash
npx @llcamp/bioy --help
```

---

## 💻 Usage

### 🌿 Initialization
Set up `bioy` in your project, generate a default config, and install a git pre-commit hook:
```bash
bioy init
```

### 🔍 Linting
To lint the current directory (and all sub-directories recursively) with high-fidelity output:
```bash
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:
```bash
bioy --serve
```

#### 2. Static HTML Report (Portable)
Generate a standalone, self-contained HTML file for CI/CD artifacts or sharing:
```bash
bioy --format html . > quality-report.html
```

#### 3. Structured Data for CI/CD
Choose your format for integration with GitHub Actions, GitLab, or Jenkins:
```bash
bioy --format sarif . > results.sarif
bioy --format junit . > results.xml
```

---

## 🛠️ Auto-Fixing & Acknowledgement
- **Auto-Fix (`--fix`):** Automatically patch missing `await`s.
- **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](DOCKER.md).

## 🛠️ Maintainers
Refer to the [Publishing Guide](PUBLISHING.md) 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`:**
```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, `bioy` will throw a warning to encourage breaking out helper functions.