3 ms·
Microsoft are actively hostile towards JavaScript now. I have been monitoring the progress of vscode's support for JavaScript and noticed that it now clearly a
by shadowofasun 5y ago
Microsoft are actively hostile towards JavaScript now. I have been monitoring the progress of vscode's support for JavaScript and noticed that it now clearly a second class citizen. The TypeScript compiler now declares valid and working JavaScript as having errors, and these are displayed to the user in vscode. One example is the usePrevious hook as mentioned on the react website. If you mouse over its signature in vscode, you will see it is undefined -> undefined. This is because useRef() has no argument, and the generic type is inferred from this argument, and JavaScript has no way to do useRef<T>();
- TranquilMarmot 5y agoTurning this off is as easy as flipping a switch in the settings. In the interest of making things easier for beginners (which is a good goal to have) I think it makes sense for type-checking to be enabled in JavaScript files by default.