refactor(linter/plugins): move comments methods into own file#20363
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
A pure refactor that extracts SourceCode comment-related methods from comments.ts into a dedicated comments_methods.ts file, mirroring the existing pattern of tokens.ts / tokens_methods.ts. A small safety check is also added to the inline_search build plugin.
Changes:
- Moved comment query methods (
getAllComments,getCommentsBefore,getCommentsAfter,getCommentsInside,commentsExistBetween,getJSDocComment) into a newcomments_methods.tsfile. - Updated imports in
source_code.tsand theinline_searchtsdown plugin to reference the new file path. - Added a build-time assertion in
inline_search.tsto fail if nofirstTokenAtOrAftercalls are found for inlining.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
apps/oxlint/src-js/plugins/comments_methods.ts |
New file containing comment-related SourceCode methods moved from comments.ts |
apps/oxlint/src-js/plugins/comments.ts |
Removed moved methods; updated module-level comment |
apps/oxlint/src-js/plugins/source_code.ts |
Updated commentMethods import to point to comments_methods.ts |
apps/oxlint/tsdown_plugins/inline_search.ts |
Updated FILES path and added a safety check for zero inlined calls |
Merge activity
|
9a256b8 to
53acd73
Compare
Pure refactor. Move `sourceCode` methods related to comments into a separate file `comments_methods.ts`. Does not alter any of the code, just moves it.
70b2361 to
159c3e2
Compare
Pure refactor. Move `sourceCode` methods related to comments into a separate file `comments_methods.ts`. Does not alter any of the code, just moves it.
53acd73 to
9cd612f
Compare
159c3e2 to
ef41ffa
Compare

Pure refactor. Move
sourceCodemethods related to comments into a separate filecomments_methods.ts. Does not alter any of the code, just moves it.