AI-coding hygiene
no-placeholder-code
Flag `throw new Error("not implemented")` and TODO/FIXME stubs the AI left behind.
Catches the structural pattern `throw new <X>Error("not implemented" | "TODO" | "stub" | "placeholder" | "coming soon" | …)`. The fix is always the same: implement the function or remove the unreachable branch before shipping.
Behavior
- Fixable: No.
- Suggestions: No.
Examples
Bad:
export function chargeCustomer(amount) { throw new Error("not implemented"); }Good:
export function chargeCustomer(amount) { return billingClient.charge(amount); }Related rules
no-floating-promise-handlerRequire try/catch (or an async wrapper) on async Express/Fastify route handlers.no-hardcoded-localhostFlag hardcoded `localhost`/`127.0.0.1`/`0.0.0.0` URLs that ship to production.no-unsafe-mass-assignmentFlag `Object.assign(user, req.body)` and `{ ...model, ...req.body }` shapes.
Use it
Enable no-placeholder-code in your eslint.config.js:
import deslint from '@deslint/eslint-plugin';
export default [
{
plugins: { deslint },
rules: {
'deslint/no-placeholder-code': 'error',
},
},
];Found a false positive? Report it on GitHub →