Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Variable' is declared but its value is never read VScode

I recently switched from Sublime to VScode - one thing that's been bothering me is that when functions and variables are not used, they are grayed out like a comment, with the message on hover,

'myVariable' is declared but its value is never read.

I can't find any setting to disable this syntax behavior in 'user settings', and I don't have an linter installed either. How do I change this?

like image 276
Kevin Avatar asked Jun 18 '18 18:06

Kevin


1 Answers

Setting :

"javascript.showUnused": false,

and

"typescript.showUnused": false,

if you are using those languages will eliminate the gray font and the hover message.

Additionally, for those using esLint you will get the squiggly under unused variables unless you put

"no-unused-vars": 0,

in .eslintrc.json file in your workspace.

like image 116
Mark Avatar answered Sep 23 '22 10:09

Mark