在VS Code中强制多行打字稿构造函数

cat*_*atu 6 typescript tslint visual-studio-code

我正在设置一些tslint规则,以使我和我的团队更好地遵守我们的代码合同。是否有任何办法可以使用tslint或一般vs代码来强制使用多行构造函数

例如

这个

  constructor(
    private coreWebServices: CoreWebServices,
    private deviceDiscoveryService: DeviceDiscoveryService,
    private eventsService: EventsService,
    private log: LogService,
    private newsService: NewsService,
    private route: ActivatedRoute,
    private router: Router,
    private runtimeService: RunTimeService
  ) {  }
Run Code Online (Sandbox Code Playgroud)

代替这个

constructor(private coreWebServices: CoreWebServices, private deviceDiscoveryService: DeviceDiscoveryService, private eventsService: EventsService, private log: LogService, private newsService: NewsService, private route: ActivatedRoute, private router: Router, private runtimeService: RunTimeService)
   { }
Run Code Online (Sandbox Code Playgroud)

Igo*_*nko 0

不幸的是,TSLintESLint似乎都没有您正在寻找的规则。

最接近的是align+ "parameters",但我没有看到一种仅使用构造函数来配置它的方法。