VS Code Auto Indent / Code Formatting changes single quotation marks to double

后端 未结 2 1581
暗喜
暗喜 2021-01-03 20:01

I am using VS Code 1.17.2 with the following extensions installed (Unfortuanetly i can\'t link them since i don\'t have enough reputation):

  • Angular 5 Snippets
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 20:54

    Daniel B's solution didnt help my case, I needed to follow this: https://github.com/praveenpuglia/angular-sanity/issues/4

    VSCode

    Auto imports are intelligent in VSCode to use tslint.json file in order to insert import statements based on your configuration. But if you are manually writing import statement and accidentally mess that up here's one thing to rescue.

    In User Preferences set the following:

    "tslint.autoFixOnSave": true
    


    Edit: one more thing, I noticed after testing that my issue seemed to boil down to the formatter. I updated my typescript formatter to this:

    "[typescript]": {
        "editor.defaultFormatter": "vscode.typescript-language-features"
    }
    

    after I updated the formatter that - I believe - helped fix the part that was incorrectly updating my code to double quotes

提交回复
热议问题