Skip to content

refactor(linter): use serde deserialisation for promise/catch-or-return#23214

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/serde-catch-or-return-config
Jun 10, 2026
Merged

refactor(linter): use serde deserialisation for promise/catch-or-return#23214
graphite-app[bot] merged 1 commit into
mainfrom
codex/serde-catch-or-return-config

Conversation

@camc314

@camc314 camc314 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Migrates the promise catch-or-return rule configuration to serde with DefaultRuleConfig while preserving its existing termination method behavior.

@github-actions github-actions Bot added the A-linter Area - Linter label Jun 10, 2026
@camc314 camc314 changed the title refactor(linter): use serde config for promise catch-or-return refactor(linter): use serde deserialisation for promise/catch-or-return Jun 10, 2026
@camc314 camc314 self-assigned this Jun 10, 2026
@camc314 camc314 marked this pull request as ready for review June 10, 2026 08:40
Copilot AI review requested due to automatic review settings June 10, 2026 08:40
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jun 10, 2026

camc314 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

…rn (#23214)

Migrates the promise `catch-or-return` rule configuration to serde with `DefaultRuleConfig` while preserving its existing termination method behavior.
@graphite-app graphite-app Bot force-pushed the codex/serde-catch-or-return-config branch from 05ce70d to 4c63d48 Compare June 10, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the promise/catch-or-return linter rule’s configuration parsing to use serde via DefaultRuleConfig, including support for terminationMethod being configured as either a string or an array.

Changes:

  • Switched rule configuration parsing from manual serde_json::Value extraction to serde_json::from_value::<DefaultRuleConfig<_>>().
  • Added serde deserialization support to the rule config, including a custom deserializer for terminationMethod to accept both string and array forms.
  • Reduced allocations in termination-method matching by comparing CompactStr entries directly against &str.

Comment thread crates/oxc_linter/src/rules/promise/catch_or_return.rs
@graphite-app graphite-app Bot merged commit 4c63d48 into main Jun 10, 2026
29 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 10, 2026
@graphite-app graphite-app Bot deleted the codex/serde-catch-or-return-config branch June 10, 2026 08:48
graphite-app Bot pushed a commit that referenced this pull request Jun 10, 2026
…#23218)

## Summary
- keep `terminationMethod: []` empty without panicking in `promise/catch-or-return`
- format diagnostics using the full configured termination method list
- add regression coverage for empty and multiple termination method configurations

This is a follow-up to #23214.
camc314 added a commit that referenced this pull request Jul 3, 2026
…rn (#23214)

Migrates the promise `catch-or-return` rule configuration to serde with `DefaultRuleConfig` while preserving its existing termination method behavior.
camc314 added a commit that referenced this pull request Jul 3, 2026
…#23218)

## Summary
- keep `terminationMethod: []` empty without panicking in `promise/catch-or-return`
- format diagnostics using the full configured termination method list
- add regression coverage for empty and multiple termination method configurations

This is a follow-up to #23214.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants