我想知道是否有规则在带有 prettier 的打字稿中的函数/语句和注释之间添加新行(项目根目录下的 .prettierrc )。
当前行为:
} else if (request.type === 'membership-fee') {
/**
* If type is membership fee
*/
this.form.get('total')?.setValue(this.gym?.membership_fee?.total);
} else {
/**
* Operation type not recognized
*/
this.toast.error('Tipo di operazione non riconosciuto');
($('#editSaleModal') as any).modal('hide');
}
Run Code Online (Sandbox Code Playgroud)
期望的行为:
} else if (request.type === 'membership-fee') {
/**
* If type is membership fee
*/
this.form.get('total')?.setValue(this.gym?.membership_fee?.total);
} else {
/**
* Operation type not recognized
*/
this.toast.error('Tipo di operazione non riconosciuto');
($('#editSaleModal') as any).modal('hide');
}
Run Code Online (Sandbox Code Playgroud)
我当前的 .prettierc:
{ …Run Code Online (Sandbox Code Playgroud)