Comillas dobles de WebStorm / PhpStorm en la importación automática de TypeScript
Estoy usando el estilo TypeScript con comillas simples, las comillas dobles se usan exclusivamente en plantillas HTML.
WebStorm/PhpStorm auto import agrega instrucciones import
con comillas dobles y arruina el estilo. Supongo que esto se aplica a todos los productos JetBrains.
¿Cómo se puede corregir este comportamiento?
5 answers
Este comportamiento se controla mediante la siguiente opción:
Settings/Preferences
Editor | Code Style | TypeScript
"Punctuation" tab | Generated code -> Quote marks
A partir de la versión 2017.1 está en la nueva pestaña Punctuation
y las opciones tienen un nombre un poco diferente:
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-21 10:51:58
También si desea agregar espacio automático entre llaves al agregar importaciones como así
import { MyComponent } from './my.component';
Puede marcar la pestaña Spaces | Whithin | ES6 import/export braces
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-07-18 12:22:54
En octubre 2017
así es como lo hacemos:
- Ir a ajustes
- Escriba
Code style
en la búsqueda - Seleccione
Typescript
- Vaya a
Punctuation
sección - Seleccione
single
comillas
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-10-24 09:07:46
La pestaña Puntuación lo hizo. También eliminé el punto y coma al final, pero ahora TSLint lo falta
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-17 10:40:10
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-04-17 17:55:21