File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
apps/oxlint/src-js/plugins Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * `SourceCode` methods related to comments.
3+ */
4+
15import { ast , initAst , sourceText } from './source_code.js' ;
26
37import type { Comment , Node , NodeOrToken } from './types.ts' ;
Original file line number Diff line number Diff line change @@ -6,13 +6,7 @@ import { DATA_POINTER_POS_32, SOURCE_LEN_OFFSET } from '../generated/constants.j
66import { deserializeProgramOnly , resetBuffer } from '../../dist/generated/deserialize.js' ;
77
88import visitorKeys from '../generated/keys.js' ;
9- import {
10- commentsExistBetween ,
11- getAllComments ,
12- getCommentsAfter ,
13- getCommentsBefore ,
14- getCommentsInside ,
15- } from './comments.js' ;
9+ import * as commentMethods from './comments.js' ;
1610import {
1711 getLineColumnFromOffset ,
1812 getNodeLoc ,
@@ -164,12 +158,6 @@ export const SOURCE_CODE = Object.freeze({
164158 return sourceText . slice ( start , end ) ;
165159 } ,
166160
167- getAllComments,
168- getCommentsBefore,
169- getCommentsAfter,
170- getCommentsInside,
171- commentsExistBetween,
172-
173161 /**
174162 * Determine if two nodes or tokens have at least one whitespace character between them.
175163 * Order does not matter. Returns `false` if the given nodes or tokens overlap.
@@ -183,6 +171,13 @@ export const SOURCE_CODE = Object.freeze({
183171 throw new Error ( '`sourceCode.isSpaceBetween` not implemented yet' ) ; // TODO
184172 } ,
185173
174+ // Comment methods
175+ getAllComments : commentMethods . getAllComments ,
176+ getCommentsBefore : commentMethods . getCommentsBefore ,
177+ getCommentsAfter : commentMethods . getCommentsAfter ,
178+ getCommentsInside : commentMethods . getCommentsInside ,
179+ commentsExistBetween : commentMethods . commentsExistBetween ,
180+
186181 // Scope methods
187182 isGlobalReference : scopeMethods . isGlobalReference ,
188183 getDeclaredVariables : scopeMethods . getDeclaredVariables ,
You can’t perform that action at this time.
0 commit comments