FLARE SUITE flarelint
Unified Rust AST Static Analysis

Nanosecond-Fast Edge Linter for Cloudflare & Astro.

`flarelint` audits Cloudflare Workers, Pages, and Astro edge applications at native Rust speed. Catches unsupported Node.js runtime built-ins, un-awaited promises, transaction hazards, and Pages routing quota limits before deployment.

Get Started
cargo install flarelint
terminal // zsh flarelint check .
flarelint check src/
─── FLARELINT // EDGE COMPATIBILITY & AST AUDITOR ───

ERROR node-compat/strictly-unsupported src/auth.ts:2:1
Module 'child_process' is strictly unsupported on edge runtime.

ERROR waituntil/unawaited-async src/worker.ts:14:5
Floating promise 'fetch()' in fetch handler will terminate early.
↳ Fix: Pass promise to 'ctx.waitUntil(...)', or use 'await'.

WARN do-storage/concurrent-write-hazard src/counter.ts:22:9
Concurrent writes in Promise.all risk non-atomic state mutations.

FAILED // Scanned 38 files in 1.42ms // 2 errors, 1 warning
< 2.5 µs
AST Parse & Lint Per File
100%
Rust 2024 Native Engine
6 IN 1
Consolidated Tools
0 MS
Node / JS Startup Overhead
Consolidated Core Rules
oxc-ast engine
node-compat ERROR / WARN

Node.js Edge Runtime Auditor

Audits AST import and require specifiers. Flags strictly unsupported modules (`child_process`, `cluster`, `dgram`, `vm`, `v8`) and verifies `nodejs_compat` configuration.

// ❌ FAILS on Workers edge
import { spawn } from 'child_process';
import crypto from 'node:crypto'; // without nodejs_compat

// ✔️ PASSES with nodejs_compat
import { Buffer } from 'node:buffer';
waituntil ERROR

Floating Promise Detector

Detects background async operations invoked inside request handlers that are neither awaited nor registered via `ctx.waitUntil(promise)`.

// ❌ Terminated prematurely when HTTP response sent
export default {
  async fetch(req, env, ctx) {
    sendTelemetry(req); // floating promise
    return new Response("OK");
  }
}
do-storage ERROR / WARN

Durable Object Transaction Safety

Enforces explicit `await` on storage methods, detects race hazards in `Promise.all` batch writes, and prohibits invalid nested transactions.

// ✔️ Atomically safe Durable Object batch write
await this.ctx.storage.transaction(async (txn) => {
  await txn.put("keyA", 1);
  await txn.put("keyB", 2);
});
routes PAGES ROUTER

Cloudflare Pages _routes.json

Guarantees compliance with Cloudflare Pages 100-rule limit, verifies trailing wildcard placement, and detects shadowed or unneeded routing rules.

{
  "version": 1,
  "include": ["/*"],
  "exclude": ["/static/*", "/favicon.ico"]
}
Interactive Rule Inspector
INPUT SOURCE // TSwrangler: nodejs_compat=true
import { exec } from 'child_process';
import { Buffer } from 'buffer';
import crypto from 'node:crypto';

export default {
  async fetch() { return new Response('OK'); }
};
FLARELINT OUTPUT0.8 µs
ERROR node-compat/strictly-unsupported:1:1
      'child_process' is strictly unsupported on edge.
WARN  node-compat/prefer-node-protocol:2:1
      Prefer explicit 'node:buffer' specifier.
CLI Commands & Subcommands
clap v4 suite
Command Description Example
flarelint check [PATH] Runs all rules across JS, TS, Astro, and `_routes.json` files. flarelint check . --strict
flarelint node-compat [PATH] Scans for unsupported Node.js runtime built-in modules. flarelint node-compat src/
flarelint waituntil [PATH] Detects floating promises inside request/queue handlers. flarelint waituntil src/
flarelint do-storage [PATH] Lints Durable Object storage concurrency and transactions. flarelint do-storage src/
flarelint routes [PATH] Lints Cloudflare Pages `_routes.json` quotas and globs. flarelint routes public/_routes.json
flarelint completions <SHELL> Generates shell completions (`zsh`, `bash`, `fish`, `powershell`). flarelint completions zsh