TS6133: 'value' is declared but its value is never read
noUnusedLocals and noUnusedParameters report TS6133 on dead bindings. Find which config enabled the flag, then fix locals, imports and parameters.

Introduction & Quick Summary
error TS6133: 'value' is declared but its value is never read. is not a type error. It is noUnusedLocals or noUnusedParameters reporting that a binding was created and never referenced, and the compiler treats an unused binding as dead code worth failing the build over.
The four things that actually produce it:
- A strict base config enabled it for you.
"extends"pulls the flag from a shared preset, so it appears without anyone editing the project's owntsconfig.json. - Editor and CLI use different TypeScript versions, so one reports a clean file and the other fails in CI.
- Only parameters starting with
_are exempt.value_,unusedValue, and ESLint disable comments do nothing fortsc. - Destructuring with a rest element is still reported.
const { secret, ...rest } = configfails whensecretis unused, because TypeScript has noignoreRestSiblings.
| Diagnostic | Reported for | Typical trigger | Fix shape |
|---|---|---|---|
TS6133 | Local, parameter, import binding | Any binding never read | Remove it, _ prefix a parameter, or read it |
TS6196 | Interface, type alias, enum never used | Type-only dead code | Delete it or export it |
TS6198 | Destructuring where every element is unused | const { a, b } = x with nothing used | Drop the statement |
TS6192 | An entire import declaration | Neither imported name used | Remove the import |
TS6138 | A private class member | Dead private field or method | Delete the member |
Core Mechanics, Signatures & Reproducible Setup
noUnusedLocals reports locals, imports, and unused type declarations. noUnusedParameters reports parameters of functions, methods, constructors, and arrows. Neither reports public or protected members, exported declarations, or anything addressed from outside the module, because the compiler cannot prove those unused across compilation units.
A reproducible failure needs two files:
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmit": true
},
"include": ["src"]
}// src/report.ts
import { readFileSync, existsSync } from "node:fs";
export function loadReport(path: string, verbose: boolean): string {
const prefix = "[report] ";
const exists = existsSync(path);
if (!exists) return prefix + "missing";
return prefix + readFileSync(path, "utf8");
}src/report.ts:1:31 - error TS6133: 'existsSync' is declared but its value is never read.
1 import { readFileSync, existsSync } from "node:fs";readFileSync and exists are read, so they pass. verbose is never read, so noUnusedParameters fails it too. The same file with both flags off compiles silently, which is why this appears after a config change rather than a code change. The flags are independent: fixing only locals leaves the parameter report in place.
Key Comparison Table
The report set decides where the build breaks and where an editor squiggle appears.
| Tool | Unused locals | Unused params | Unused private members | Template-only usage |
|---|---|---|---|---|
tsc with noUnusedLocals | Yes | No | Yes (TS6138) | No, cannot see templates |
tsc with noUnusedParameters | No | Yes | No | No |
ESLint no-unused-vars | Yes | Yes | No | With a plugin parser |
ESLint @typescript-eslint/no-unused-vars | Yes | Yes, with args: "after-used" | No | With a plugin parser |
How to keep a binding without reading it depends on intent, and only some of these satisfy the compiler.
| Intent | Technique | Silences TS6133 | Notes |
|---|---|---|---|
| Parameter required by a signature | _verbose: boolean | Yes | Leading underscore only |
| Deliberately discard an expression | void compute() | Yes | Reader-level intent is explicit |
| Value present only for rest collection | const { secret, ...rest } = config | No | TypeScript reports secret |
| Used by a decorator or framework | export const used = value | Yes | Exporting makes it reachable |
| Used only in an SFC template | vue-tsc or svelte-check | n/a | Plain tsc cannot see it |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
The leading underscore rule and where it stops
TypeScript exempts a parameter whose name begins with _. It does not exempt locals, so const _cache = build() still fails, and it does not exempt imports.
// fails: locals are never exempt
const _cache = new Map<string, number>();
// passes: parameter exemption
export function render(node: unknown, _depth: number): string {
return String(node);
}When a parameter exists only to satisfy a callback signature, the underscore communicates intent. When a local exists because half a refactor shipped, delete it.
Destructuring with a rest element
This is the case that surprises teams from ESLint, where ignoreRestSiblings: true is common and has no TypeScript equivalent.
type Account = { id: string; token: string; plan: string };
export function publicAccount({ token, ...safe }: Account): Omit<Account, "token"> {
return safe; // token is never read -> TS6133
}type Account = { id: string; token: string; plan: string };
export function publicAccount(input: Account): Omit<Account, "token"> {
return { id: input.id, plan: input.plan };
}
// acceptable when the shape is large: underscore the binding
export function strip({ token: _token, ...safe }: Account) {
return safe;
}The explicit projection is the readable fix: it names the fields a caller may see. The underscore form compiles too, since destructured parameters follow the parameter rule.
Private members, getters and read-only fields
TS6138 fires only for private members. A protected member is reported nowhere, because a subclass in another file could use it. A field that is written but never read still counts as unused: assignment is not a read.
export class RateLimiter {
private readonly windowMs = 60_000;
private last = 0; // written below and read in the comparison
constructor(private budget: number) {}
allow(now: number): boolean {
if (now - this.last > this.windowMs) this.last = now;
return this.budget > 0;
}
}Delete the comparison and TS6138 appears on the field declaration, not on the assignment.
verbatimModuleSyntax and type-only imports
With verbatimModuleSyntax: true, every import that survives to the emitted file must be a value import. A type imported without type is either an error or an unused binding, and the diagnostic is often TS6133 on the type name rather than a hint about syntax.
// fails: the import is emitted, but only a type is used
import { User } from "./types.js";
export function name(user: User): string {
return user.name;
}// passes: erased at emit
import type { User } from "./types.js";
export function name(user: User): string {
return user.name;
}Overloads and implementation signatures
An overload signature is not compiled, so only the implementation is checked. A parameter present to match an overload's arity but unused by the implementation fails, and renaming it in the overload does not help.
export function parse(input: string): number;
export function parse(input: string, radix: number): number;
export function parse(input: string, radix: number): number {
return Number.parseInt(input); // radix is never read -> TS6133
}export function parse(input: string, radix?: number): number {
return radix === undefined ? Number(input) : Number.parseInt(input, radix);
}Using the parameter is usually a bug fix rather than a suppression: the overload promised the behaviour and the implementation ignored it.
Frameworks that read values indirectly
Template compilers and dependency injection read bindings in ways plain tsc cannot see, so a value used only from a Vue SFC or Angular template is reported as unused.
npx vue-tsc --noEmit # checks SFC templates
npx ng build # Angular reads template bindings
npx tsc --noEmit # templates are invisible hereIf the pipeline must stay on tsc, keep the unused-value check in the framework-aware tool and set noUnusedLocals to false for the plain type check, instead of sprinkling underscores through template-facing code.
Common Compilation/Runtime Mistakes & Version Gotchas
Assuming extends inherits nothing. It inherits noUnusedLocals, noUnusedParameters, strict, and paths, but not include, exclude, or files.
Turning the flag off instead of the dead code on. "noUnusedLocals": false compiles, but it also stops the compiler from finding genuinely dead branches after a refactor.
Using @ts-ignore on the report. These suppress type errors on the next line. TS6133 is reported on the binding, and @ts-expect-error becomes an error of its own once the dead code is removed.
Expecting ESLint's ignoreRestSiblings to apply. The two tools have separate exemption lists, so a file can pass ESLint and fail tsc in the same commit.
Believing void is a general suppressor. void value reads the value, so it compiles, but an unhandled rejection is still a runtime problem. Use it only for genuinely fire-and-forget results.
Version notes. Both flags exist since TypeScript 2.0 and are unchanged through 5.x. verbatimModuleSyntax arrived in 5.0 and replaced importsNotUsedAsValues; configs that still set the removed option fail to parse. TS6196 and TS6198 came with the 4.x diagnostic rework, so older compilers report the same dead code under TS6133. Next.js enables neither flag by default, so a sudden failure usually means a strict preset was added in the same PR.
Triage order: run tsc --showConfig to see which file enabled the flag, then split the report into parameters (underscore or use), imports (remove or import type), and locals (delete). When the list is long, dump it and scan the deduplicated names with the regex tester, and compare two resolved configs with the text diff.
Official references: noUnusedLocals and noUnusedParameters.
Official references
primary documentationThe TypeScript documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit TypeScript work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related TypeScript guides
All TypeScript guidesTS1294: This syntax is not allowed when erasableSyntaxOnly is enabled
Enums, namespaces and parameter properties emit code, so erasable mode rejects them. Convert each to an erasable form without changing call sites.
TS2742: the inferred type cannot be named without a reference
Type checking passes and only declaration emit fails. Annotate the exported boundary so consumers can resolve the emitted type.
ESLint 9: the flat config error and why .eslintrc stopped loading
Flat config is one array, one root file, and no string extends. Here is the conversion, the four settings with no equivalent, and the editor trap.
TypeScript 7 native tsc: moduleResolution, baseUrl and API errors
The native compiler changes three defaults and drops the compiler API. Fix tsconfig first, then alias TypeScript 6 for eslint and ts-node.
More in TypeScript
All TypeScript guidesThe guides filed next to this one in TypeScript, in library order.