An open-source linter that detects AI-generated placeholder code and lazy patterns.
npm install sloplintAn open-source linter that detects AI-generated placeholder code, incomplete implementations, and lazy patterns commonly produced by AI coding assistants.

AI coding assistants often generate "slop":
- Incomplete implementations with TODO comments.
- Placeholder code like // ... rest of the code.
- Apologetic comments admitting shortcuts.
- Stub functions that throw NotImplementedError.
- Ellipsis comments indicating omitted code.
sloplint scans your codebase to flag these patterns before they reach production.
- 12+ Detection Categories: From simple TODOs to complex AI-specific phrases.
- Fast Scanning: Built on fast-glob for high performance.
- Auto-Fix: Automatically remove safe debug statements like console.log("test").
- CI/CD Ready: Supports SARIF and JUnit XML for GitHub Actions and other CI tools.
- Intelligent Caching: Only scans modified files for lightning-fast subsequent runs.
- Ignore Logic: Supports // slop-ignore-next-line and // slop-ignore-file.
``bash`
npm install -g sloplint
Or use without installing:
`bash`
npx sloplint .
`bashScan current directory
sloplint .
Configuration
Create a
.sloprc.json file in your project root:`json
{
"rules": {
"todo-comments": "error",
"debug-statements": "warning",
"ai-specific": "error"
},
"customPatterns": [
{
"name": "internal-todo",
"pattern": "MYCOMPANY-TODO",
"severity": "error",
"message": "Found company-specific TODO"
}
]
}
`Rules
| Rule | Description | Default |
|------|-------------|---------|
|
todo-comments | Detects TODO, FIXME, HACK, XXX | error |
| placeholder-comments | Detects ellipsis like ... rest of code | error |
| apologetic-comments | Detects "sorry, this is a hack" etc. | warning |
| stub-functions | Detects empty or throwing stubs | error |
| ai-specific | Detects AI instructional phrases | error |
| suspicious-returns | Detects placeholder returns like return null | warning |
| empty-catch | Detects swallowed errors | warning |
| debug-statements | Detects console.log markers | error |
| hardcoded-values | Detects placeholder API keys/secrets | warning |
| incomplete-logic | Detects TODOs in switch/else blocks | warning |
| fake-data | Detects "John Doe" style mock data | warning |
| repetitive-placeholders`| Detects "Item 1, Item 2..." patterns | warning |We welcome contributions! Please see our CONTRIBUTING.md for guidelines.
MIT © RezaLabs