VSCode single to double quote automatic replace

前端 未结 22 1552
死守一世寂寞
死守一世寂寞 2021-01-30 12:03

When I execute a Format Document command on a Vue Component.vue file VSCode replace all single quoted string with double quoted string.

In my specific case

22条回答
  •  忘了有多久
    2021-01-30 12:33

    Try one of these solutions

    1. In vscode settings.json file add this entry "prettier.singleQuote": true
    2. In vscode if you have .editorconfig file, add this line under the root [*] symbol quote_type = single
    3. In vscode if you have .prettierrc file, add this line
    {
        "singleQuote": true,
        "vetur.format.defaultFormatterOptions": {
            "prettier": {
                "singleQuote": true
            }
        }
    }
    

提交回复
热议问题