File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,15 +131,6 @@ module.exports = {
131131 return token . value === "else" && token . type === "Keyword" ;
132132 }
133133
134- /**
135- * Gets the `else` keyword token of a given `IfStatement` node.
136- * @param {ASTNode } node A `IfStatement` node to get.
137- * @returns {Token } The `else` keyword token.
138- */
139- function getElseKeyword ( node ) {
140- return node . alternate && sourceCode . getFirstTokenBetween ( node . consequent , node . alternate , isElseKeywordToken ) ;
141- }
142-
143134 /**
144135 * Determines whether the given node has an `else` keyword token as the first token after.
145136 * @param {ASTNode } node The node to check.
@@ -361,7 +352,7 @@ module.exports = {
361352 if ( this . expected ) {
362353 context . report ( {
363354 node,
364- loc : ( name !== "else" ? node : getElseKeyword ( node ) ) . loc . start ,
355+ loc : body . loc ,
365356 messageId : opts && opts . condition ? "missingCurlyAfterCondition" : "missingCurlyAfter" ,
366357 data : {
367358 name
@@ -371,7 +362,7 @@ module.exports = {
371362 } else {
372363 context . report ( {
373364 node,
374- loc : ( name !== "else" ? node : getElseKeyword ( node ) ) . loc . start ,
365+ loc : body . loc ,
375366 messageId : opts && opts . condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter" ,
376367 data : {
377368 name
You can’t perform that action at this time.
0 commit comments