0

enter image description here

Hey, that's the code I am working with.

When I am declaring a type this error is shown.

So Eslint thinks that I have to use this var and, instead I am returning void.

To use
// eslint-disable-line
comment is not an option because I want to avoid unnecessary comments. Also I don't want to set it in Eslint configuration.

How should I overcome this issue? Thanks!

  • What does you eslint config look like? [Does this help you](https://stackoverflow.com/questions/57802057/eslint-configuring-no-unused-vars-for-typescript)? – Adam Jenkins Jan 04 '22 at 13:25
  • @Adam changing eslint config is not an option for me. But this issue is caused because of "no-unused-vars" is not enabled. – Robertas Ankudovicius Jan 04 '22 at 13:29
  • Please post code as text, not as a painting. – Bergi Jan 04 '22 at 13:33
  • @RobertasAnkudovicius - you say you don't want to disable the rule, and you don't want to edit the eslint configuration, so I guess you're out of luck. If you don't want to fix your problem using the tools you have available, how do you expect to fix it? You want to disable lint in CI or during build or something? Maybe turn off your editors eslint warnings? Your two options are 1) edit eslint, or 2) use //eslint-disable – Adam Jenkins Jan 04 '22 at 13:37
  • @Adam yes, you're right. My mistake was to think that there are only the way to disable all unused vars, but appears that there is a way to disable only args on type declaration. Cheers! – Robertas Ankudovicius Jan 04 '22 at 14:12

1 Answers1

-1

So I found a way to solve this issue. My mistake was to think that there is only the way to disable all unused vars, but appears that there is a way to disable only args on type declaration.

To disable only args you have to go to .eslintrc file and add rule: "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],