how to fix indentation in vscode code example

Example 1: visual studio code auto indent

On Windows Shift + Alt + F
On Mac Shift + Option + F
On Ubuntu Ctrl + Shift + I

Example 2: indent code in vs code

The code formatting is available in Visual Studio Code through the following 
shortcuts:

On Windows : Shift + Alt + F
On Mac : Shift + Option + F
On Linux : Ctrl + Shift + I

Example 3: viscode format automatico

{
    // Controls if the editor should automatically format the line after typing
    "beautify.onSave": true,

    "editor.formatOnSave": true,

    // You can auto format any files based on the file extensions type.
    "beautify.JSfiles": [
        "js",
        "json",
        "jsbeautifyrc",
        "jshintrc",
        "ts"
    ]
}

Example 4: vscode fix indentation issues

If you open the "Show All Commands" tab, ( by pressing Ctrl+Shift+P or F1 ) 
and search for "convert indentation", two options will by available:

"convert indentation to tabs", and "convert indentation to spaces"

Just choose tabs if you use tabs or 
spaces if use spaces as your indentation method.
This should fix most indentation issues