File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2
2
* Obtained from {@link https://github.com/eslint/eslint/blob/master/lib/util/source-code.js#L313}
3
3
* @license MIT
4
4
*/
5
- import astUtils from 'eslint/lib/util/ast-utils' ;
5
+
6
+ /**
7
+ * Checks if the given token is a comment token or not.
8
+ *
9
+ * @param {Token } token - The token to check.
10
+ * @returns {boolean } `true` if the token is a comment token.
11
+ */
12
+ const isCommentToken = ( token ) => {
13
+ return token . type === 'Line' || token . type === 'Block' || token . type === 'Shebang' ;
14
+ } ;
6
15
7
16
/**
8
17
* Check to see if its a ES6 export declaration.
@@ -40,7 +49,7 @@ const getJSDocComment = function (sourceCode, node) {
40
49
41
50
if (
42
51
tokenBefore &&
43
- astUtils . isCommentToken ( tokenBefore ) &&
52
+ isCommentToken ( tokenBefore ) &&
44
53
tokenBefore . type === 'Block' &&
45
54
tokenBefore . value . charAt ( 0 ) === '*' &&
46
55
astNode . loc . start . line - tokenBefore . loc . end . line <= 1
You can’t perform that action at this time.
0 commit comments