WebStorm 和 Angular 风格指南

WebStorm and Angular Style Guide

有没有办法将 angular 的风格指南集成到 WebStorm 中?

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

每次我需要用 CTRL+Shift+L

重新格式化我的代码时手动修复这真的很烦人

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

首选项 --> 编辑器 --> 代码风格 --> Typescript --> 标点符号(制表符) --> 第二行 --> 在新代码中使用单引号

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