Skip to content

[Wildcard Variables] empty_catches support #57132

@pq

Description

@pq

Today if you want to catch and ignore an exception you can silence empty_catches by adding a comment to the catch clause,

try {
  ...
} catch(e) {
  // ignored, really.
}

With wildcards, I wonder if this shouldn't be sufficient to silence the lint?

try {
  ...
} catch(_) { }

EDIT: this is already how it's implemented but there's an open question about whether we want to start reporting on the non-wildcard (catch(e)) case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions