You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
) ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
VS Code Version:
OS Version:
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes/No
BUG: THIS IS NOT THE SAME AS THE OTHER ISSUE. IF IT IS, THERE IS NO SOLUTION STATED
When I type this code into MY vs code:
const name = 'Roger'
console.log(name)
When I type that code into MY vs code, vs code forces the word 'name' in the console.log statement to have a strike through. It only happens with the word 'name'. I can type any other word and no strikethrough.
Now, even though this happens, it still prints the output fine. So the output for the above code in my vs code is:
Roger
So the statement prints to the console fine, but I dont understand why only MY vs code is bahaving this way. I am the only student in the class with this problem and the teacher was unable to reproduce my problem in their mac vs code.
When I put the cursor on the word 'name' with the strikethrough in the console.log statement, intellisense says:
const name: void @deprecated
'name' is deprecated ts (6385)
no quick fixes available
UPDATE: I have no extensions on my vs code
VS Code version: Code 1.53.2 (622cb03, 2021-02-11T11:48:04.245Z)
OS version: Windows_NT x64 10.0.19042
System InfoExtensions: none
A/B Experiments
The text was updated successfully, but these errors were encountered:
This is design limitation of TS - you don't have import/export which means your code is in global scope and overlaps with global name which is marked as deprecated to avoid unintentional use (Make typo variable declaration in const nome ... or if you add several scripts to page and forget to add file that declares name then all code below would use global name instead of your variable).
You should either force module scope or don't use name. And track TS issue for updates and provide feedback there.
I was following the code of a teacher in a node.js course. His code had no problem and he never told us to change anything in our vs code after we installed it.
Why didnt the teacher have this problem when typing in THEIR vs code?
How can I force module scope?
So I shouldnt use the term 'name' then? When coding in vs code...ever?
If it's recording or old VS Code version it might not be there yet - this behavior appeared in VS Code only in 1.52 (early December).
If you use modules then import/export statements will force file as module.
But if you don't use modules and write code that won't be run in browser you'll need to create jsconfig.json (see TSConfig Reference and node12 for example) and configure lib to NOT include dom.
[<!--](url
)⚠️ ⚠️ Do Not Delete This! bug_report_template ⚠️ ⚠️ -->
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes/No
BUG: THIS IS NOT THE SAME AS THE OTHER ISSUE. IF IT IS, THERE IS NO SOLUTION STATED
When I type this code into MY vs code:
const name = 'Roger'
console.log(name)
When I type that code into MY vs code, vs code forces the word 'name' in the console.log statement to have a strike through. It only happens with the word 'name'. I can type any other word and no strikethrough.
Now, even though this happens, it still prints the output fine. So the output for the above code in my vs code is:
Roger
So the statement prints to the console fine, but I dont understand why only MY vs code is bahaving this way. I am the only student in the class with this problem and the teacher was unable to reproduce my problem in their mac vs code.
When I put the cursor on the word 'name' with the strikethrough in the console.log statement, intellisense says:
const name: void
@deprecated
'name' is deprecated ts (6385)
no quick fixes available
UPDATE: I have no extensions on my vs code
VS Code version: Code 1.53.2 (622cb03, 2021-02-11T11:48:04.245Z)
OS version: Windows_NT x64 10.0.19042
System InfoExtensions: none
A/B Experiments
The text was updated successfully, but these errors were encountered: