A semantic pre-commit checklist that catches issues in your staged changes before you push — things linters can't see.
The Problem
Linters catch syntax and style. But they don't catch: "you added a new exported function with zero tests", "you left a TODO comment in", "you accidentally committed an API key", or "you changed a TypeScript file but didn't update the tests". CI catches these — after you've already pushed and waited 5 minutes.
What It Does
PR Preflight analyzes your staged git diff against configurable semantic rules and shows a pass/fail checklist panel before you push. It's integrated into the SCM sidebar so it's always one click away.
Features
5 built-in rules covering the most common pre-push mistakes
SCM title bar button — appears directly in the Source Control panel
Severity levels — errors (block), warnings (caution), info (advisory)
Details per rule — shows the exact lines that triggered each failure
File change summary — lists all changed files in the diff
Configurable via .preflight.yml
Getting Started
Stage some files (git add)
In the Source Control panel, click the ✓ PR Preflight button in the title bar
Or run the command: PR Preflight: Run Checks
Review the pass/fail checklist panel
Commands
Command
Description
PR Preflight: Run Checks
Analyze staged changes and show the checklist
PR Preflight: Edit Rules
Open .preflight.yml for editing
Built-in Rules
Rule
Severity
What it catches
no-todo-left
⚠️ Warning
TODO, FIXME, or HACK comments added in this diff
no-secret-pattern
❌ Error
Common credential patterns (api_key=, password=, secret=)
no-empty-catch
⚠️ Warning
Empty catch(e) {} blocks added in this diff
no-console-log
ℹ️ Info
console.log/warn/error statements added
ts-files-have-tests
⚠️ Warning
TypeScript files changed without corresponding test file changes
Configuration
Setting
Default
Description
prPreflight.rulesFile
.preflight.yml
Path to the rules configuration file
prPreflight.blockOnFailure
false
Show errors (red) instead of warnings when rules fail
Reading the Results
✅ Preflight Passed (or ❌ Preflight Failed)
4 passed | 1 failed
✅ no-secret-pattern — No secret patterns detected.
✅ no-empty-catch — No empty catch blocks added.
⚠️ no-todo-left — 2 TODO comments added in this change.
› // TODO: handle the edge case here
› // TODO: add retry logic
✅ no-console-log — No console.log statements added.
✅ ts-files-have-tests — All changed TS files have test changes.
Changed Files (3)
📄 src/UserService.ts
📄 src/UserService.test.ts
📄 src/utils/format.ts
Tips
Run this before every commit to build the habit — it takes under 1 second
The no-secret-pattern rule is your last line of defense against credential leaks
Combine with a git pre-commit hook to enforce team-wide: prPreflight.run can be called from CI
The ts-files-have-tests rule encourages test-driven discipline without being a hard blocker