Skip to content

Severity: warning
Category: lint
Stage: Stage 3

Description

An import binding is never referenced in the module (value, type, or JSX position). Unused imports add noise and can hide dead dependencies.

Namespace imports (import * as ns) are only flagged when nothing from ns is used.

Example

// ✗ lint warning — foo is never used
import { foo, bar } from "./m"   // SJS-L009 on foo
bar()

Fix

Remove the unused binding or use it:

// ✓ correct
import { bar } from "./m"
bar()

Configuration

{
  "lint": {
    "L009": "error" | "warn" | "off"
  }
}

Default: "warn" in standard mode, "error" in --strict mode.

  • SJS-L012 — unused top-level declaration
Documentation