Skip to content

fix(linter): Fix the config option docs for array-callback-return rule.#16854

Merged
graphite-app[bot] merged 1 commit intomainfrom
array-callback-return
Dec 14, 2025
Merged

fix(linter): Fix the config option docs for array-callback-return rule.#16854
graphite-app[bot] merged 1 commit intomainfrom
array-callback-return

Conversation

@connorshea
Copy link
Copy Markdown
Member

The config option docs were displaying the wrong name for the option. It was calling the option allowImplicitReturn instead of allowImplicit.

The tests and serialization used the correct name, and allowImplicit matches the original ESLint rule's option name.

See original rule's docs: https://eslint.org/docs/latest/rules/array-callback-return#allowimplicit

Copilot AI review requested due to automatic review settings December 14, 2025 19:23
@connorshea connorshea requested a review from camc314 as a code owner December 14, 2025 19:23
@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Dec 14, 2025
Copy link
Copy Markdown
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 fixes a documentation error in the array-callback-return rule's configuration option. The field was incorrectly documented as allow_implicit_return but should be allow_implicit to match the original ESLint rule's option name and the existing test cases.

Key Changes

  • Renamed the struct field from allow_implicit_return to allow_implicit to match ESLint's original option name
  • Refactored from_configuration to use the DefaultRuleConfig pattern, which is the standard approach used throughout the codebase
  • Added necessary imports (Deserialize and DefaultRuleConfig) to support the new deserialization pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 14, 2025
@camc314 camc314 self-assigned this Dec 14, 2025
Copy link
Copy Markdown
Contributor

camc314 commented Dec 14, 2025

Merge activity

Copy link
Copy Markdown

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

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

The move to DefaultRuleConfig simplifies config parsing, but unwrap_or_default() currently hides all config deserialization errors, which can make real misconfigurations hard to detect. Also, while the option rename fixes the docs mismatch, it may break users who relied on the previously documented allowImplicitReturn; consider a #[serde(alias = ...)] to maintain compatibility.

Summary of changes

Summary of changes

  • Updated ArrayCallbackReturn rule configuration to align option naming with ESLint docs by renaming the field from allow_implicit_return to allow_implicit.
  • Switched from_configuration from manual JSON extraction to DefaultRuleConfig<ArrayCallbackReturn> deserialization via serde_json::from_value.
  • Added serde::Deserialize derive to ArrayCallbackReturn to support config deserialization.
  • Adjusted rule logic to reference the renamed config field in the match over (array_method, check_for_each, allow_implicit).

@charliecreates charliecreates bot removed the request for review from CharlieHelps December 14, 2025 19:27
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 14, 2025

CodSpeed Performance Report

Merging #16854 will not alter performance

Comparing array-callback-return (6940039) with main (b16fe64)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

…ule. (#16854)

The config option docs were displaying the wrong name for the option. It was calling the option `allowImplicitReturn` instead of `allowImplicit`.

The tests and serialization used the correct name, and `allowImplicit` matches the original ESLint rule's option name.

See original rule's docs: https://eslint.org/docs/latest/rules/array-callback-return#allowimplicit
@graphite-app graphite-app bot force-pushed the array-callback-return branch from 6940039 to d402242 Compare December 14, 2025 19:29
@graphite-app graphite-app bot merged commit d402242 into main Dec 14, 2025
20 checks passed
@graphite-app graphite-app bot deleted the array-callback-return branch December 14, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants