WebStorm 代码样式模板 - TypeScript
WebStorm Code Style Templates - TypeScript
目前根据我的 WebStorm IDE 中的 TypeScript 代码样式设置,Angular @Component
装饰器代码的格式如下:
@Component({
selector: 'my-component',
templateUrl: 'my.component.html',
styleUrls: ['my.component.scss']
})
export class MyComponent implements OnInit {
我想要的是执行自动格式时的格式如下:
@Component({
selector: 'my-component',
templateUrl: 'my.component.html',
styleUrls: ['my.component.scss']
})
export class MyComponent implements OnInit {
但是我找不到正确的设置。我在 WebStorm 设置中 Editor > Code Style > Typescript
下的 Tabs and Indents
选项卡上有以下设置:
感谢@jonrsharpe 为我指明了正确的方向,我已经设法解决了这个问题...
在 WebStorm 中转到 文件 > 设置,然后 编辑器 > 代码风格 > Typescript
单击环绕和大括号 选项卡
确保方法调用参数 > 未选中多行复选框时对齐:
目前根据我的 WebStorm IDE 中的 TypeScript 代码样式设置,Angular @Component
装饰器代码的格式如下:
@Component({
selector: 'my-component',
templateUrl: 'my.component.html',
styleUrls: ['my.component.scss']
})
export class MyComponent implements OnInit {
我想要的是执行自动格式时的格式如下:
@Component({
selector: 'my-component',
templateUrl: 'my.component.html',
styleUrls: ['my.component.scss']
})
export class MyComponent implements OnInit {
但是我找不到正确的设置。我在 WebStorm 设置中 Editor > Code Style > Typescript
下的 Tabs and Indents
选项卡上有以下设置:
感谢@jonrsharpe 为我指明了正确的方向,我已经设法解决了这个问题...
在 WebStorm 中转到 文件 > 设置,然后 编辑器 > 代码风格 > Typescript
单击环绕和大括号 选项卡
确保方法调用参数 > 未选中多行复选框时对齐: