Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsTo use @typescript-eslint/no-unused-vars, disable ESLint’s core no-unused-vars rule, then configure an underscore ignore pattern separately for each name category your project wants to exempt. The official example uses ^_. A variable pattern alone does not exempt unused arguments, caught errors, or destructured array elements.
Enable the TypeScript-aware rule
@typescript-eslint/no-unused-vars extends ESLint’s core unused-variable rule with support for TypeScript features, including types. The typescript-eslint rule documentation warns that the core rule can report incorrect errors for TypeScript, so turn it off when enabling the extension.
As an Amazon Associate I earn from qualifying purchases.
export default defineConfig({
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
},
});
This is the flat-config form. The documentation also provides a legacy configuration form. Extending plugin:@typescript-eslint/recommended enables the rule as well.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →How to ignore underscore-prefixed names
Set ^_ as the ignore pattern for each category where a leading underscore means “intentionally unused.” These are independent settings: varsIgnorePattern does not set a policy for arguments, caught errors, or destructured array elements.
#1 Best Overall
{
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}
This follows the official FAQ’s example for emulating TypeScript’s underscore exemption. The args: "all" and caughtErrors: "all" settings make the corresponding ignore patterns relevant to all arguments and caught errors. ignoreRestSiblings: true handles the documented rest-sibling case. Keep only the exemptions that match your project’s convention.
Which underscore settings control which names?
| Setting | Applies to |
|---|---|
varsIgnorePattern |
Variables |
argsIgnorePattern |
Function arguments |
caughtErrorsIgnorePattern |
Caught errors |
destructuredArrayIgnorePattern |
Destructured array elements |
For example, if your policy exempts only underscore-prefixed variables, configure varsIgnorePattern without assuming it changes argument handling. Add the other patterns only if those categories should follow the same convention.
Rank #2
- TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
- TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
How this differs from TypeScript compiler checks
TypeScript’s noUnusedLocals and noUnusedParameters compiler options can report unused locals and parameters. The lint rule offers configurable exemptions such as varsIgnorePattern, and ESLint can be configured for lines, files, and folders; compiler options are tied to a TSConfig. Compiler errors may also block builds more directly than lint findings. The typescript-eslint documentation recommends its rule for flagging unused locals and parameters.
Disabling those compiler options does not guarantee that an editor will stop visually dimming unused variables: for example, VS Code may still grey them out.
Should the rule automatically remove unused imports?
By default, the TypeScript-specific enableAutofixRemoval.imports option is false. Unused imports receive suggestion fixes rather than automatic fixes. Setting it to true allows automatic removal; if every specifier in an import declaration is unused, the declaration is removed.
Use automatic removal only if your codebase does not rely on import side effects. An import can execute module code even when its imported binding is not referenced, so automatic deletion may change runtime behavior in projects that depend on that behavior.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why can apparently used code still be reported?
A variable is used only in a type position
The rule does not count a variable used only for a type as used. The documentation illustrates this with typeof and a Zod schema. If a runtime value exists only to derive a type, consider whether a direct type declaration better expresses the intent.
A name appears in a JSDoc link
JSDoc @link references are not recognized as uses by this rule. The documentation points to a separate JSDoc rule as a possible way to address undefined references.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




