microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.82k stars 29.5k forks source link

Compile Time error is not showing while changing the value of const variable value #231560

Open yogesh0748 opened 1 month ago

yogesh0748 commented 1 month ago

Type: Bug

function f(){

  const s=5;
   s=2;
   console.log(s);

}

The problem in this code is "It is not showing the syntax error in this block of code".

VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 3 3250U with Radeon Graphics (4 x 2595)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|5.94GB (1.06GB free)| |Process Argv|--crash-reporter-id 5b164ad5-bfca-4dfb-8662-8defa4bb4013| |Screen Reader|no| |VM|0%|
Extensions (25) Extension|Author (truncated)|Version ---|---|--- html-snippets|abu|0.2.1 bracket-pair-color-dlw|Bra|0.0.6 es7-react-js-snippets|dsz|4.4.3 prettier-vscode|esb|11.0.0 auto-rename-tag|for|0.1.10 debugpy|ms-|2024.10.0 python|ms-|2024.16.1 vscode-pylance|ms-|2024.10.1 jupyter|ms-|2024.9.1 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.19 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 vscode-thunder-client|ran|2.27.6 java|red|1.35.1 LiveServer|rit|5.7.9 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-gradle|vsc|3.16.4 vscode-java-debug|vsc|0.58.0 vscode-java-dependency|vsc|0.24.0 vscode-java-pack|vsc|0.29.0 vscode-java-test|vsc|0.42.0 vscode-maven|vsc|0.44.0 five-server|yan|0.3.1
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementsc:30995553 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 f3je6385:31013174 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 impr_priority:31102340 nativerepl1:31139838 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 wkspc-ranged-t:31151552 cf971741:31144450 defaultse:31146405 iacca2:31156134 notype1:31157159 5fd0e150:31155592 ```
albertosantini commented 1 month ago

Do you mean the linter doesn't show any error when you assign a value to the const var?

Please, read https://code.visualstudio.com/Docs/languages/javascript

Hope that helps.