Skip to content

Commit

Permalink
feat: fix indent rule for else-if (#17318)
Browse files Browse the repository at this point in the history
* feat: fix indent rule for else-if

Fixes #17316

* add more test cases
  • Loading branch information
mdjermanovic committed Jul 3, 2023
1 parent 1fc50a8 commit d34abe5
Show file tree
Hide file tree
Showing 2 changed files with 577 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rules/indent.js
Expand Up @@ -1250,7 +1250,7 @@ module.exports = {

IfStatement(node) {
addBlocklessNodeIndent(node.consequent);
if (node.alternate && node.alternate.type !== "IfStatement") {
if (node.alternate) {
addBlocklessNodeIndent(node.alternate);
}
},
Expand Down

0 comments on commit d34abe5

Please sign in to comment.