メインコンテンツへスキップ

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"
}
};

Playgroundでこのルールを試す ↗

リソース

ESLint coreから❤️を込めて。