Skip to content

Commit 8a03a5f

Browse files
committed
fix: check for comments immediately above any node by default
This fix is so that for rules allowing contexts not yet covered by `getJSDocComment` can at least lint comments immediately above the block
1 parent 2ba2924 commit 8a03a5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/eslint/getJSDocComment.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ const getJSDocComment = function (sourceCode, node) {
9696

9797
return findJSDocComment(node);
9898

99-
// falls through
10099
default:
101-
return null;
100+
if (!node) {
101+
return null;
102+
}
103+
104+
return findJSDocComment(node);
102105
}
103106
};
104107
/* eslint-enable complexity */

0 commit comments

Comments
 (0)