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?

Author: LazyOne, 2016-09-29

5 answers

Este comportamiento se controla mediante la siguiente opción:

  1. Settings/Preferences
  2. Editor | Code Style | TypeScript
  3. "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:

introduzca la descripción de la imagen aquí

 317
Author: LazyOne,
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

 53
Author: Leo,
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:

  1. Ir a ajustes
  2. Escriba Code style en la búsqueda
  3. Seleccione Typescript
  4. Vaya a Punctuation sección
  5. Seleccione single comillas

introduzca la descripción de la imagen aquí

 20
Author: yami,
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

 10
Author: Yoraco Gonzales,
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

Para la versión Intellij 2016.3 está en Otra pestaña > Código generado > Comillasintroduzca la descripción de la imagen aquí

 2
Author: VinPro,
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