@blumintinc/eslint-plugin-blumint 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -48,8 +48,8 @@ exports.classMethodsReadTopToBottom = (0, createRule_1.createRule)({
|
|
|
48
48
|
// Fetch the actual AST node corresponding to the name
|
|
49
49
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
50
|
const memberNode = node.body.find((member) => getMemberName(member) === n);
|
|
51
|
-
const comments = sourceCode.getCommentsBefore(memberNode);
|
|
52
|
-
memberNode.range = comments.length
|
|
51
|
+
const comments = sourceCode.getCommentsBefore(memberNode) || [];
|
|
52
|
+
memberNode.range = comments.length > 0
|
|
53
53
|
? [
|
|
54
54
|
Math.min(memberNode.range[0], Math.min(...comments.map((comment) => comment.range[0]))),
|
|
55
55
|
Math.max(memberNode.range[1], Math.max(...comments.map((comment) => comment.range[1]))),
|