docs(linter): Ensure that the docs render default values for various rules that use enum config options#17192
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures that default values for enum config options are properly rendered in documentation by adding the Serialize derive trait to various enum types. The changes also include minor code organization improvements and documentation enhancements.
Key Changes
- Added
Serializederive to enum config types across multiple linter rules to enable default value rendering in documentation - Reordered method implementations in
no_instanceof_builtins.rs(movingrunafterfrom_configuration) - Enhanced documentation and comments in several files
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_linter/src/rules/unicorn/no_instanceof_builtins.rs |
Added Serialize to Strategy enum; reordered run and from_configuration methods |
crates/oxc_linter/src/rules/typescript/no_empty_object_type.rs |
Added Serialize to AllowInterfaces and AllowObjectTypes enums |
crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs |
Added Serialize to FixStyle and Prefer enums |
crates/oxc_linter/src/rules/react/jsx_props_no_spreading.rs |
Added Serialize to IgnoreEnforceOption enum; changed serde rename from camelCase to kebab-case |
crates/oxc_linter/src/rules/eslint/sort_imports.rs |
Added Serialize to MemberSyntaxSortOrder and ImportKind; added #[schemars(transparent)]; improved documentation and comments |
crates/oxc_linter/src/rules/eslint/max_depth.rs |
Added #[serde(rename_all = "camelCase", default)] attribute |
crates/oxc_linter/src/rules/eslint/id_length.rs |
Added Serialize to PropertyKind enum; removed #[schemars(with = "Vec<String>")] attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17192 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
7405940 to
e14db66
Compare
Without the
Serializeflag, the default values for the enum config options that are taken by these rules will not be shown in the docs. This fixes that problem. It also makes a few other minor tweaks.Fixes #17189.