Skip to main content
Static analysis for React

Your code compiles. Does your UI make sense?

CognitiveLint detects cognitive friction in React applications. 17 rules. 6 UX dimensions. Catches human bugs before your users do.

cognitivelint scan
$ cognitivelint scan Scanning 127 files... ✗ CRIT error-prevention/destructive-no-confirm src/Settings.tsx:108 Delete account action has no confirmation dialog ⚠ HIGH feedback/missing-loading-state src/Dashboard.tsx:42 useQuery found without loading indicator ○ MED cognitive-load/long-forms src/UserForm.tsx:15 Form has 12 fields (max recommended: 7) ────────────────────────────────────────── Score: 74/100 Grade: C Critical: 1 High: 3 Med: 8 Low: 12 ✗ Exit 1 — score below threshold (80)
17
Built-in rules
6
UX dimensions
~2s
per 1000 files
4
Output formats

Every quality dimension covered — except one

Teams have ESLint for correctness, Lighthouse for performance, axe for accessibility, Snyk for security. Nobody was measuring cognitive UX — until now.

📐Code CorrectnessESLint
📊Code QualitySonarQube
⚡PerformanceLighthouse
♿Accessibilityaxe
🔐SecuritySnyk
🧠Cognitive UXCognitiveLint

17 rules across 6 cognitive dimensions

Every rule is grounded in UX research — Miller's Law, Nielsen's heuristics, and cognitive load theory. Each finding reduces your overall UX score.

🧠30%
Cognitive Load
Detects interfaces that overwhelm working memory — too many actions, fields, filters, or table columns.
excessive-primary-actionslong-formsfilter-overloaddense-tables
🔒20%
Trust & Confidence
Finds UI that erodes user trust — unexplained disabled states, ambiguous ownership indicators.
unexplained-disabledownership-ambiguitymissing-ownership
📡15%
Feedback
Catches async operations missing feedback — no loading states, empty states, or success confirmation.
missing-loading-statemissing-empty-statemissing-success-feedbackno-progress-indicator
🔍15%
Discoverability
Surfaces hidden or inaccessible features — missing search, buried primary actions, empty navigation.
missing-searchhidden-primary-actionempty-navigation
🎨10%
Consistency
Identifies inconsistent terminology in UI controls — button labels that vary across the same flow.
inconsistent-button-labels
🛡️10%
Error Prevention
Flags dangerous patterns — destructive actions without confirmation, nested modals, confirmation fatigue.
destructive-no-confirmno-undomodal-nestingconfirmation-fatigue

Ship to CI in under 5 minutes

No runtime instrumentation. No user data. Pure static analysis on your JSX/TSX source.

01
Install

One package. No peer dependencies to wrangle. Works with any React project.

$ npm i -g @cognitivelint/cli
02
Scan

Run against your src directory. Analyzes JSX/TSX AST without touching your runtime.

$ cognitivelint scan ./src
03
Enforce

Gate CI on a minimum score or max finding count. Fails with exit code 1 on breach.

$ cognitivelint scan --min-score 80

A/B/C/D/F grades for your UX quality

Weighted 0–100 score with letter grades. Severity deductions are modulated by rule confidence scores for accurate signal.

C74/100
Sample score
CRITICAL
1
HIGH
3
MEDIUM
8
LOW
12
error-prevention/destructive-no-confirmsrc/Settings.tsx:108Destructive action found without confirmation dialog
feedback/missing-loading-statesrc/Dashboard.tsx:42Async operation (useQuery) has no loading state
cognitive-load/long-formssrc/UserForm.tsx:15Form has 12 fields, recommended max is 7

Gate every PR on cognitive UX quality

SARIF output integrates with GitHub Code Scanning. Findings appear as inline PR annotations — no dashboard required.

⚙️.github/workflows/cognitivelint.yml
name: CognitiveLint
on: [push, pull_request]

jobs:
cognitive-ux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx @cognitivelint/cli scan \
--format sarif \
--output report.sarif \
--min-score 80

- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: report.sarif
📄cognitivelint.config.js
// cognitivelint.config.js
export default {
include: ['src/**/*.tsx', 'src/**/*.jsx'],
exclude: ['**/*.test.*', '**/*.stories.*'],
rules: {
'error-prevention/destructive-no-confirm': 'error',
'feedback/missing-loading-state': { severity: 'critical' },
'cognitive-load/long-forms': { options: { maxFields: 7 } },
},
minScore: 80,
maxFindings: 20,
};

Ship UI that humans understand

Add cognitive UX analysis to your pipeline in minutes. Catch human bugs the same way you catch code bugs.

$npm install -g @cognitivelint/cli