Skip to main content

Usage

Basic scan​

cognitivelint scan

Scans src/**/*.tsx and src/**/*.jsx by default. Outputs a colored terminal report.

Scan a specific directory​

cognitivelint scan ./app
cognitivelint scan ./src/components

Output formats​

Terminal (default)​

cognitivelint scan

Colored, human-readable output with severity, rule ID, file location, and overall score.

JSON​

cognitivelint scan --format json
cognitivelint scan -f json -o report.json

Machine-readable output. Suitable for custom tooling and dashboards.

SARIF (GitHub Code Scanning)​

cognitivelint scan --format sarif --output report.sarif

SARIF v2.1.0 compatible. Upload to GitHub Code Scanning for inline PR annotations.

HTML report​

cognitivelint scan --format html --output report.html

Self-contained HTML with a visual score card and sortable findings table.

CI thresholds​

Fail if score drops below threshold​

cognitivelint scan --min-score 80
# Exit 1 if score < 80

Fail if finding count exceeds limit​

cognitivelint scan --max-findings 10
# Exit 1 if findings > 10

Combine thresholds​

cognitivelint scan --min-score 80 --max-findings 20 --format sarif --output report.sarif

Custom config file​

cognitivelint scan --config path/to/cognitivelint.config.js

All flags​

FlagShortDescription
--format-fOutput format: terminal, json, sarif, html
--output-oOutput file path
--min-scoreMinimum passing score (0–100)
--max-findingsMaximum allowed findings
--config-cPath to config file