-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Closed
Copy link
Labels
HacktoberfestRecommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussiondocumentationRelates to ESLint's documentationRelates to ESLint's documentationgood first issueGood for people who haven't worked on ESLint beforeGood for people who haven't worked on ESLint beforehelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules
Description
The version of ESLint you are using.
v5.16.0
The problem you want to solve.
The below example is from https://eslint.org/docs/rules/max-depth, ESLint v5.16.0 doesn't make issues for the example.
/*eslint max-depth: ["error", 4]*/
/*eslint-env es6*/
function foo() {
for (;;) { // Nested 1 deep
let val = () => (param) => { // Nested 2 deep
if (true) { // Nested 3 deep
if (true) { // Nested 4 deep
if (true) { // Nested 5 deep
}
}
}
};
}
}
Nesting function expressions would not be counted as a nesting depth, so the arrow function expression would not increase the depth count but reset the count.
Your take on the correct solution to problem.
The below example or other equivalents would work.
/*eslint max-depth: ["error", 3]*/
function foo() {
for (;;) { // Nested 1 deep
if (true) { // Nested 2 deep
if (true) { // Nested 3 deep
if (true) { // Nested 4 deep
}
}
}
}
}
Are you willing to submit a pull request to implement this change?
kaicataldo and StackDoubleFlow
Metadata
Metadata
Assignees
Labels
HacktoberfestRecommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/Recommended issue for those participating in Hacktoberfest https://hacktoberfest.digitalocean.com/acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussiondocumentationRelates to ESLint's documentationRelates to ESLint's documentationgood first issueGood for people who haven't worked on ESLint beforeGood for people who haven't worked on ESLint beforehelp wantedThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issueruleRelates to ESLint's core rulesRelates to ESLint's core rules