fix(linter): Generate config option docs for primitive config options.#19731
Merged
graphite-app[bot] merged 1 commit intomainfrom Feb 26, 2026
Merged
fix(linter): Generate config option docs for primitive config options.#19731graphite-app[bot] merged 1 commit intomainfrom
graphite-app[bot] merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a documentation generation bug where rules with primitive configuration options (single string/enum arguments) were missing their configuration section entirely in the generated documentation.
Changes:
- Modified
doc_page.rsto handle the case whensection.to_md()returns empty for primitive configs by directly rendering theinstance_typeanddefaultfields - Updated snapshot test to include examples of fixed rules (
typescript/class-literal-property-styleandreact/no-will-update-set-state)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tasks/website_linter/src/rules/doc_page.rs | Added fallback logic to render type and default info when to_md() returns empty for primitive config options |
| tasks/website_linter/src/rules/mod.rs | Added two affected rules to the snapshot test filter list |
| tasks/website_linter/src/rules/snapshots/docs_rule_pages.snap | Added generated documentation for the two newly included rules, showing correct configuration sections |
camc314
approved these changes
Feb 26, 2026
Contributor
Merge activity
|
graphite-app bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
#19731) Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely. This fixes the problem by handling that case when generating docs. It fixes the docs for `typescript/class-literal-property-style`, `node/handle-callback-err` (not merged yet), and `react/no-will-update-set-state`. I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted. We discovered this problem in #19616 The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.
84e73e5 to
75b6782
Compare
#19731) Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely. This fixes the problem by handling that case when generating docs. It fixes the docs for `typescript/class-literal-property-style`, `node/handle-callback-err` (not merged yet), and `react/no-will-update-set-state`. I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted. We discovered this problem in #19616 The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.
75b6782 to
5a7568d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely.
This fixes the problem by handling that case when generating docs. It fixes the docs for
typescript/class-literal-property-style,node/handle-callback-err(not merged yet), andreact/no-will-update-set-state.I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted.
We discovered this problem in #19616
The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.