vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Better detection of unused variables

Open Nimzozo opened this issue 10 years ago • 4 comments

I don't know for the other languages, but in Javascript, if I write :

var myVar = 0;
myVar = 1;

// Do nothing more with myVar...

myVar is not considered as unused, but it should be.

Nimzozo avatar Feb 18 '16 01:02 Nimzozo

you can do it with a lint tool such as eslint

meritozh avatar Feb 18 '16 02:02 meritozh

@meritozh That's a suggestion. I use JSLint.

Nimzozo avatar Feb 18 '16 02:02 Nimzozo

The new JS infrastructure Salsa will no longer report unused variables and defers this to a linter like JSLint, ESLint. For both ESLint and JSHint there are extensions for Code available.

egamma avatar Feb 18 '16 15:02 egamma

Ok, that's clearer.

Nimzozo avatar Feb 18 '16 15:02 Nimzozo