Skip to content

Comments

refactor(linter/plugins): getMessage return messageId#19105

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-07-refactor_linter_plugins_getmessage_return_messageid_
Feb 8, 2026
Merged

refactor(linter/plugins): getMessage return messageId#19105
graphite-app[bot] merged 1 commit intomainfrom
om/02-07-refactor_linter_plugins_getmessage_return_messageid_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 7, 2026

Pure refactor. Remove duplicated code at 2 x call sites for getMessage, and move the logic into getMessage itself instead.

Copy link
Member Author

overlookmotel commented Feb 7, 2026


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.

@overlookmotel overlookmotel force-pushed the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch from bd38bc5 to c3d4cf9 Compare February 8, 2026 17:41
@overlookmotel overlookmotel force-pushed the om/02-07-feat_linter_plugins_ruletester_test_suggestions branch from c43e884 to acb69f1 Compare February 8, 2026 17:41
@overlookmotel overlookmotel marked this pull request as ready for review February 8, 2026 18:40
Copilot AI review requested due to automatic review settings February 8, 2026 18:40
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 message handling in the JS plugin layer by moving messageId extraction into getMessage, returning both the resolved message and normalized messageId to remove duplicated logic at call sites.

Changes:

  • Refactor getMessage to derive messageId from the provided Diagnostic/Suggestion and return { message, messageId }.
  • Update report() and getSuggestions() to destructure { message, messageId } from getMessage.
  • Remove duplicated messageId normalization logic from the two call sites.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/oxlint/src-js/plugins/report.ts Updates getMessage to return { message, messageId } and adapts report() to use it.
apps/oxlint/src-js/plugins/fix.ts Adapts suggestion message resolution to the new getMessage return shape.

@overlookmotel overlookmotel force-pushed the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch from c3d4cf9 to 37341ce Compare February 8, 2026 19:17
@overlookmotel overlookmotel force-pushed the om/02-07-feat_linter_plugins_ruletester_test_suggestions branch from acb69f1 to 5e713aa Compare February 8, 2026 19:17
@overlookmotel overlookmotel self-assigned this Feb 8, 2026
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 8, 2026
@graphite-app graphite-app bot changed the base branch from om/02-07-feat_linter_plugins_ruletester_test_suggestions to graphite-base/19105 February 8, 2026 20:14
@overlookmotel overlookmotel force-pushed the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch from 37341ce to 4483647 Compare February 8, 2026 20:24
@overlookmotel overlookmotel changed the base branch from graphite-base/19105 to om/02-07-feat_linter_plugins_ruletester_test_suggestions February 8, 2026 20:24
@overlookmotel overlookmotel force-pushed the om/02-07-feat_linter_plugins_ruletester_test_suggestions branch from f076d32 to 71c8d86 Compare February 8, 2026 20:26
@overlookmotel overlookmotel force-pushed the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch from 4483647 to c230a53 Compare February 8, 2026 20:26
@graphite-app graphite-app bot changed the base branch from om/02-07-feat_linter_plugins_ruletester_test_suggestions to graphite-base/19105 February 8, 2026 20:33
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 8, 2026

Merge activity

@graphite-app graphite-app bot changed the base branch from graphite-base/19105 to main February 8, 2026 20:39
Pure refactor. Remove duplicated code at 2 x call sites for `getMessage`, and move the logic into `getMessage` itself instead.
@graphite-app graphite-app bot force-pushed the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch from c230a53 to 28d8882 Compare February 8, 2026 20:40
@graphite-app graphite-app bot merged commit 28d8882 into main Feb 8, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/02-07-refactor_linter_plugins_getmessage_return_messageid_ branch February 8, 2026 20:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 8, 2026
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 A-linter-plugins Area - Linter JS plugins 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.

1 participant