Visual Studio Code - Adjust import quotation setting

后端 未结 10 1068
广开言路
广开言路 2021-02-02 04:56

When working in TypeScript in Visual Studio Code, the import suggestion on a type (triggered by space + period) will generate an import using double quotes.

Our TypeScri

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 05:16

    You can also configure the below line in your vscode user settings to allow single quote in string.

    Go to Preferences > User Settings

    "prettier.singleQuote": true
    

    This will allow single quote in String. Otherwise, if you manually change all double quotes to single quotes it will revert back while saving. Also, add

    "tslint.autoFixOnSave": true
    

    to auto-fix while saving.

提交回复
热议问题