-
-
Notifications
You must be signed in to change notification settings - Fork 739
fix(linter): Correct the config option docs for eslint/init-declarations and eslint/grouped-accessor-pairs.
#16561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: handle-tuple-rules-better
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #16561 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this 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 the configuration structure for eslint/init-declarations and eslint/grouped-accessor-pairs rules to use tuple-based configs with DefaultRuleConfig, improving documentation generation for these rules. The changes align with the repository's configuration pattern where the first tuple element represents the primary option and the second element contains additional configuration properties.
Key Changes:
- Migrated both rules from struct-based to tuple-based configuration structure
- Simplified
from_configurationimplementation usingDefaultRuleConfigwrapper - Enhanced documentation with detailed descriptions on enum variants
- Standardized code formatting (comment style, import organization)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
crates/oxc_linter/src/rules/eslint/init_declarations.rs |
Refactored to use tuple-based config InitDeclarations(Mode, InitDeclarationsConfig), replaced manual parsing with serde deserialization, and added enum variant documentation. Missing Serialize derives on config types. |
crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs |
Refactored to use tuple-based config GroupedAccessorPairs(PairOrder, GroupedAccessorPairsConfig), aliased Box to OBox to avoid std library conflicts, updated destructuring patterns throughout, and enhanced documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ca59885 to
962bfe2
Compare
…ule, as it takes a tuple value. Also refactor the rule to use DefaultRuleConfig to parse its configuration object.
This should be documented as accepting a tuple of values, not an object. This change corrects that problem and updates the configuration parsing to use DefaultRuleConfig. I also needed to alias Box as OBox to avoid JsonSchema derive issues. Not entirely clear on why, but it works fine.
This ensures that the match is the primary part of the `run` function, so the codegen can detect it properly.
515fc44 to
ac17e8b
Compare
These rules accept tuple options, so this updates the code accordingly to support that. Part of #16023.
init-declarations:
grouped-accessor-pairs: