我正在Visual Studio Code上的Angular项目上工作,我在Typescript文件上得到了一个烦人的格式文档设置,该设置将参数换行到新行:
格式化之前(alt + shift + f):
this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get('assetid');
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get('collateralid');
格式化后(alt + shift + f):
this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get(
'assetid'
);
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get(
'collateralid'
);
我关闭了自动换行功能,但仍尝试将其设置为更大的自动换行列值。查看我当前的设置覆盖
{
"git.confirmSync": false,
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"workbench.iconTheme": "material-icon-theme",
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"editor.wordWrapColumn": 180
}
对我而言"prettier.printWidth": 180
,它不起作用,但事实证明,最新版本的漂亮的产品在每个属性的开头都没有“漂亮的”部分。
因此,.prettierrc
我现在可以"printWidth": 180
解决此问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句