我想知道是否有規則可以在帶有更漂亮的打字稿中的函式/陳述句和注釋之間添加新行(專案根目錄下的.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');
}
期望的行為:
} 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');
}
我目前的 .prettierc:
{
"useTabs": true,
"tabWidth": 4,
"printWidth": 120
}
uj5u.com熱心網友回復:
不,prettier 沒有這個規定。
Prettier 在
并自動修復此問題,例如在 VSCode 中保存時:

檢查 ESLinter 的此規則。注釋行
ESLinter 為您提供了大量的好處。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/337271.html
下一篇:VSC平臺特定設定
