Microsoft/TypeScript

JSX attributes should use double quote by default

Open

#50,541 建立於 2022年8月30日

在 GitHub 查看
 (0 留言) (3 反應) (0 負責人)TypeScript (48,455 star) (6,726 fork)batch import
Experience EnhancementHelp WantedSuggestion

描述

Like prettier default behavior: Although you set using single quotes in javascript, but jsx attributes still using double quotes.

prettier playgound

I think the reason is jsx isn't toatally javascript, it's also mark language. When deal with jsx attributes, we should using mark language quotes style.

In fact, react users may using the single quote or double quotes for javascript. But every users must use double quotes for jsx attributes.

Like https://github.com/microsoft/vscode/issues/143164#issuecomment-1042328896 comment, we may need a new setting for this.

Version: 1.71.0-insider (Universal)
Commit: 16faaf4eb07424d5d7dba7d12bffd64309c283f7
Date: 2022-08-29T15:28:34.899Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 21.6.0
Sandboxed: Yes

@mjbvz @nifte @rzhao271

https://user-images.githubusercontent.com/41773861/187392236-3e748945-9eb3-4ea9-84c4-eba094ac2159.mov

貢獻者指南