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

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 →

Back to all rules