Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: No deep nested hell - max-depth and max-nested-callbacks #794
Comments
This comment has been minimized.
This comment has been minimized.
|
I think this rule is too restrictive. In test code, I often deeply nest callbacks because it's easier and tests are easier to write when they're verbose and repetitive. |
feross
closed this
Feb 21, 2017
This comment has been minimized.
This comment has been minimized.
I'm agree with that and also has such cases, but that's why i suggested 5, because it is completely enough in that cases. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
tunnckoCore commentedFeb 21, 2017
•
edited
Digging more and more in ESLint rules, i found some good ones which enforces good style and more readable code. This issue is for max-depth and max-nested-callbacks rules - both not fixable.
Suggested configuration.
{ "max-nested-callbacks": ["error", { "max": 3 }], "max-depth": ["error", { "max": 3 }] }The
maxoption, may be more sensible like5for example. But i believe it should not be more. I kinda feel it is too restrictive if it is 3 or 4, because with combination of arrow functions you can easily get 3-4 depths nesting. But separation is good thing.