'Variable' is declared but its value is never read VScode - visual-studio-code

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?

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.

This not exactly a problem, after reading here I got to the conclusion this warning is actually usefull.
when it happen you know there is no reference to the variable declared on your code.
it ignore mentions made at other files pulling the script, so you got keep this in mind.

Related

How to disable the TS6133 “XXXXX is declared but its value is never used” warning in VSCode?

I am using VSCode version 1.52 and would like to disable the TS6133 “XXXXX is declared but its value is never used” warning.
I did a search and some people suggested turning off the noUnusedLocals in tsconfig.json, but I could not find that file.
Here is a link to that question.
Any leads would be appreciated.

Wrong code color profile applied when file is opened [duplicate]

I updated the vscode to v1_43.
It's too bad to highlight the new syntax.
How to use v1_42 syntax highlighting in v1_43.
prev
new
This is semantic highlighting. Semantic highlights are based on the type of the values, for example globals can be colored differently than local variables.
To disable it, just set:
editor.semanticHighlighting.enabled: false
Try leaving it on however. Semantic highlighting provides useful information and once you get used to it, the old highlighting will instead look wrong

How use prev syntax highlighting for vscode

I updated the vscode to v1_43.
It's too bad to highlight the new syntax.
How to use v1_42 syntax highlighting in v1_43.
prev
new
This is semantic highlighting. Semantic highlights are based on the type of the values, for example globals can be colored differently than local variables.
To disable it, just set:
editor.semanticHighlighting.enabled: false
Try leaving it on however. Semantic highlighting provides useful information and once you get used to it, the old highlighting will instead look wrong

turn off "use spaces, do not use tabs" in a jslint extension for VSCode

I got a VSCode JSLint extension and I got its settings pointing to an .eslintrc file where I have the following specified for indentation:
{
...
"indent" : [1, "tab"]
...
}
The problem is, it's still putting the squiggly green lines where I have some tabs and I can't tell where anything's going wrong with any settings.
I have evidence the rc file is actually working because I was successfully able to change it from single to double-quotes. However it appears to completely ignore the indentation setting inside my VSCode.
You could simply disable the use_spaces rule. It's separate from the indent rule you changed. A bit over an oversight from JSLint.
There were quite a few complains about that rule, even here on SO. Quite a few people (not only on SO) suggest switching to JSHint instead. Personally I've only used ESLint and therefore don't know much about the differences, and I'd suggest checking those for yourself anyway.

IntelliSense autocomplete "on dot" choosing incorrect symbol

I'm editing a stand-alone JavaScript file in VSCode 1.19.2. I do not have a project set up, and no jsconfig.json to control it.
I enter the following code into an empty editor:
var scene = new THREE
Intellisense starts to kick in and gives an auto-complete list.
When I press "." (expecting my code to become THREE.), IntelliSense takes this as a sign that it gave me the right answer, and changes my code to:
var scene = new HTMLHRElement.
The full string "THREE" wasn't even in the list, but IntelliSense seems to be using some kooky regular expression to predict what the user actually tried to type--the letters are all there in the applied symbol, but they're all split up and in different cases.
For me, this is counter-intuitive (not to mention frustrating beyond words, because I type this string a lot), but everything I've found so far is people asking for this feature. So, I'm looking for a work-around for me.
Is there any way to turn off "complete on dot," or maybe a similar setting to force IntelliSense autocomplete only on tab? Also feel free to correct my terminology, in case that was preventing me from finding the correct answer.
JavaScript and TypeScript treat . as accepting the current suggestion by default. You can disable this by setting:
"editor.acceptSuggestionOnCommitCharacter": false
or, if you only want them disabled in js:
"[javascript]": {
"editor.acceptSuggestionOnCommitCharacter": false
}