Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@typescript-eslint/no-unused-vars does not behave well with interfaces #579

Open
bcoe opened this issue Oct 11, 2020 · 0 comments
Open

@typescript-eslint/no-unused-vars does not behave well with interfaces #579

bcoe opened this issue Oct 11, 2020 · 0 comments

Comments

@bcoe
Copy link
Contributor

bcoe commented Oct 11, 2020

I noticed when switching yargs to use gts for linting, that variables inside an interface are flagged as unused by no-unused-vars:

export interface YargsInstance {
  $0: string;
  argv: Arguments;
  customScriptName: boolean;
  parsed: DetailedArguments | false;
  // The methods below are called after the parse in yargs-parser is complete
  // and perform cleanup on the object generated:
  _postProcess<T extends Arguments | Promise<Arguments>>(
    argv: T,
    populateDoubleDash: boolean,
    calledFromCommand?: boolean
  ): T;
  _copyDoubleDash<T extends Arguments>(argv: T): T;
  _parsePositionalNumbers<T extends Arguments>(argv: T): T;

Will lead to warnings like:

  1748:5   warning  'populateDoubleDash' is defined but never used     @typescript-eslint/no-unused-vars

The actual definition of self._postProcess does have the populateDoubleDash variable, and uses it.

Refs: yargs/yargs#1777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant