fix(linter/plugins): support legacy context.report(node, ...) calls#19193
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
This PR addresses ESLint-compatibility for JS plugins by supporting the legacy context.report(node, ...) positional call signature, fixing failures like “Either message or messageId is required” reported in #19192.
Changes:
- Normalize
context.report()arguments to support legacy positional signatures and forward a descriptor to the shared reporter. - Add a new CLI fixture to validate legacy positional
context.report(node, message)behavior end-to-end via snapshots.
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/context.ts | Adds argument normalization so Context#report can accept legacy positional args and still call the shared report() with a descriptor. |
| apps/oxlint/test/fixtures/report_legacy_positional_args/plugin.ts | Fixture plugin that calls context.report(node, message) using the legacy signature. |
| apps/oxlint/test/fixtures/report_legacy_positional_args/.oxlintrc.json | Fixture config enabling the legacy-report rule. |
| apps/oxlint/test/fixtures/report_legacy_positional_args/files/index.js | Minimal input file that triggers a DebuggerStatement. |
| apps/oxlint/test/fixtures/report_legacy_positional_args/output.snap.md | Snapshot asserting expected CLI output from both built-in and plugin diagnostics. |
ac3c716 to
3136acd
Compare
Merge activity
|
3136acd to
d07059c
Compare
…call forms (#19239) Follow on after #19193. Refactor. That PR introduced support for legacy call styles for `context.report`. Move that implementation into `report.ts`, shorten the code a little, and produce consistent object shapes. Avoid calling `convertLegacyCallArgs` in the common case that `report` is called in the modern way.
…call forms (oxc-project#19239) Follow on after oxc-project#19193. Refactor. That PR introduced support for legacy call styles for `context.report`. Move that implementation into `report.ts`, shorten the code a little, and produce consistent object shapes. Avoid calling `convertLegacyCallArgs` in the common case that `report` is called in the modern way.
…call forms (oxc-project#19239) Follow on after oxc-project#19193. Refactor. That PR introduced support for legacy call styles for `context.report`. Move that implementation into `report.ts`, shorten the code a little, and produce consistent object shapes. Avoid calling `convertLegacyCallArgs` in the common case that `report` is called in the modern way.

fixes #19192