Formatting
The Formatting engine enforces consistent code style using the best-in-class formatter for each language. Formatting findings carry the lowest default weight (0.3), so they inform without dominating your score.| Language | Formatter |
|---|---|
| TypeScript / JavaScript | Biome |
| Expo / React Native | Biome |
| Python | ruff format |
| Go | gofmt |
| Rust | cargo fmt |
| Ruby | rubocop |
| PHP | php-cs-fixer |
Linting
The Linting engine catches language-specific bugs, anti-patterns, and bad practices using established, widely-trusted tools.| Language | Tool |
|---|---|
| TypeScript / JavaScript | oxlint (bundled, with React / Next.js awareness) |
| Expo / React Native | oxlint + expo-doctor (project health, dependency checks) |
| Python | ruff |
| Go | golangci-lint |
| Rust | clippy |
| Ruby | rubocop |
Code Quality
The Code Quality engine measures structural complexity, locates dead code, and identifies unused dependencies. All thresholds are configurable.- Complexity
- Duplication & Dead Code
- Knip (JS/TS)
| Rule | What it checks | Default threshold |
|---|---|---|
complexity/function-too-long | Functions that exceed a line limit. For Python, only logical body code counts — signatures, docstrings, comments, and blank lines are excluded. | 80 lines |
complexity/file-too-large | Files that exceed a line limit | 400 lines |
complexity/deep-nesting | Control-flow nesting beyond a depth limit | 5 levels |
complexity/too-many-params | Functions with too many parameters. For Python, only required parameters count — self/cls, *args/**kwargs, separators, and defaulted params are excluded. | 6 params |
AI Slop
The AI Slop engine is what makes aislop unique. It carries the highest default weight (2.5) because these are the patterns AI coding agents — Claude Code, Cursor, Codex, OpenCode — leave behind that pass lint and tests but quietly rot a codebase.Comment and naming patterns
Comment and naming patterns
Exception and error handling
Exception and error handling
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/swallowed-exception | error | Empty catch blocks, or catch blocks that only log (JS/TS/Python/Go/Ruby) |
ai-slop/silent-recovery | warning | Catch blocks that log without including the caught error and then continue |
ai-slop/redundant-try-catch | warning | JS/TS catch blocks that only rethrow the same error without adding context, cleanup, or recovery |
ai-slop/python-bare-except | warning | Python except: blocks that catch everything without naming an exception type |
ai-slop/python-broad-except | warning | Python broad exception handlers with silent/pass-style bodies |
TypeScript type system abuse
TypeScript type system abuse
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/unsafe-type-assertion | warning | as any casts in TypeScript |
ai-slop/double-type-assertion | warning | The as unknown as X escape-hatch pattern |
ai-slop/ts-directive | info | @ts-ignore / @ts-expect-error usage |
ai-slop/redundant-type-coercion | warning | TypeScript primitive parameters re-coerced with String(...), Number(...), or Boolean(...) |
ai-slop/duplicate-type-declaration | warning | Exported TypeScript type/interface declarations with the same name and shape repeated across files |
Dead and unreachable code
Dead and unreachable code
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/unreachable-code | warning | Code after return / throw statements |
ai-slop/constant-condition | warning | if (true), if (false), if (0) |
ai-slop/empty-function | info | Empty function bodies |
ai-slop/thin-wrapper | warning | Functions that only forward their own parameters unchanged to another function — a call that transforms its arguments is not flagged |
ai-slop/console-leftover | warning | console.log / debug / info left in production code |
Imports and dependencies
Imports and dependencies
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/unused-import | warning | Unused imports in JS/TS and Python |
ai-slop/duplicate-import | warning | Multiple imports from the same module that should be merged |
ai-slop/hallucinated-import | error | JS/TS imports of packages not declared in the project manifest |
Hardcoded values
Hardcoded values
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/hardcoded-url | warning | Environment-specific URLs hardcoded in production code instead of env/config |
ai-slop/hardcoded-id | warning | Provider/project IDs hardcoded in production code instead of env/config |
Python-specific patterns
Python-specific patterns
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/python-mutable-default | warning | Function defaults like [], {}, or set() that are shared across calls |
ai-slop/python-print-debug | warning | print(...) debug output left in production modules |
ai-slop/python-range-len-loop | info | for i in range(len(items)) loops that usually want direct iteration or enumerate() |
ai-slop/python-chained-dict-get | warning | .get(..., {}).get(...) fallback chains that hide missing-data cases |
ai-slop/python-repetitive-dispatch | warning | Repeated equality branch ladders that should become a table, set, or handler map |
ai-slop/python-isinstance-ladder | warning | Repeated isinstance(...) ladders that should become a handler map or normalized representation |
Go and Rust patterns
Go and Rust patterns
| Rule | Severity | What it catches |
|---|---|---|
ai-slop/go-library-panic | warning | Go panic(...) calls in non-main library code unless clearly intentional |
ai-slop/rust-non-test-unwrap | warning | Rust .unwrap() in production code where errors should be handled or documented |
ai-slop/rust-todo-stub | warning | Rust todo!() stubs in production code |
Security
The Security engine finds hardcoded secrets, unsafe code constructs, and vulnerable dependencies. It carries a default weight of 1.5 — second only to AI Slop.| Rule | What it catches |
|---|---|
security/hardcoded-secret | API keys, AWS credentials, JWT tokens, database URLs, passwords |
security/eval | eval() usage in JS/TS, Python, Ruby, and PHP |
security/innerhtml | Direct .innerHTML assignment |
security/dangerously-set-innerhtml | React dangerouslySetInnerHTML usage that needs sanitization |
security/sql-injection | String concatenation in SQL queries |
security/shell-injection | User input passed to command execution |
security/vulnerable-dependency | Dependency audit via npm, pip, cargo, and govulncheck |
security/dependency-audit-skipped | Audit could not run because tooling or lockfile context was missing |
Architecture (opt-in)
The Architecture engine runs custom structural rules you define yourself. It is disabled by default — enable it withengines.architecture: true in .aislop/config.yml and create a .aislop/rules.yml file.
| Rule type | What it does |
|---|---|
forbid_import | Bans a package from being imported anywhere in the project (e.g. ban axios in favor of fetch) |
forbid_import_from_path | Prevents specific paths from importing specific modules (e.g. controllers cannot import database modules directly) |
require_pattern | Asserts that files matching a path pattern must include a required code pattern (e.g. error handling in all API routes) |
Suppressing findings inline
When you know a finding is a false positive or an intentional exception, you can suppress it without changing your config.aislop-ignore-next-linesuppresses findings on the next lineaislop-ignore-linesuppresses findings on the same lineaislop-ignore-file(placed anywhere in the file) suppresses findings for the entire file
-- followed by a reason to document why the suppression exists. The directive works in any comment syntax (//, #, <!-- -->). Suppressed findings are excluded before scoring, and the scan output reports how many were silenced.
For the complete list of all rules with their IDs, severities, and supported languages, see the Rules Reference.
ai-slop/trivial-comment// Import React,// Return the value)ai-slop/narrative-commentai-slop/meta-commentai-slop/todo-stubai-slop/generic-naminghelper_1,data2,temp1