refactor(linter/plugins): move report function and diagnostic types to separate file#15635
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. |
Merge activity
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the linter plugin code by extracting the report function and diagnostic types from context.ts into a new dedicated file report.ts. This improves code organization and reduces the size of the context.ts file.
Key changes:
- Created new
report.tsfile containing thereportfunction, diagnostic types, and related helper functions - Exported
filePathfromcontext.tsto allowreport.tsto access it - Updated all import statements across affected files to reflect the new module structure
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/src-js/plugins/report.ts | New file containing extracted report function, diagnostic types (Diagnostic, DiagnosticBase, DiagnosticWithNode, DiagnosticWithLoc), and helper functions (getMessage, resolveMessageFromMessageId) |
| apps/oxlint/src-js/plugins/context.ts | Removed report implementation and diagnostic types; exported filePath variable; updated to import and delegate to report function from report.ts |
| apps/oxlint/src-js/plugins/lint.ts | Updated import to get diagnostics from report.ts instead of context.ts |
| apps/oxlint/src-js/plugins/fix.ts | Updated import to get Diagnostic type from report.ts instead of context.ts |
| apps/oxlint/src-js/index.ts | Updated re-exports to export diagnostic types from report.ts instead of context.ts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e6e9d1e to
5d2d34c
Compare
… to separate file (#15635) Pure refactor. Move `report` function and `Diagnostic` types into a separate file. `context.ts` was getting too long.
5d2d34c to
d2ff4ba
Compare

Pure refactor. Move
reportfunction andDiagnostictypes into a separate file.context.tswas getting too long.