Skip to main content

max-params

Enforce a maximum number of parameters in function definitions.


此规则扩展了基本 eslint/max-params 规则。 此版本添加了对 TypeScript this 参数的支持,因此它们不会被计为参数。

英:This rule extends the base eslint/max-params rule. This version adds support for TypeScript this parameters so they won't be counted as a parameter.

如何使用

.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"
}
};
在线运行试试这个规则 ↗

选项

参见 eslint/max-params 选项

资源

摘自 ❤️ ESLint 内核