Search code examples
typescriptvisual-studio-codets-standard

Setup VSCode and ts-standard


I have to set up VScode and ts-standard; I thought I did it successfully. In the project workspace, I added .vscode/settings.json

{
  "standard.engine": "ts-standard"
}

The issue is when I try to save a file, the decorator and the field are aligned to two spaces, and the error is

Expected indentation of 4 spaces but found 2. (@typescript-eslint/indent)ts-standard(@typescript-eslint/indent)

The decorator should have two spaces and the field four.

It would probably work if I turned off the onSave trigger and manually corrected it. But I would like that this task is automatically computed.


Solution

  • This was the solution

    I have to install this extension StandardJS - JavaScript Standard Style

    Then, in the plugin extension settings

    enter image description here

    Switch the Standard: Engine to ts-standard

    enter image description here

    And leave my settings.json

    {
      "standard.engine": "ts-standard"
    }
    

    What I was missing was the pluging