File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
apps/oxlint/src-js/plugins Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ export const SOURCE_CODE = Object.freeze({
221221 getCommentsAfter ( nodeOrToken : NodeOrToken ) : Comment [ ] {
222222 if ( ast === null ) initAst ( ) ;
223223 const { comments } = ast ;
224- if ( comments . length === 0 ) return [ ] ;
224+
225225 let targetEnd = nodeOrToken . end ;
226226
227227 const commentsAfter : Comment [ ] = [ ] ;
@@ -233,7 +233,8 @@ export const SOURCE_CODE = Object.freeze({
233233 if ( commentStart < targetEnd ) {
234234 continue ;
235235 }
236- const whitespaceOnlyGap = whitespacePattern . test ( sourceText . slice ( targetEnd , commentStart ) ) ;
236+ const gap = sourceText . slice ( targetEnd , commentStart ) ;
237+ const whitespaceOnlyGap = whitespacePattern . test ( gap ) ;
237238 if ( whitespaceOnlyGap ) {
238239 commentsAfter . push ( comment ) ;
239240 targetEnd = comment . end ;
You can’t perform that action at this time.
0 commit comments