fix(linter): Fix the config option docs for array-callback-return rule.#16854
fix(linter): Fix the config option docs for array-callback-return rule.#16854graphite-app[bot] merged 1 commit intomainfrom
array-callback-return rule.#16854Conversation
There was a problem hiding this comment.
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_returntoallow_implicitto match ESLint's original option name - Refactored
from_configurationto use theDefaultRuleConfigpattern, which is the standard approach used throughout the codebase - Added necessary imports (
DeserializeandDefaultRuleConfig) to support the new deserialization pattern
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
There was a problem hiding this comment.
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
ArrayCallbackReturnrule configuration to align option naming with ESLint docs by renaming the field fromallow_implicit_returntoallow_implicit. - Switched
from_configurationfrom manual JSON extraction toDefaultRuleConfig<ArrayCallbackReturn>deserialization viaserde_json::from_value. - Added
serde::Deserializederive toArrayCallbackReturnto support config deserialization. - Adjusted rule logic to reference the renamed config field in the
matchover(array_method, check_for_each, allow_implicit).
CodSpeed Performance ReportMerging #16854 will not alter performanceComparing Summary
Footnotes
|
…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
6940039 to
d402242
Compare
The config option docs were displaying the wrong name for the option. It was calling the option
allowImplicitReturninstead ofallowImplicit.The tests and serialization used the correct name, and
allowImplicitmatches the original ESLint rule's option name.See original rule's docs: https://eslint.org/docs/latest/rules/array-callback-return#allowimplicit