Rule: no-unused-variable

Disallows unused imports, variables, functions and private class members. Similar to tsc’s –noUnusedParameters and –noUnusedLocals options, but does not interrupt code compilation.

TS Only Has Fixer Requires Type Info


Three optional arguments may be optionally provided:

  • "check-parameters" disallows unused function and constructor parameters.
    • NOTE: this option is experimental and does not work with classes that use abstract method declarations, among other things.
  • {"ignore-pattern": "pattern"} where pattern is a case-sensitive regexp. Variable names that match the pattern will be ignored.
"no-unused-variable": true
"no-unused-variable": [true, {"ignore-pattern": "^_"}]
  "type": "array",
  "items": {
    "oneOf": [
        "type": "string",
        "enum": [
        "type": "object",
        "properties": {
          "ignore-pattern": {
            "type": "string"
        "additionalProperties": false
  "minLength": 0,
  "maxLength": 3