Skip to content

Add ESLint config to suppress no-unused-vars rule for variables with leading underscore #24

@DylanSp

Description

@DylanSp

argsIgnorePattern - https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern - should work fine.

destructuredArrayIgnorePattern - https://eslint.org/docs/latest/rules/no-unused-vars#destructuredarrayignorepattern

  • Had issues on laptop (Windows + WSL) - still reported a warning from the eslint no-unused-vars rule directly, not the @typescript-eslint wrapper (which is what warned for arguments)
  • Test case (should not warn for _b if rule is properly suppressed):
const [a, _b, c] = ["a", "b", "c"];
console.log(a+c);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions