Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 12, 2025

Pure refactor. Move report function and Diagnostic types into a separate file. context.ts was getting too long.

Copy link
Member Author

overlookmotel commented Nov 12, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Nov 12, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 12, 2025 14:47
Copilot AI review requested due to automatic review settings November 12, 2025 14:47
@overlookmotel overlookmotel self-assigned this Nov 12, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 12, 2025
Copy link
Member Author

overlookmotel commented Nov 12, 2025

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts file containing the report function, diagnostic types, and related helper functions
  • Exported filePath from context.ts to allow report.ts to 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.

@overlookmotel overlookmotel force-pushed the 11-12-refactor_linter_plugins_move_report_function_and_diagnostic_types_to_separate_file branch from e6e9d1e to 5d2d34c Compare November 12, 2025 15:08
… to separate file (#15635)

Pure refactor. Move `report` function and `Diagnostic` types into a separate file. `context.ts` was getting too long.
@graphite-app graphite-app bot force-pushed the 11-12-refactor_linter_plugins_move_report_function_and_diagnostic_types_to_separate_file branch from 5d2d34c to d2ff4ba Compare November 12, 2025 15:16
@graphite-app graphite-app bot merged commit d2ff4ba into main Nov 12, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-12-refactor_linter_plugins_move_report_function_and_diagnostic_types_to_separate_file branch November 12, 2025 15:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants