12

As far as I know it seems this is the setting you enter in your settings.json to enable unused variables & imports that aren't used to appear grayed out.

"editor.showUnused": true,

I do get an underline and if you hover I get an underline and message on hover.

What am I missing?

enter image description here

Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141

5 Answers5

16

In my settings.json apparently I commented that the following did the trick.

 "javascript.validate.enable": true,

/* this controls having your unused imports or variables to appear grey */
Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141
5

*** builtin language features extension solution:**

I am adding this just in case someone gets stuck like me. I had the same issue and the following was the problem.

vscode has @builtin extensions. One of them is typescript and javascript language features. If it is disabled the features will not work. So just go to extension and search @builtin typescript and javacsrtipt language feature, click the cog icon and enable the extension.

aviya.developer
  • 3,343
  • 2
  • 15
  • 41
3

September 2020

For me, adding "editor.showUnused": true, in settings.json in the .vscode directory worked.

Davis Jones
  • 1,504
  • 3
  • 17
  • 25
1

In my case deno extension was causing the problem. disabling it seems to fix the issue.

Hayyaun
  • 303
  • 3
  • 10
1

None of the above solutions worked for me. I needed to install the ESLint vscode extension (the one with over 25 million downloads) then it started working again.

Ts1
  • 51
  • 2