Reputation: 2046
When I push cmd + alt + l
Webstorm doing some reformating to beautify my JavaScript sources. Ho to make Webstorm automatically change double quotes to single quotes in my sources?
Upvotes: 97
Views: 33928
Reputation: 2574
In Webstorm 2017.1, do the following:
Use 'double' quotes
to Use 'single' quotes
. (Additionally, you can change 'in new code'
to 'always'
)Upvotes: 208
Reputation: 93868
there is no way to change this on auto-formatting in WebStorm 11; you can only use intentions here (hit Alt+Enter
on quoted string, choose 'Replace double-quoted string with single-quoted string'.
Note that in WebStorm 12 -2016.x it's possible to control the auto-generated quotes style (used for auto-imports, etc.) - Settings | Editor | Code Style | JavaScript | Other
, Generated code/Quote marks
.
Since 2017.1.*, it is Settings | Editor | Code Style | JavaScript | Punctuation
, Use <quote style> quotes in <new code/always>
Upvotes: 39
Reputation: 2110
Please see the answer of https://stackoverflow.com/a/42909782/2000468.
this answer is for an older version。
see the picture that let you set it quickly.
Upvotes: 4
Reputation: 141
This looks to be fixed with the 2016.2 release - there's now an option in the Editor --> Code Style settings where you can choose single/double quotes.
See https://blog.jetbrains.com/webstorm/2016/07/webstorm-2016-2-drag-files-into-html-and-quotes-style/
Upvotes: 12