ai-slop/unused-import auto-fixable
Unused import.
An import that no remaining code references. Usually left over after a refactor or a deletion the agent forgot to follow through on.
Bad — what an agent ships
import { useEffect, useState, useMemo } from 'react'
import { formatDate } from '../utils/dates'
export function Counter() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(c => c + 1)}>{count}</button>
} Good — what aislop hands back
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return <button onClick={() => setCount(c => c + 1)}>{count}</button>
} Why an AI agent produces this
Agents add imports speculatively then refactor away the consumer; the import lingers because removing it requires re-reading the file end-to-end.
Provenance
How this rule is justified.
Rule id
ai-slop/unused-import
Enforcing engine
ai-slop
Detector strategy
Deterministic AST match: flags imported bindings with zero references in the module.
Legitimate code that is NOT flagged
Side-effect imports, type-only imports that are referenced, and re-exported bindings are not flagged.
Evidence
Unused code appeared across unrelated projects in the first public scan batch.