Skip to content

Ignore certain variables when using --noUnusedLocals #13048

Description

@alinhle

I want to use destructuring of objects while being able to ignore certain parameters. But with --noUnusedLocals I get an error.

const {
  children,
  active: _a,
  ...rest,
} = props;
'_a' is declared but never used.

I formerly used the tslint rule no-unsued-variable which supported ignoring any variable having a certain pattern, e.g. any name starting with a _. As tslint deprecated no-unsued-variable in favor of noUnusedLocals I cannot rely on tslint anymore.

Is this something which can be supported, or do I need to port over something like lodash.omit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions