Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show warnings, errors, functions, variables in VSCode with JavaScript/Nodejs

Is it possible to show warnings (not used variables / typo), errors and an overview about my created variables and functions in an open file?

I have installed the newest Visual Studio Code IDE but if I press Ctrl + P and then !, my VSCode says there are no results. It doesn't know !-command and other commands I found in the internet.

What extension/addon do I have to install to see this? It would be great if I could see this in a separate window without using Ctrl + P and if the IDE would mark positions with warnings/errors in my open code as Eclipse-IDE can do.

like image 391
Meteor Newbie Avatar asked Jun 23 '17 17:06

Meteor Newbie


People also ask

How do I show warnings in VS Code?

Errors & warnings# You can click on the summary or press Ctrl+Shift+M to display the PROBLEMS panel with a list of all current errors. If you open a file that has errors or warnings, they will be rendered inline with the text and in the overview ruler.

How do you show functions in VS Code?

For jumping to function in currently opened file use Ctrl+Shift+O . From docs: You can navigate symbols inside a file with Ctrl+Shift+O. By typing : the symbols will be grouped by category.

How do I display JavaScript output code in Visual Studio?

Open the JavaScript code file in Text Editor, then use shortcut Control + Alt + N (or ⌃ Control + ⌥ Option + N on macOS), or press F1 and then select/type Run Code , the code will run and the output will be shown in the Output Window.

How do I Debug node js code VS Code?

There are a few ways you can debug your Node.js programs in VS Code: Use auto attach to debug processes you run in VS Code's integrated terminal. Use the JavaScript debug terminal, similar to using the integrated terminal. Use a launch config to start your program, or attach to a process launched outside of VS Code.


1 Answers

Use Eslint. Install it globally using the following command
npm install -g eslint

It will show all possible warnings based on the rule sets given, while you are coding. Moreover VSCode is not an IDE it's just Code Editor like Sublime.

like image 95
Bharathvaj Ganesan Avatar answered Nov 15 '22 06:11

Bharathvaj Ganesan