max-params
在函式定義中強制使用最多參數數目。
此規則擴充了基本的 eslint/max-params
規則。這個版本新增了對 TypeScript this
參數的支援,因此不會將其計入參數。
選項
請參閱 eslint/max-params
選項。
如何使用
.eslintrc.cjs
module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"max-params": "off",
"@typescript-eslint/max-params": "error"
}
};
在遊樂場中嘗試此規則 ↗