unicorn/max-nested-calls
eslint-plugin-unicorn
No autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/max-nested-calls": "error",
},
},
];foo(bar(baz(qux())));const value = baz(qux());
foo(bar(value));query().filter().map().toArray();Examples from the ESLint documentation.
unicorn/max-nested-calls
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/max-nested-calls": "error",
},
},
];unicorn/max-nested-calls
unicorn plugin · style
{
"rules": {
"unicorn/max-nested-calls": "error"
}
}Biome does not have this rule.
Prevent passing a function reference directly to iterator methods.
Disallow nested ternary expressions.
Enforce consistent naming for boolean names.
Enforce explicitly comparing the length or size property of a value.
Enforce consistent JSON file reads before JSON.parse().