VS Code自动缩进/代码格式化将单引号更改为双引号 [英] VS Code Auto Indent / Code Formatting changes single quotation marks to double

查看:1269
本文介绍了VS Code自动缩进/代码格式化将单引号更改为双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是VS Code 1.17.2,并安装了以下扩展程序(不幸的是,由于信誉不佳,我无法链接它们):

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代码片段-TypeScript,Html,Angular Material,ngRx,RxJS& Flex布局
  • Angular Essentials
  • 角度语言服务
  • Angular v5 TypeScript代码段
  • angular2-inline
  • 自动导入
  • Chrome调试器
  • 用于VS Code的EditorConfig(因为Angular Essentials依赖于它)
  • HTML代码段
  • 用于CSS类名称的IntelliSense
  • 材质图标主题
  • 路径智能感知
  • PHP IntelliSense
  • 更漂亮-Javascript格式化程序
  • TSLint
  • Visual Studio团队服务
  • vscode-icons
  • 冬天来了
  • Angular 5 Snippets - TypeScript, Html, Angular Material, ngRx, RxJS & Flex Layout
  • Angular Essentials
  • Angular Language Service
  • Angular v5 TypeScript Snippets
  • angular2-inline
  • Auto Import
  • Debugger for Chrome
  • EditorConfig for VS Code (since Angular Essentials depends on it)
  • HTML Snippets
  • IntelliSense for CSS class names
  • Material Icon Theme
  • Path Intellisense
  • PHP IntelliSense
  • Prettier - Javascript formatter
  • TSLint
  • Visual Studio Team Services
  • vscode-icons
  • Winter Is Coming Theme

当自动格式化TypeScript文件(Shift + Alt + F)时,它会执行缩进,但是还会将所有单引号更改为双引号,这使TSLint抱怨.我很确定自动缩进不应该这样做,这确实很烦人.

When auto formatting a TypeScript file (Shift + Alt + F), it does the indent right, but it also changes all single quotation marks to double quotation marks, which makes TSLint complain. I am pretty certain the auto indent is not supposed to do that and it really is annoying.

任何帮助将不胜感激.

推荐答案

扩展使用在VS Code用户设置文件中设置的设置.

The extensions uses the settings that are set in your VS Code user settings file.

要更改它,请打开您的用户设置文件

To change it, open your user settings file

Ctrl + Shift + P 并键入Open User Settings.

Ctrl+Shift+P and type Open User Settings.

搜索prettier.singleQuote并将其更改为true

Search for prettier.singleQuote and change it to true like

"prettier.singleQuote": true

这篇关于VS Code自动缩进/代码格式化将单引号更改为双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆