How to configure IntelliJ / WebStorm to use single quotes in code completion within *.TS, *.JS files
Asked Answered
F

1

6

I work a lot with TypeScript files and JavaScript files using modules.

My TS/ESLint rules enforce the use of single quotes, but WebStorm always completes the code with double quotes. Is there a way to configure this?

Fruit answered 13/9, 2018 at 13:49 Comment(1)
Possible duplicate of WebStorm/PhpStorm double quotes in TypeScript auto importCeballos
B
15

Make sure to set up the desired code style in Settings | Editor | Code Style | TypeScript (and JavaScript) - namely, set Use single quotes always in Punctuation tab. Note that IDEA and WebStorm can import code style prerefences from tslint.json : open it in editor and click Yes when prompted to apply settings. See https://blog.jetbrains.com/webstorm/2017/01/webstorm-2017-1-eap-171-2455/, Import code style from tslint.json

Same is true for .eslintrc - see https://blog.jetbrains.com/webstorm/2017/06/webstorm-2017-2-eap-172-3198/

Bassorilievo answered 13/9, 2018 at 14:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.