WebStorm和Angular风格指南

时间:2017-07-21 14:53:53

标签: angularjs angular webstorm

有没有办法将角度风格指南整合到WebStorm中?

特别是,自动导入使用双引号而不是单引号,导入{Component}而不是{Component},以及导出:[Component]而不是[Component]。

每次我需要使用CTRL+Shift+L

重新格式化代码时,手动修复是非常烦人的

2 个答案:

答案 0 :(得分:2)

  • Settings | Code Style | Typescript | Spaces中,启用Within / ES6 import/export braces
  • Settings | Code Style | Typescript | Punctuation中,设置使用

答案 1 :(得分:1)

不确定如何解决导入问题,但是,对于使用单引号,

偏好设置 - >编辑 - >代码风格 - >打字稿 - >标点符号(标签) - >第二行 - >在新代码中使用单引号